linux-stable/drivers/net/ethernet/intel
Maciej Fijalkowski d1ec975f9f ice: xsk: clear status_error0 for each allocated desc
Fix a bug in which the receiving of packets can stop in the zero-copy
driver. Ice HW ignores 3 lower bits from QRX_TAIL register, which means
that tail is bumped only on intervals of 8. Currently with XSK RX
batching in place, ice_alloc_rx_bufs_zc() clears the status_error0 only
of the last descriptor that has been allocated/taken from the XSK buffer
pool. status_error0 includes DD bit that is looked upon by the
ice_clean_rx_irq_zc() to tell if a descriptor can be processed.

The bug can be triggered when driver updates the ntu but not the
QRX_TAIL, so HW wouldn't have a chance to write to the ready
descriptors. Later on driver moves the ntc to the mentioned set of
descriptors and interprets them as a ready to be processed, since
corresponding DD bits were not cleared nor any writeback has happened
that would clear it. This can then lead to ntc == ntu case which means
that ring is empty and no further packet processing.

Fix the XSK traffic hang that can be observed when l2fwd scenario from
xdpsock is used by making sure that status_error0 is cleared for each
descriptor that is fed to HW and therefore we are sure that driver will
not processed non-valid DD bits. This will also prevent the driver from
processing the descriptors that were allocated in favor of the
previously processed ones, but writeback didn't happen yet.

Fixes: db804cfc21 ("ice: Use the xsk batched rx allocation interface")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-11-30 12:09:33 +00:00
..
e1000 ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
e1000e Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-22 11:41:16 +01:00
fm10k ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2021-10-02 14:18:25 +01:00
i40e i40e: Fix display error code in dmesg 2021-11-17 16:20:57 -08:00
iavf iavf: Fix VLAN feature flags after VFR 2021-11-19 09:26:41 -08:00
ice ice: xsk: clear status_error0 for each allocated desc 2021-11-30 12:09:33 +00:00
igb igb: fix netpoll exit with traffic 2021-11-25 07:39:31 -08:00
igbvf ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
igc igc: Change Device Reset to Port Reset 2021-10-29 10:36:58 -07:00
ixgb ethernet: ixgb: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
ixgbe net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
ixgbevf net: ixgbevf: Remove redundant initialization of variable ret_val 2021-10-29 09:42:59 -07:00
Kconfig ice: support basic E-Switch mode control 2021-10-07 10:41:41 -07:00
Makefile
e100.c e100: fix device suspend/resume 2021-11-18 11:40:31 +00:00