There is a corner case in which driver won't post
receive buffers when driver has processed all received packets
in single loop (i.e. hw_consumer == sw_consumer) and then
HW will start dropping packets since it did not see new receive
buffers posted.
This corner case is seen when size of Rx ring is less than or equals
Rx packet burst count for dev->rx_pkt_burst().
Fixes:
8f2312474529 ("net/qede: fix performance bottleneck in Rx path")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
uint32_t rss_hash;
int rx_alloc_count = 0;
- hw_comp_cons = rte_le_to_cpu_16(*rxq->hw_cons_ptr);
- sw_comp_cons = ecore_chain_get_cons_idx(&rxq->rx_comp_ring);
-
- rte_rmb();
-
- if (hw_comp_cons == sw_comp_cons)
- return 0;
/* Allocate buffers that we used in previous loop */
if (rxq->rx_alloc_count) {
rxq->rx_alloc_count = 0;
}
+ hw_comp_cons = rte_le_to_cpu_16(*rxq->hw_cons_ptr);
+ sw_comp_cons = ecore_chain_get_cons_idx(&rxq->rx_comp_ring);
+
+ rte_rmb();
+
+ if (hw_comp_cons == sw_comp_cons)
+ return 0;
+
while (sw_comp_cons != hw_comp_cons) {
ol_flags = 0;
packet_type = RTE_PTYPE_UNKNOWN;