ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc()
Subsystems (4)
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().
--- 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
@@ -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
Quoted 4 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Maciej Fijalkowski
Sent: Thursday, February 3, 2022 6:28 PM
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 inixgbe_xmit_zc()Commit
c685c69fba71("ixgbe: don't do anyAF_XDPzero-copy transmit if netif is not OK") addressed the ring transient state whenMEM_TYPE_XSK_BUFF_POOLwas being configured which in turn caused the interface to through down/up. Maurice reported that when carrier is not ok andxsk_poolis present on ring pair, ksoftirqd will consume 100% CPU cycles due to the constant NAPI rescheduling asixgbe_poll()states that there is still some work to be done.To fix this, do not set
work_doneto false for a !netif_carrier_ok().
Quoted 9 lines
Fixes c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif isnot OK")
Reported-by Maurice Baijens <[email protected]>Tested-by Maurice Baijens <[email protected]>Signed-off-by Maciej Fijalkowski <[email protected]>---
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)