aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-06-03 20:13:59 +0200
committerDamjan Marion <dmarion@me.com>2020-06-04 12:08:09 +0000
commitdfb19cabe20ccf1cbd1aa714f493ccd322839b91 (patch)
treecb43760177d4398ac93ef4c78b8f28cde7b0baf8 /src/plugins/dpdk/device/init.c
parent4496243cc9c9f5a64483923e1f158cab74aca18a (diff)
dpdk: cleanup, add rx queue struct
Type: improvement Change-Id: I3defde103ab245404de42d2be7abcb2c43d49a60 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.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 7911ccc61a8..b69e2b1b7c7 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -143,19 +143,6 @@ dpdk_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi, u32 flags)
return old;
}
-static void
-dpdk_device_lock_init (dpdk_device_t * xd)
-{
- int q;
- vec_validate (xd->lockp, xd->tx_q_used - 1);
- for (q = 0; q < xd->tx_q_used; q++)
- {
- xd->lockp[q] = clib_mem_alloc_aligned (CLIB_CACHE_LINE_BYTES,
- CLIB_CACHE_LINE_BYTES);
- clib_memset ((void *) xd->lockp[q], 0, CLIB_CACHE_LINE_BYTES);
- }
-}
-
static int
dpdk_port_crc_strip_enabled (dpdk_device_t * xd)
{
@@ -623,7 +610,11 @@ dpdk_lib_init (dpdk_main_t * dm)
rte_eth_macaddr_get (i, (void *) addr);
if (xd->tx_q_used < tm->n_vlib_mains)
- dpdk_device_lock_init (xd);
+ for (int q = 0; q < xd->tx_q_used; q++)
+ {
+ dpdk_rx_queue_t *rxq = vec_elt_at_index (xd->rx_queues, q);
+ clib_spinlock_init (&rxq->lock);
+ }
xd->port_id = i;
xd->device_index = xd - dm->devices;