summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface/tx_queue_funcs.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-04-15 13:12:51 +0200
committerDamjan Marion <dmarion@me.com>2021-05-11 12:40:37 +0000
commit1bd6cbb7aeded36cca4402d0c970b593316c9d70 (patch)
treed7c9809f0a5b62b427f2f108471f64c615b32263 /src/vnet/interface/tx_queue_funcs.h
parent0d39cbac6d688fb98d05c32acec699b25a599ead (diff)
interface: tx queue infra
Type: improvement Change-Id: I415b2f980de10ca3154d2c8677c24792453eccd0 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/interface/tx_queue_funcs.h')
-rw-r--r--src/vnet/interface/tx_queue_funcs.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/vnet/interface/tx_queue_funcs.h b/src/vnet/interface/tx_queue_funcs.h
new file mode 100644
index 00000000000..22956a4eb9b
--- /dev/null
+++ b/src/vnet/interface/tx_queue_funcs.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: Apache-2.0
+ * Copyright(c) 2021 Cisco Systems, Inc.
+ */
+
+#include <vnet/vnet.h>
+
+/* funciton declarations */
+
+u32 vnet_hw_if_get_tx_queue_index_by_id (vnet_main_t *vnm, u32 hw_if_index,
+ u32 queue_id);
+u32 vnet_hw_if_register_tx_queue (vnet_main_t *vnm, u32 hw_if_index,
+ u32 queue_id);
+void vnet_hw_if_unregister_tx_queue (vnet_main_t *vnm, u32 queue_index);
+void vnet_hw_if_unregister_all_tx_queues (vnet_main_t *vnm, u32 hw_if_index);
+void vnet_hw_if_tx_queue_assign_thread (vnet_main_t *vnm, u32 queue_index,
+ u32 thread_index);
+void vnet_hw_if_tx_queue_unassign_thread (vnet_main_t *vnm, u32 queue_index,
+ u32 thread_index);
+
+/* inline functions */
+
+static_always_inline vnet_hw_if_tx_queue_t *
+vnet_hw_if_get_tx_queue (vnet_main_t *vnm, u32 queue_index)
+{
+ vnet_interface_main_t *im = &vnm->interface_main;
+ if (pool_is_free_index (im->hw_if_tx_queues, queue_index))
+ return 0;
+ return pool_elt_at_index (im->hw_if_tx_queues, queue_index);
+}