summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-03-25 11:44:41 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-13 10:39:40 +0000
commit1c8b63069c416fce3c5b1a24f87023716c4b67ca (patch)
tree55a706227a1f256f0e8b3dfcf2150c5f08ac8052
parent8d3ba7eab43e6d24b84d6628ece20fd2d2c5b581 (diff)
avf: fix rx queue refill on buffer alloc failure
If buffer alloc fails, it may happend that rx queue will be stuck as old code only refills if at least one packet is received. Type: fix Change-Id: I388c4f8a9fb2c208bdc222e31b443cbe6b94af82 Signed-off-by: Damjan Marion <damarion@cisco.com> (cherry picked from commit e7f7190381c66cca6c1c3c77b3d43148818a5a4e)
-rw-r--r--src/plugins/avf/input.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c
index 8d1ded88505..da5556a391e 100644
--- a/src/plugins/avf/input.c
+++ b/src/plugins/avf/input.c
@@ -364,12 +364,6 @@ no_more_desc:
or_qw1 |= or_q1x4[0] | or_q1x4[1] | or_q1x4[2] | or_q1x4[3];
#endif
- /* refill rx ring */
- if (ad->flags & AVF_DEVICE_F_VA_DMA)
- avf_rxq_refill (vm, node, rxq, 1 /* use_va_dma */ );
- else
- avf_rxq_refill (vm, node, rxq, 0 /* use_va_dma */ );
-
vlib_get_buffers (vm, to_next, ptd->bufs, n_rx_packets);
vnet_buffer (bt)->sw_if_index[VLIB_RX] = ad->sw_if_index;
@@ -437,6 +431,12 @@ no_more_desc:
ad->hw_if_index, n_rx_packets, n_rx_bytes);
done:
+ /* refill rx ring */
+ if (ad->flags & AVF_DEVICE_F_VA_DMA)
+ avf_rxq_refill (vm, node, rxq, 1 /* use_va_dma */ );
+ else
+ avf_rxq_refill (vm, node, rxq, 0 /* use_va_dma */ );
+
return n_rx_packets;
}