]> git.dujemihanovic.xyz Git - linux.git/commit
ice: respect netif readiness in AF_XDP ZC related ndo's
authorMichal Kubiak <michal.kubiak@intel.com>
Fri, 26 Jul 2024 18:17:09 +0000 (20:17 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 29 Jul 2024 15:52:29 +0000 (08:52 -0700)
commitec145a18687fec8dd97eeb4f30057fa4debef577
tree8df88f7bbb44839a641a008fa754f7e3e3b68b58
parent039564d2fd37b122ec0d268e2ee6334e7169e225
ice: respect netif readiness in AF_XDP ZC related ndo's

Address a scenario in which XSK ZC Tx produces descriptors to XDP Tx
ring when link is either not yet fully initialized or process of
stopping the netdev has already started. To avoid this, add checks
against carrier readiness in ice_xsk_wakeup() and in ice_xmit_zc().
One could argue that bailing out early in ice_xsk_wakeup() would be
sufficient but given the fact that we produce Tx descriptors on behalf
of NAPI that is triggered for Rx traffic, the latter is also needed.

Bringing link up is an asynchronous event executed within
ice_service_task so even though interface has been brought up there is
still a time frame where link is not yet ok.

Without this patch, when AF_XDP ZC Tx is used simultaneously with stack
Tx, Tx timeouts occur after going through link flap (admin brings
interface down then up again). HW seem to be unable to transmit
descriptor to the wire after HW tail register bump which in turn causes
bit __QUEUE_STATE_STACK_XOFF to be set forever as
netdev_tx_completed_queue() sees no cleaned bytes on the input.

Fixes: 126cdfe1007a ("ice: xsk: Improve AF_XDP ZC Tx and use batching API")
Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_xsk.c