From: Ori Kam <orika@mellanox.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
Wenzhuo Lu <wenzhuo.lu@intel.com>,
Jingjing Wu <jingjing.wu@intel.com>,
Bernard Iremonger <bernard.iremonger@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Slava Ovsiienko <viacheslavo@mellanox.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix uninitialized members of mpls
Date: Sun, 2 Feb 2020 08:23:53 +0000 [thread overview]
Message-ID: <AM6PR05MB5176DAFAAD2D432388754C5ADB010@AM6PR05MB5176.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <b48f33ac-de13-5787-bdb1-41f463661d2c@intel.com>
Hi Ferruh,
PSB,
Thanks,
Ori
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Friday, January 31, 2020 1:08 PM
> To: Ori Kam <orika@mellanox.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
> Jingjing Wu <jingjing.wu@intel.com>; Bernard Iremonger
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; Slava Ovsiienko <viacheslavo@mellanox.com>;
> stable@dpdk.org
> Subject: Re: [PATCH] app/testpmd: fix uninitialized members of mpls
>
> On 1/30/2020 4:59 PM, Ori Kam wrote:
> > Some of the memebers of the mpls struct are not initialized.
> > this commit init the uninitialized members.
> >
> > Coverity issue: 325735
> > Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ori Kam <orika@mellanox.com>
> > ---
> > app/test-pmd/cmdline_flow.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index e99e24c..c2cc4c5 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -4576,7 +4576,9 @@ static int comp_set_raw_index(struct context *,
> const struct token *,
> > struct rte_flow_item_gre gre = {
> > .protocol = rte_cpu_to_be_16(ETHER_TYPE_MPLS_UNICAST),
> > };
> > - struct rte_flow_item_mpls mpls;
> > + struct rte_flow_item_mpls mpls = {
> > + .ttl = 0,
> > + };
>
> why not use "= {0};", the end result will be same, struct will be all zeroed out
> in both case, "= {0};" makes the intention more obvious I think.
>
On some compilers this kind of initialization result in an error:
error: missing braces around initializer
it looks like a known issue of GCC
So I just prefer to init the relevant fields.
> > uint8_t *header;
> > int ret;
> >
> >
next prev parent reply other threads:[~2020-02-02 8:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-30 16:59 Ori Kam
2020-01-31 11:07 ` Ferruh Yigit
2020-02-02 8:23 ` Ori Kam [this message]
2020-02-03 10:21 ` Ferruh Yigit
2020-02-03 17:46 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2020-02-04 7:50 ` Ori Kam
2020-02-04 11:49 ` [dpdk-dev] " Ferruh Yigit
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=AM6PR05MB5176DAFAAD2D432388754C5ADB010@AM6PR05MB5176.eurprd05.prod.outlook.com \
--to=orika@mellanox.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
--cc=viacheslavo@mellanox.com \
--cc=wenzhuo.lu@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;
as well as URLs for NNTP newsgroup(s).