avf: fix simultaneous txq wrap and tx retry 00/32200/1
authorMohammed Hawari <mohammed@hawari.fr>
Tue, 4 May 2021 08:15:32 +0000 (10:15 +0200)
committerMohammed Hawari <mohammed@hawari.fr>
Tue, 4 May 2021 08:15:32 +0000 (10:15 +0200)
Change-Id: Ic2b853cda98c3010d2abb5c7ada1b1f6c5bc9f74
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: fix
Fixes: ca1812dbe714fc8e4de13f88df2d3b830d95a2c9
Ticket: VPP-1980

src/plugins/avf/output.c

index 3c65fb0..e16d79d 100644 (file)
@@ -376,7 +376,7 @@ VNET_DEVICE_CLASS_TX_FN (avf_device_class) (vlib_main_t * vm,
   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);
-  u16 next = txq->next;
+  u16 next;
   u16 mask = txq->size - 1;
   u32 *buffers = vlib_frame_vector_args (frame);
   u16 n_enq, n_left, n_desc, *slot;
@@ -387,6 +387,7 @@ VNET_DEVICE_CLASS_TX_FN (avf_device_class) (vlib_main_t * vm,
   n_left = frame->n_vectors;
 
 retry:
+  next = txq->next;
   /* release consumed bufs */
   if (txq->n_enqueued)
     {