octeon: refill even if nothing dequeued from rx queue 18/40618/2
authorDamjan Marion <damarion@cisco.com>
Wed, 27 Mar 2024 21:19:15 +0000 (22:19 +0100)
committerDamjan Marion <dmarion@0xa5.net>
Mon, 1 Apr 2024 10:48:53 +0000 (10:48 +0000)
It may happen that rx queue is empty of free buffers due to previous
alloc failure.

Type: fix
Fixes: 01fe7ab
Change-Id: I344dcda11525444bd1358b3d36ffdf8ab9aa2677
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/dev_octeon/rx_node.c

index 5f7e5a8..35776c8 100644 (file)
@@ -313,7 +313,7 @@ oct_rx_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
   n_desc = (status.tail - head) & cq_mask;
 
   if (n_desc == 0)
-    return 0;
+    goto refill;
 
   vlib_get_new_next_frame (vm, node, ctx->next_index, ctx->to_next,
                           ctx->n_left_to_next);
@@ -365,14 +365,15 @@ oct_rx_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
 
   vlib_put_next_frame (vm, node, ctx->next_index, ctx->n_left_to_next);
 
-  n_enq = crq->n_enq - ctx->n_segs;
-  n_enq += oct_rxq_refill (vm, rxq, rxq->size - n_enq);
-  crq->n_enq = n_enq;
-
   vlib_increment_combined_counter (
     vnm->interface_main.combined_sw_if_counters + VNET_INTERFACE_COUNTER_RX,
     thr_idx, ctx->hw_if_index, ctx->n_rx_pkts, ctx->n_rx_bytes);
 
+refill:
+  n_enq = crq->n_enq - ctx->n_segs;
+  n_enq += oct_rxq_refill (vm, rxq, rxq->size - n_enq);
+  crq->n_enq = n_enq;
+
   return ctx->n_rx_pkts;
 }