DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: mlx5:  unitialized warning
Date: Fri, 17 Dec 2021 11:19:34 -0800	[thread overview]
Message-ID: <20211217111934.348ec6a3@hermes.local> (raw)
In-Reply-To: <MN2PR12MB3087F008F6AA42139934EE4FB9789@MN2PR12MB3087.namprd12.prod.outlook.com>

On Fri, 17 Dec 2021 19:01:31 +0000
Dmitry Kozlyuk <dkozlyuk@nvidia.com> wrote:

> > Building current main branch with gcc (Debian 10.2.1-6) 10.2.1 20210110
> > 
> > 
> > [1843/3131] Compiling C object
> > drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_flow_meter.c.o
> > ../drivers/net/mlx5/mlx5_flow_meter.c: In function
> > ‘mlx5_flow_meter_create’:
> > ../drivers/net/mlx5/mlx5_flow_meter.c:1170:33: warning: ‘legacy_fm’ may be
> > used uninitialized in this function [-Wmaybe-uninitialized]
> >  1170 |  struct mlx5_legacy_flow_meter *legacy_fm;
> >       |                                 ^~~~~~~~~  
> 
> Hi Stephen,
> 
> I don't see this warning with gcc 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04).
> Firstly, I believe it's a false positive:
> legacy_fm is initialized and used only when priv->sh->meter_aso_en == false:
> 
> 1237	if (priv->sh->meter_aso_en) {
> 		...
> 1245	} else {
>     		legacy_fm = ...
> 		if (legacy_fm == NULL)
> 			return ...;
> 		...
> 	}
> 	...
> 1276	if (!priv->sh->meter_aso_en)
> 		TAILQ_INSERT_TAIL(fms, legacy_fm, next);
> 
> However, even if it's fixed in GCC between 10.2.1 and 10.3.0,
> I've seen it with x86_64-w64-mingw32-gcc (GCC) 9.3-win32 20200320
> while working on enabling drivers/*/mlx5 build with GCC,
> so a workaround will probably still be needed.

It maybe because I was testing with thread santizer enabled and compiler
was doing different optimizations.

  reply	other threads:[~2021-12-17 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 18:05 Stephen Hemminger
2021-12-17 19:01 ` Dmitry Kozlyuk
2021-12-17 19:19   ` Stephen Hemminger [this message]
2021-12-17 19:28     ` Dmitry Kozlyuk
2021-12-17 20:17       ` Stephen Hemminger

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=20211217111934.348ec6a3@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=dkozlyuk@nvidia.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;
as well as URLs for NNTP newsgroup(s).