[PATCH net 1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path

Subsystems: intel ethernet drivers, networking drivers, the rest

STALE1814d LANDED: 2 (1M)

2 review trailers; landed in mainline as 1b80fec7b043 on 2021-08-18.

2 messages, 2 authors, 2021-08-18 · open the first message on its own page

[PATCH net 1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path

From: Tony Nguyen <anthony.l.nguyen@intel.com>
Date: 2021-08-17 20:34:10

From: Wang Hai <redacted>

In ixgbe_xsk_pool_enable(), if ixgbe_xsk_wakeup() fails,
We should restore the previous state and clean up the
resources. Add the missing clear af_xdp_zc_qps and unmap dma
to fix this bug.

Fixes: d49e286d354e ("ixgbe: add tracking of AF_XDP zero-copy state for each queue pair")
Fixes: 4a9b32f30f80 ("ixgbe: fix potential RX buffer starvation for AF_XDP")
Signed-off-by: Wang Hai <redacted>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Tested-by: Sandeep Penigalapati <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
index 96dd1a4f956a..b1d22e4d5ec9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
@@ -52,8 +52,11 @@ static int ixgbe_xsk_pool_enable(struct ixgbe_adapter *adapter,
 
 		/* Kick start the NAPI context so that receiving will start */
 		err = ixgbe_xsk_wakeup(adapter->netdev, qid, XDP_WAKEUP_RX);
-		if (err)
+		if (err) {
+			clear_bit(qid, adapter->af_xdp_zc_qps);
+			xsk_pool_dma_unmap(pool, IXGBE_RX_DMA_ATTR);
 			return err;
+		}
 	}
 
 	return 0;
-- 
2.26.2

Re: [PATCH net 1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-08-18 01:00:09

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue, 17 Aug 2021 13:37:36 -0700 you wrote:
From: Wang Hai <redacted>

In ixgbe_xsk_pool_enable(), if ixgbe_xsk_wakeup() fails,
We should restore the previous state and clean up the
resources. Add the missing clear af_xdp_zc_qps and unmap dma
to fix this bug.

[...]
Here is the summary with links:
  - [net,1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path
    https://git.kernel.org/netdev/net/c/1b80fec7b043

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help