From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Cc: <anthony.l.nguyen@intel.com>, <przemyslaw.kitszel@intel.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH] i40e: add an error handling path in i40e_xsk_pool_enable()
Date: Mon, 26 Jan 2026 21:37:35 +0100 [thread overview]
Message-ID: <aXfQjwrtvx+UdeB2@boxer> (raw)
In-Reply-To: <20260125140423.2077845-1-lihaoxiang@isrc.iscas.ac.cn>
On Sun, Jan 25, 2026 at 10:04:23PM +0800, Haoxiang Li wrote:
> In i40e_xsk_pool_enable(), the memory allocated by
> xsk_pool_dma_map() should be released if some error
> occurs. Add an error handling path to do so.
>
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
> drivers/net/ethernet/intel/i40e/i40e_xsk.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> index 9f47388eaba5..92b853a75b28 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> @@ -108,23 +108,27 @@ static int i40e_xsk_pool_enable(struct i40e_vsi *vsi,
> if (if_running) {
> err = i40e_queue_pair_disable(vsi, qid);
> if (err)
> - return err;
> + goto unmap;
>
> err = i40e_realloc_rx_xdp_bi(vsi->rx_rings[qid], true);
> if (err)
> - return err;
> + goto unmap;
>
> err = i40e_queue_pair_enable(vsi, qid);
> if (err)
> - return err;
> + goto unmap;
>
> /* Kick start the NAPI context so that receiving will start */
> err = i40e_xsk_wakeup(vsi->netdev, qid, XDP_WAKEUP_RX);
> if (err)
> - return err;
> + goto unmap;
> }
>
> return 0;
> +
> +unmap:
> + xsk_pool_dma_unmap(pool, I40E_RX_DMA_ATTR);
Hi Haoxiang,
this will leave queues in a limbo state if you fail before qp enable.
It would be better to call i40e_xsk_pool_disable() which will do the dma
unmap internally.
> + return err;
> }
>
> /**
> --
> 2.25.1
>
>
prev parent reply other threads:[~2026-01-26 20:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-25 14:04 [PATCH] i40e: add an error handling path in i40e_xsk_pool_enable() Haoxiang Li
2026-01-26 16:51 ` [Intel-wired-lan] " Paul Menzel
2026-01-26 20:37 ` Maciej Fijalkowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aXfQjwrtvx+UdeB2@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=lihaoxiang@isrc.iscas.ac.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox