api: refactor to use REPLY_MSG_ID_BASE #define
[vpp.git] / src / vnet / interface / tx_queue_funcs.h
1 /* 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
9 u32 vnet_hw_if_get_tx_queue_index_by_id (vnet_main_t *vnm, u32 hw_if_index,
10                                          u32 queue_id);
11 u32 vnet_hw_if_register_tx_queue (vnet_main_t *vnm, u32 hw_if_index,
12                                   u32 queue_id);
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,
16                                         u32 thread_index);
17 void vnet_hw_if_tx_queue_unassign_thread (vnet_main_t *vnm, u32 queue_index,
18                                           u32 thread_index);
19
20 /* inline functions */
21
22 static_always_inline vnet_hw_if_tx_queue_t *
23 vnet_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 }