avf: avoid eating our own tail 88/32288/1
authorDamjan Marion <damarion@cisco.com>
Wed, 12 May 2021 12:43:21 +0000 (14:43 +0200)
committerDamjan Marion <damarion@cisco.com>
Wed, 12 May 2021 13:46:59 +0000 (15:46 +0200)
This happens in case we are not able to refill ring with new buffers.

Type: fix
Change-Id: I727e55c5b8482d9b8aeb4a9933a9a755fe21e55f
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/avf/input.c

index 6e437da..4d037b4 100644 (file)
@@ -428,6 +428,9 @@ no_more_desc:
   rxq->next = next;
   rxq->n_enqueued -= n_rx_packets + n_tail_desc;
 
+  /* avoid eating our own tail */
+  rxq->descs[(next + rxq->n_enqueued) & mask].qword[1] = 0;
+
 #if defined(CLIB_HAVE_VEC256) || defined(CLIB_HAVE_VEC128)
   or_qw1 |= or_q1x4[0] | or_q1x4[1] | or_q1x4[2] | or_q1x4[3];
 #endif