patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: Luca Boccassi <bluca@debian.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
	oss-drivers <oss-drivers@corigine.com>
Subject: RE: [PATCH 22.11 2/7] net/nfp: fix resource leak for flower firmware
Date: Thu, 7 Mar 2024 11:00:43 +0000	[thread overview]
Message-ID: <SJ0PR13MB5545A90CF67ED6CB3ACD0A2F9E202@SJ0PR13MB5545.namprd13.prod.outlook.com> (raw)
In-Reply-To: <CAMw=ZnQyqv30xsL=dWz_LGDMVvmA_pGJGzEOyqonVyFzm8JJ0A@mail.gmail.com>

> [Some people who received this message don't often get email from
> bluca@debian.org. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ]
> 
> On Thu, 7 Mar 2024 at 06:05, Chaoyong He <chaoyong.he@corigine.com>
> wrote:
> >
> > [ upstream commit 7c596721ae5f41d1dbab8b936a4983928d6b5603 ]
> >
> > Fix the resource leak problem in the logic of flower firmware
> > application.
> >
> > Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework")
> >
> > Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> > ---
> >  .../net/nfp/flower/nfp_flower_representor.c   | 89 ++++++++++++++++++-
> >  .../net/nfp/flower/nfp_flower_representor.h   |  1 +
> >  2 files changed, 86 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c
> > b/drivers/net/nfp/flower/nfp_flower_representor.c
> > index 32c4574..854d117 100644
> > --- a/drivers/net/nfp/flower/nfp_flower_representor.c
> > +++ b/drivers/net/nfp/flower/nfp_flower_representor.c
> > ...
> > +static void
> > +nfp_flower_repr_free_all(struct nfp_app_fw_flower *app_fw_flower) {
> > +       uint32_t i;
> > +       struct nfp_flower_representor *repr;
> > +
> > +       for (i = 0; i < MAX_FLOWER_VFS; i++) {
> > +               repr = app_fw_flower->vf_reprs[i];
> > +               if (repr != NULL) {
> > +                       nfp_flower_repr_free(repr, NFP_REPR_TYPE_VF);
> > +                       app_fw_flower->vf_reprs[i] = NULL;
> > +               }
> > +       }
> > +
> > +       for (i = 0; i < NFP_MAX_PHYPORTS; i++) {
> > +               repr = app_fw_flower->phy_reprs[i];
> > +               if (repr != NULL) {
> > +                       nfp_flower_repr_free(repr, NFP_REPR_TYPE_PHYS_PORT);
> > +                       app_fw_flower->phy_reprs[i] = NULL;
> > +               }
> > +       }
> 
> Thanks for sending the series, but this causes a compiler warning on Debian
> stable with gcc 12.2.0:
> 
> [8/34] Compiling C object
> drivers/libtmp_rte_net_nfp.a.p/net_nfp_flower_nfp_flower_representor.c.o
> ../drivers/net/nfp/flower/nfp_flower_representor.c: In function
> ‘nfp_flower_repr_free_all’:
> ../drivers/net/nfp/flower/nfp_flower_representor.c:876:22: warning:
> iteration 8 invokes undefined behavior
> [-Waggressive-loop-optimizations]
>   876 |                 repr = app_fw_flower->phy_reprs[i];
>       |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/net/nfp/flower/nfp_flower_representor.c:875:23: note:
> within this loop

Oh, sorry for this.
In line 875, the 'NFP_MAX_PHYPORTS' should be 'MAX_FLOWER_PHYPORTS' actually.

  reply	other threads:[~2024-03-07 11:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  5:56 [PATCH 22.11 0/7] backport patch series from NFP PMD Chaoyong He
2024-03-07  5:56 ` [PATCH 22.11 1/7] net/nfp: fix resource leak for CoreNIC firmware Chaoyong He
2024-03-07  5:56 ` [PATCH 22.11 2/7] net/nfp: fix resource leak for flower firmware Chaoyong He
2024-03-07  9:35   ` Luca Boccassi
2024-03-07 11:00     ` Chaoyong He [this message]
2024-03-07 11:03       ` Chaoyong He
2024-03-07  5:56 ` [PATCH 22.11 3/7] net/nfp: fix resource leak for exit of CoreNIC firmware Chaoyong He
2024-03-07  5:56 ` [PATCH 22.11 4/7] net/nfp: fix resource leak for exit of flower firmware Chaoyong He
2024-03-07  5:56 ` [PATCH 22.11 5/7] net/nfp: fix device close Chaoyong He
2024-03-07  5:56 ` [PATCH 22.11 6/7] net/nfp: fix device resource freeing Chaoyong He
2024-03-07  5:56 ` [PATCH 22.11 7/7] net/nfp: free switch domain ID on close Chaoyong He

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=SJ0PR13MB5545A90CF67ED6CB3ACD0A2F9E202@SJ0PR13MB5545.namprd13.prod.outlook.com \
    --to=chaoyong.he@corigine.com \
    --cc=bluca@debian.org \
    --cc=oss-drivers@corigine.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).