summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/device.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-07-07 13:29:16 +0200
committerDamjan Marion <dmarion@me.com>2020-07-09 15:32:51 +0000
commit52e9aaf0b55e7742a39d75e5dffb813a3b0c011d (patch)
tree8e7076d00cef04143d56a5a8466aab2460aaa190 /src/plugins/dpdk/device/device.c
parentea7e7087d21151c89056152579e37510234880d6 (diff)
dpdk: add txq struct and fix dpdk tx lock
This introduces a txq structure mirroring the rxq structure. This fixes the case when #txq > #rxq, because lock must be per txq. Type: fix Fixes: dfb19cabe20ccf1cbd1aa714f493ccd322839b91 Change-Id: Ic1bce64d2b08b9a98c8242a1ba1bfcdbda322bec Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/device.c')
-rw-r--r--src/plugins/dpdk/device/device.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index 2467b7d70e5..eb2dbbcf5df 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -158,18 +158,18 @@ static_always_inline
struct rte_mbuf **mb, u32 n_left)
{
dpdk_main_t *dm = &dpdk_main;
- dpdk_rx_queue_t *rxq;
+ dpdk_tx_queue_t *txq;
u32 n_retry;
int n_sent = 0;
int queue_id;
n_retry = 16;
queue_id = vm->thread_index % xd->tx_q_used;
- rxq = vec_elt_at_index (xd->rx_queues, queue_id);
+ txq = vec_elt_at_index (xd->tx_queues, queue_id);
do
{
- clib_spinlock_lock_if_init (&rxq->lock);
+ clib_spinlock_lock_if_init (&txq->lock);
if (PREDICT_TRUE (xd->flags & DPDK_DEVICE_FLAG_PMD))
{
@@ -183,7 +183,7 @@ static_always_inline
n_sent = 0;
}
- clib_spinlock_unlock_if_init (&rxq->lock);
+ clib_spinlock_unlock_if_init (&txq->lock);
if (PREDICT_FALSE (n_sent < 0))
{