summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-11-06 23:25:57 +0100
committerDamjan Marion <dmarion@me.com>2021-01-21 13:20:10 +0000
commit941005336ee8cec614a856089f3d873f7d98135c (patch)
tree2a9287e8a16cfbfecac80251637658a4cf93db66 /src/plugins/dpdk/device/init.c
parent1e4309538dd178827fc2a5efb3ceb80a4b1f1a8f (diff)
interface: rx queue infra rework, part one
Type: improvement Change-Id: I4008cadfd5141f921afbdc09a3ebcd1dcf88eb29 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/init.c')
-rw-r--r--src/plugins/dpdk/device/init.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index a1eead20541..8e4bf558a19 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -22,6 +22,7 @@
#include <vlib/log.h>
#include <vnet/ethernet/ethernet.h>
+#include <vnet/interface/rx_queue_funcs.h>
#include <dpdk/buffer.h>
#include <dpdk/device/dpdk.h>
#include <dpdk/cryptodev/cryptodev.h>
@@ -414,6 +415,9 @@ dpdk_lib_init (dpdk_main_t * dm)
else
xd->rx_q_used = 1;
+ vec_validate_aligned (xd->rx_queues, xd->rx_q_used - 1,
+ CLIB_CACHE_LINE_BYTES);
+
xd->flags |= DPDK_DEVICE_FLAG_PMD;
/* workaround for drivers not setting driver_name */
@@ -724,25 +728,30 @@ dpdk_lib_init (dpdk_main_t * dm)
sw = vnet_get_hw_sw_interface (dm->vnet_main, xd->hw_if_index);
xd->sw_if_index = sw->sw_if_index;
- vnet_hw_interface_set_input_node (dm->vnet_main, xd->hw_if_index,
- dpdk_input_node.index);
+ vnet_hw_if_set_input_node (dm->vnet_main, xd->hw_if_index,
+ dpdk_input_node.index);
if (devconf->workers)
{
int i;
q = 0;
clib_bitmap_foreach (i, devconf->workers) {
- vnet_hw_interface_assign_rx_thread (dm->vnet_main, xd->hw_if_index, q++,
- vdm->first_worker_thread_index + i);
+ dpdk_rx_queue_t *rxq = vec_elt_at_index (xd->rx_queues, q);
+ rxq->queue_index = vnet_hw_if_register_rx_queue (
+ dm->vnet_main, xd->hw_if_index, q++,
+ vdm->first_worker_thread_index + i);
}
}
else
for (q = 0; q < xd->rx_q_used; q++)
{
- vnet_hw_interface_assign_rx_thread (dm->vnet_main, xd->hw_if_index, q, /* any */
- ~1);
+ dpdk_rx_queue_t *rxq = vec_elt_at_index (xd->rx_queues, q);
+ rxq->queue_index = vnet_hw_if_register_rx_queue (
+ dm->vnet_main, xd->hw_if_index, q, VNET_HW_IF_RXQ_THREAD_ANY);
}
+ vnet_hw_if_update_runtime_data (dm->vnet_main, xd->hw_if_index);
+
/*Get vnet hardware interface */
hi = vnet_get_hw_interface (dm->vnet_main, xd->hw_if_index);