Skip to content

Commit 0ec1713

Browse files
mfijalkoAlexei Starovoitov
authored andcommitted
ice: xsk: Stop Rx processing when ntc catches ntu
This can happen with big budget values and some breakage of re-filling descriptors as we do not clear the entry that ntu is pointing at the end of ice_alloc_rx_bufs_zc. So if ntc is at ntu then it might be the case that status_error0 has an old, uncleared value and ntc would go over with processing which would result in false results. Break Rx loop when ntc == ntu to avoid broken behavior. Fixes: 3876ff5 ("ice: xsk: Handle SW XDP ring wrap and bump tail more often") Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20220328142123.170157-4-maciej.fijalkowski@intel.com
1 parent 30d19d5 commit 0ec1713

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/ethernet/intel/ice/ice_xsk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,9 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring, int budget)
608608
*/
609609
dma_rmb();
610610

611+
if (unlikely(rx_ring->next_to_clean == rx_ring->next_to_use))
612+
break;
613+
611614
xdp = *ice_xdp_buf(rx_ring, rx_ring->next_to_clean);
612615

613616
size = le16_to_cpu(rx_desc->wb.pkt_len) &

0 commit comments

Comments
 (0)