DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ivan Malov <ivan.malov@oktetlabs.ru>
Cc: Olivier Matz <olivier.matz@6wind.com>,
	dev@dpdk.org, "Ananyev,
	Konstantin" <konstantin.ananyev@intel.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Tomasz Kulasek <tomaszx.kulasek@intel.com>,
	stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3] net: fix the way how L4 checksum choice is tested
Date: Thu, 27 Jun 2019 21:26:18 -0700	[thread overview]
Message-ID: <20190627212618.4fb293eb@hermes.lan> (raw)
In-Reply-To: <20190628031309.24215-1-ivan.malov@oktetlabs.ru>

On Fri, 28 Jun 2019 06:13:09 +0300
Ivan Malov <ivan.malov@oktetlabs.ru> wrote:

> The API to prepare checksum offloads mistreats L4
> checksum type enum values as self-contained flags.
> 
> Turning these flag checks into enum checks causes
> warnings by GCC about possibly uninitialised IPv4
> header pointer. The issue was found to show up in
> the case of GCC versions 4.8.5 and 5.4.0, however,
> it might be the case for a wider variety of other
> versions. Initialise the pointer upon declaration.
> and explain the reason behind this in the comment.
> 
> Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
> Cc: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  lib/librte_net/rte_net.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
> index 7be69f8..d240206 100644
> --- a/lib/librte_net/rte_net.h
> +++ b/lib/librte_net/rte_net.h
> @@ -112,7 +112,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
>  static inline int
>  rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>  {
> -	struct rte_ipv4_hdr *ipv4_hdr;
> +	/* Initialise ipv4_hdr to avoid false positive compiler warnings. */
> +	struct rte_ipv4_hdr *ipv4_hdr = NULL;
>  	struct rte_ipv6_hdr *ipv6_hdr;

Looks good, a smart compiler will just drop it.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

  reply	other threads:[~2019-06-28  4:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 17:33 [dpdk-dev] [PATCH] " Ivan Malov
2019-06-24 11:52 ` Ananyev, Konstantin
2019-06-24 12:01 ` Ananyev, Konstantin
2019-06-24 12:16   ` Andrew Rybchenko
2019-06-27 13:26     ` Ananyev, Konstantin
2019-06-27 21:52 ` [dpdk-dev] [PATCH v2] " Ivan Malov
2019-06-28  0:10   ` Stephen Hemminger
2019-06-28  3:13 ` [dpdk-dev] [PATCH v3] " Ivan Malov
2019-06-28  4:26   ` Stephen Hemminger [this message]
2019-06-28 10:47   ` Ananyev, Konstantin
2019-06-28 16:24     ` 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=20190627212618.4fb293eb@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ivan.malov@oktetlabs.ru \
    --cc=konstantin.ananyev@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=stable@dpdk.org \
    --cc=tomaszx.kulasek@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).