diff options
author | Mohammed Hawari <mohammed@hawari.fr> | 2020-12-11 19:36:37 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-01-22 09:06:47 +0000 |
commit | 9fecbe1841dbdb6d29fbeae4c3d7ebc728e9692a (patch) | |
tree | ce0db37dd41a08eb1fdf16c1b97ffd6eeebf4864 /src/vnet/interface_api.c | |
parent | e848c8fb8c18bd04d7e27b9574fc8163a4c31d85 (diff) |
interface: fix rx-placement api/cli for new infra
Change-Id: Ic977ffe761efc2129c61aec581da5479fe4838da
Type: fix
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r-- | src/vnet/interface_api.c | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c index a06f02fe0ac..ab9d04af2d8 100644 --- a/src/vnet/interface_api.c +++ b/src/vnet/interface_api.c @@ -21,6 +21,7 @@ #include <vlibmemory/api.h> #include <vnet/interface.h> +#include <vnet/interface/rx_queue_funcs.h> #include <vnet/api_errno.h> #include <vnet/ethernet/ethernet.h> #include <vnet/ip/ip.h> @@ -1069,29 +1070,24 @@ static void vl_api_sw_interface_rx_placement_dump_t_handler if (sw_if_index == ~0) { - vnet_device_input_runtime_t *rt; - vnet_device_and_queue_t *dq; - vlib_node_t *pn = vlib_get_node_by_name (am->vlib_main, - (u8 *) "device-input"); - uword si; - int index = 0; - - /* *INDENT-OFF* */ - foreach_vlib_main (({ - clib_bitmap_foreach (si, pn->sibling_bitmap) - { - rt = vlib_node_get_runtime_data (this_vlib_main, si); - vec_foreach (dq, rt->devices_and_queues) - { - vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, - dq->hw_if_index); - send_interface_rx_placement_details (am, reg, hw->sw_if_index, index, - dq->queue_id, dq->mode, mp->context); - } - } - index++; - })); - /* *INDENT-ON* */ + vnet_hw_if_rx_queue_t **all_queues = 0; + vnet_hw_if_rx_queue_t **qptr; + vnet_hw_if_rx_queue_t *q; + vec_foreach (q, vnm->interface_main.hw_if_rx_queues) + vec_add1 (all_queues, q); + vec_sort_with_function (all_queues, vnet_hw_if_rxq_cmp_cli_api); + + vec_foreach (qptr, all_queues) + { + u32 current_thread = qptr[0]->thread_index; + u32 hw_if_index = qptr[0]->hw_if_index; + vnet_hw_interface_t *hw_if = + vnet_get_hw_interface (vnm, hw_if_index); + send_interface_rx_placement_details ( + am, reg, hw_if->sw_if_index, current_thread, qptr[0]->queue_id, + qptr[0]->mode, mp->context); + } + vec_free (all_queues); } else { @@ -1114,13 +1110,13 @@ static void vl_api_sw_interface_rx_placement_dump_t_handler vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, si->hw_if_index); - for (i = 0; i < vec_len (hw->dq_runtime_index_by_queue); i++) + for (i = 0; i < vec_len (hw->rx_queue_indices); i++) { - send_interface_rx_placement_details (am, reg, hw->sw_if_index, - hw->input_node_thread_index_by_queue - [i], i, - hw->rx_mode_by_queue[i], - mp->context); + vnet_hw_if_rx_queue_t *rxq = + vnet_hw_if_get_rx_queue (vnm, hw->rx_queue_indices[i]); + send_interface_rx_placement_details ( + am, reg, hw->sw_if_index, rxq->thread_index, rxq->queue_id, + rxq->mode, mp->context); } } |