Skip to content

Commit 1b80fec

Browse files
Wang Haikuba-moo
authored andcommitted
ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path
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: d49e286 ("ixgbe: add tracking of AF_XDP zero-copy state for each queue pair") Fixes: 4a9b32f ("ixgbe: fix potential RX buffer starvation for AF_XDP") Signed-off-by: Wang Hai <[email protected]> Acked-by: Magnus Karlsson <[email protected]> Tested-by: Sandeep Penigalapati <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e5e487a commit 1b80fec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ static int ixgbe_xsk_pool_enable(struct ixgbe_adapter *adapter,
5252

5353
/* Kick start the NAPI context so that receiving will start */
5454
err = ixgbe_xsk_wakeup(adapter->netdev, qid, XDP_WAKEUP_RX);
55-
if (err)
55+
if (err) {
56+
clear_bit(qid, adapter->af_xdp_zc_qps);
57+
xsk_pool_dma_unmap(pool, IXGBE_RX_DMA_ATTR);
5658
return err;
59+
}
5760
}
5861

5962
return 0;

0 commit comments

Comments
 (0)