1 /* SPDX-License-Identifier: Apache-2.0
2 * Copyright(c) 2021 Cisco Systems, Inc.
7 /* funciton declarations */
9 u32 vnet_hw_if_get_tx_queue_index_by_id (vnet_main_t *vnm, u32 hw_if_index,
11 u32 vnet_hw_if_register_tx_queue (vnet_main_t *vnm, u32 hw_if_index,
13 void vnet_hw_if_unregister_tx_queue (vnet_main_t *vnm, u32 queue_index);
14 void vnet_hw_if_unregister_all_tx_queues (vnet_main_t *vnm, u32 hw_if_index);
15 void vnet_hw_if_tx_queue_assign_thread (vnet_main_t *vnm, u32 queue_index,
17 void vnet_hw_if_tx_queue_unassign_thread (vnet_main_t *vnm, u32 queue_index,
20 /* inline functions */
22 static_always_inline vnet_hw_if_tx_queue_t *
23 vnet_hw_if_get_tx_queue (vnet_main_t *vnm, u32 queue_index)
25 vnet_interface_main_t *im = &vnm->interface_main;
26 if (pool_is_free_index (im->hw_if_tx_queues, queue_index))
28 return pool_elt_at_index (im->hw_if_tx_queues, queue_index);
31 static_always_inline int
32 vnet_hw_if_txq_cmp_cli_api (vnet_hw_if_tx_queue_t **a,
33 vnet_hw_if_tx_queue_t **b)
38 if (a[0]->hw_if_index != b[0]->hw_if_index)
39 return 2 * (a[0]->hw_if_index > b[0]->hw_if_index) - 1;
41 if (a[0]->queue_id != b[0]->queue_id)
42 return 2 * (a[0]->queue_id > b[0]->queue_id) - 1;