All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path
@ 2021-08-17 20:37 Tony Nguyen
  2021-08-18  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Nguyen @ 2021-08-17 20:37 UTC (permalink / raw)
  To: davem, kuba
  Cc: Wang Hai, netdev, anthony.l.nguyen, maciej.fijalkowski,
	magnus.karlsson, Sandeep Penigalapati

From: Wang Hai <wanghai38@huawei.com>

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 <wanghai38@huawei.com>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net 1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path
  2021-08-17 20:37 [PATCH net 1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path Tony Nguyen
@ 2021-08-18  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-18  1:00 UTC (permalink / raw)
  To: Nguyen, Anthony L
  Cc: davem, kuba, wanghai38, netdev, maciej.fijalkowski,
	magnus.karlsson, sandeep.penigalapati

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 <wanghai38@huawei.com>
> 
> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-18  1:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 20:37 [PATCH net 1/1] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path Tony Nguyen
2021-08-18  1:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.