Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: Don't allow same value for Rx tail to be written twice

Currently we compare the value we are about to write to the Rx tail
register with the previous value of next_to_use. The problem with this
is we only write tail on 8 descriptor boundaries, but next_to_use is
updated whenever we clean Rx descriptors. Fix this by comparing the
value we are about to write to tail with the previously written tail
value. This will prevent duplicate Rx tail bumps.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Brett Creeley and committed by
Jeff Kirsher
168983a8 ad9a87be

+1 -1
+1 -1
drivers/net/ethernet/intel/ice/ice_txrx_lib.c
··· 10 10 */ 11 11 void ice_release_rx_desc(struct ice_ring *rx_ring, u32 val) 12 12 { 13 - u16 prev_ntu = rx_ring->next_to_use; 13 + u16 prev_ntu = rx_ring->next_to_use & ~0x7; 14 14 15 15 rx_ring->next_to_use = val; 16 16