Skip to contentSkip to conversation

ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc()

PATCH In review Maciej Fijalkowski 2 participants 2 messages Feb 3, 2022 – Mar 2, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc()

Commit c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK") addressed the ring transient state when MEM_TYPE_XSK_BUFF_POOL was being configured which in turn caused the interface to through down/up. Maurice reported that when carrier is not ok and xsk_pool is present on ring pair, ksoftirqd will consume 100% CPU cycles due to the constant NAPI rescheduling as ixgbe_poll() states that there is still some work to be done.

To fix this, do not set work_done to false for a !netif_carrier_ok().

Fixes c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK")
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +4 -2
index b3fd8e5cd85b..6a5e9cf6b5da 100644
@@ -390,12 +390,14 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget)
 	u32 cmd_type;
 
 	while (budget-- > 0) {
-		if (unlikely(!ixgbe_desc_unused(xdp_ring)) ||
-		    !netif_carrier_ok(xdp_ring->netdev)) {
+		if (unlikely(!ixgbe_desc_unused(xdp_ring))) {
 			work_done = false;
 			break;
 		}
 
+		if (!netif_carrier_ok(xdp_ring->netdev))
+			break;
+
 		if (!xsk_tx_peek_desc(pool, &desc))
 			break;
 
Signature · 1 line
2.33.1
Tested-by on v1 1/1
#1 lore raw
Quoted 4 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Maciej Fijalkowski
Sent: Thursday, February 3, 2022 6:28 PM

To: [email protected]

Quoted 16 lines

Cc: Maurice Baijens <[email protected]>; netdev at vger.kernel.org; kuba at kernel.org; bpf at vger.kernel.org; davem at davemloft.net; Karlsson, Magnus <[email protected]>
Subject: [Intel-wired-lan] [PATCH intel-net] ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc()

Commit c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK") addressed the ring transient state when MEM_TYPE_XSK_BUFF_POOL was being configured which in turn caused the interface to through down/up. Maurice reported that when carrier is not ok and xsk_pool is present on ring pair, ksoftirqd will consume 100% CPU cycles due to the constant NAPI rescheduling as ixgbe_poll() states that there is still some work to be done.

To fix this, do not set work_done to false for a !netif_carrier_ok().

Quoted 9 lines
Fixes c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is

not OK")

---
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 6 ++++--

1 file changed, 4 insertions(+), 2 deletions(-)