blob: 22956a4eb9b2c9ec0db527ac3191a0f5d1a74bc0 [file] [log] [blame]
Damjan Marion1bd6cbb2021-04-15 13:12:51 +02001/* SPDX-License-Identifier: Apache-2.0
2 * Copyright(c) 2021 Cisco Systems, Inc.
3 */
4
5#include <vnet/vnet.h>
6
7/* funciton declarations */
8
9u32 vnet_hw_if_get_tx_queue_index_by_id (vnet_main_t *vnm, u32 hw_if_index,
10 u32 queue_id);
11u32 vnet_hw_if_register_tx_queue (vnet_main_t *vnm, u32 hw_if_index,
12 u32 queue_id);
13void vnet_hw_if_unregister_tx_queue (vnet_main_t *vnm, u32 queue_index);
14void vnet_hw_if_unregister_all_tx_queues (vnet_main_t *vnm, u32 hw_if_index);
15void vnet_hw_if_tx_queue_assign_thread (vnet_main_t *vnm, u32 queue_index,
16 u32 thread_index);
17void vnet_hw_if_tx_queue_unassign_thread (vnet_main_t *vnm, u32 queue_index,
18 u32 thread_index);
19
20/* inline functions */
21
22static_always_inline vnet_hw_if_tx_queue_t *
23vnet_hw_if_get_tx_queue (vnet_main_t *vnm, u32 queue_index)
24{
25 vnet_interface_main_t *im = &vnm->interface_main;
26 if (pool_is_free_index (im->hw_if_tx_queues, queue_index))
27 return 0;
28 return pool_elt_at_index (im->hw_if_tx_queues, queue_index);
29}