patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Ciara Loftus <ciara.loftus@intel.com>
Cc: stable@dpdk.org
Subject: Re: [PATCH 19.11] net/af_xdp: ensure socket is deleted on Rx queue setup error
Date: Thu, 10 Mar 2022 11:42:06 +0100	[thread overview]
Message-ID: <CAATJJ0LcLPzJ8ny0gCXYYGrGdPNyrq7tbMu5gfyWLqoZuT7ADQ@mail.gmail.com> (raw)
In-Reply-To: <20220310100712.19709-1-ciara.loftus@intel.com>

On Thu, Mar 10, 2022 at 11:07 AM Ciara Loftus <ciara.loftus@intel.com> wrote:
>
> [ upstream commit b26431a617e4039e6c0f65c5ee56f62f347b686b ]
>
> During Rx queue setup the PMD attempts to allocate mbufs for the fill
> queue after the socket is created. If this allocation fails, the socket
> should be deleted before returning an error to the user. Fix this.
>
> Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
>
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>

Thank you Ciara, applied

> ---
>  drivers/net/af_xdp/rte_eth_af_xdp.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 9eae705caa..9b36d80335 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -898,26 +898,27 @@ xsk_configure(struct pmd_internals *internals, struct pkt_rx_queue *rxq,
>                         &txq->tx, &cfg);
>         if (ret) {
>                 AF_XDP_LOG(ERR, "Failed to create xsk socket.\n");
> -               goto err;
> +               goto out_umem;
>         }
>
>  #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)
>         ret = rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size);
>         if (ret) {
>                 AF_XDP_LOG(DEBUG, "Failed to get enough buffers for fq.\n");
> -               goto err;
> +               goto out_xsk;
>         }
>  #endif
>         ret = reserve_fill_queue(rxq->umem, reserve_size, fq_bufs);
>         if (ret) {
> -               xsk_socket__delete(rxq->xsk);
>                 AF_XDP_LOG(ERR, "Failed to reserve fill queue.\n");
> -               goto err;
> +               goto out_xsk;
>         }
>
>         return 0;
>
> -err:
> +out_xsk:
> +       xsk_socket__delete(rxq->xsk);
> +out_umem:
>         xdp_umem_destroy(rxq->umem);
>
>         return ret;
> --
> 2.17.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

      reply	other threads:[~2022-03-10 10:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 10:07 Ciara Loftus
2022-03-10 10:42 ` Christian Ehrhardt [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=CAATJJ0LcLPzJ8ny0gCXYYGrGdPNyrq7tbMu5gfyWLqoZuT7ADQ@mail.gmail.com \
    --to=christian.ehrhardt@canonical.com \
    --cc=ciara.loftus@intel.com \
    --cc=stable@dpdk.org \
    /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;
as well as URLs for NNTP newsgroup(s).