summaryrefslogtreecommitdiffstats
path: root/src/plugins/vmxnet3/output.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-01-29 15:13:31 -0800
committerDamjan Marion <dmarion@me.com>2019-02-02 15:31:22 +0000
commit773291163a4f72f131afc6a84b065bcfed13aeb7 (patch)
tree55a50c027d91bef911d84e6c437b7aa57bbc9dad /src/plugins/vmxnet3/output.c
parent900cbadde906a000ce1b431fc637a9c0f7089339 (diff)
vmxnet3: multiple TX queues support
Add num-tx-queues to the vmxnet3 create CLI/API. Default is 1. Max is min (8, the number of cores assigned to VPP). Change-Id: I7e0a659a82d01c719665c228dd8a71e3288a2895 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/plugins/vmxnet3/output.c')
-rw-r--r--src/plugins/vmxnet3/output.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/vmxnet3/output.c b/src/plugins/vmxnet3/output.c
index 2a6418dfa44..5c48549e60d 100644
--- a/src/plugins/vmxnet3/output.c
+++ b/src/plugins/vmxnet3/output.c
@@ -108,8 +108,7 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
u16 space_left;
u16 n_left = frame->n_vectors;
vmxnet3_txq_t *txq;
- u32 thread_index = vm->thread_index;
- u16 qid = thread_index, produce;
+ u16 qid = vm->thread_index % vd->num_tx_queues, produce;
if (PREDICT_FALSE (!(vd->flags & VMXNET3_DEVICE_F_LINK_UP)))
{
@@ -119,7 +118,7 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
return (0);
}
- txq = vec_elt_at_index (vd->txqs, qid % vd->num_tx_queues);
+ txq = vec_elt_at_index (vd->txqs, qid);
clib_spinlock_lock_if_init (&txq->lock);
vmxnet3_txq_release (vm, vd, txq);
@@ -202,8 +201,7 @@ VNET_DEVICE_CLASS_TX_FN (vmxnet3_device_class) (vlib_main_t * vm,
}
if (PREDICT_TRUE (produce != txq->tx_ring.produce))
- vmxnet3_reg_write_inline (vd, 0, VMXNET3_REG_TXPROD,
- txq->tx_ring.produce);
+ vmxnet3_reg_write_inline (vd, 0, txq->reg_txprod, txq->tx_ring.produce);
clib_spinlock_unlock_if_init (&txq->lock);