diff options
author | Damjan Marion <damarion@cisco.com> | 2021-04-15 13:12:51 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-05-11 12:40:37 +0000 |
commit | 1bd6cbb7aeded36cca4402d0c970b593316c9d70 (patch) | |
tree | d7c9809f0a5b62b427f2f108471f64c615b32263 /src/plugins/avf/output.c | |
parent | 0d39cbac6d688fb98d05c32acec699b25a599ead (diff) |
interface: tx queue infra
Type: improvement
Change-Id: I415b2f980de10ca3154d2c8677c24792453eccd0
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf/output.c')
-rw-r--r-- | src/plugins/avf/output.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/avf/output.c b/src/plugins/avf/output.c index 78043358e77..4cc9d5a49c1 100644 --- a/src/plugins/avf/output.c +++ b/src/plugins/avf/output.c @@ -375,16 +375,17 @@ VNET_DEVICE_CLASS_TX_FN (avf_device_class) (vlib_main_t * vm, { vnet_interface_output_runtime_t *rd = (void *) node->runtime_data; avf_device_t *ad = avf_get_device (rd->dev_instance); - u32 thread_index = vm->thread_index; - u8 qid = thread_index; - avf_txq_t *txq = vec_elt_at_index (ad->txqs, qid % ad->num_queue_pairs); + vnet_hw_if_tx_frame_t *tf = vlib_frame_scalar_args (frame); + u8 qid = tf->queue_id; + avf_txq_t *txq = vec_elt_at_index (ad->txqs, qid); u16 next; u16 mask = txq->size - 1; u32 *buffers = vlib_frame_vector_args (frame); u16 n_enq, n_left, n_desc, *slot; u16 n_retry = 2; - clib_spinlock_lock_if_init (&txq->lock); + if (tf->shared_queue) + clib_spinlock_lock (&txq->lock); n_left = frame->n_vectors; @@ -474,7 +475,8 @@ retry: AVF_TX_ERROR_NO_FREE_SLOTS, n_left); } - clib_spinlock_unlock_if_init (&txq->lock); + if (tf->shared_queue) + clib_spinlock_unlock (&txq->lock); return frame->n_vectors - n_left; } |