summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/device.c
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/plugins/avf/device.c
parent0d39cbac6d688fb98d05c32acec699b25a599ead (diff)
interface: tx queue infra
Type: improvement Change-Id: I415b2f980de10ca3154d2c8677c24792453eccd0 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf/device.c')
-rw-r--r--src/plugins/avf/device.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index 70ea446432c..05946a4087d 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -21,6 +21,7 @@
#include <vlib/pci/pci.h>
#include <vnet/ethernet/ethernet.h>
#include <vnet/interface/rx_queue_funcs.h>
+#include <vnet/interface/tx_queue_funcs.h>
#include <avf/avf.h>
@@ -303,8 +304,7 @@ avf_txq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 txq_size)
{
qid = qid % ad->num_queue_pairs;
txq = vec_elt_at_index (ad->txqs, qid);
- if (txq->lock == 0)
- clib_spinlock_init (&txq->lock);
+ clib_spinlock_init (&txq->lock);
ad->flags |= AVF_DEVICE_F_SHARED_TXQ_LOCK;
return 0;
}
@@ -1748,6 +1748,14 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args)
}
ad->rxqs[i].queue_index = qi;
}
+
+ for (i = 0; i < ad->n_tx_queues; i++)
+ {
+ u32 qi = vnet_hw_if_register_tx_queue (vnm, ad->hw_if_index, i);
+ vnet_hw_if_tx_queue_assign_thread (vnm, qi, i);
+ ad->txqs[i].queue_index = qi;
+ }
+
vnet_hw_if_update_runtime_data (vnm, ad->hw_if_index);
if (pool_elts (am->devices) == 1)