DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	Keith Wiles <keith.wiles@intel.com>,
	Pascal Mazon <pascal.mazon@6wind.com>,
	Olga Shern <olgas@mellanox.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 4/4] net/tap: fix build with gcc11
Date: Tue, 11 May 2021 13:28:01 +0100	[thread overview]
Message-ID: <43204239-b4f5-44f4-db4e-c6d7d96b1fc2@redhat.com> (raw)
In-Reply-To: <20210510150319.1496105-4-ferruh.yigit@intel.com>

On 10/05/2021 16:03, Ferruh Yigit wrote:
> Reproduced with '--buildtype=debugoptimized' config,
> compiler version: gcc (GCC) 12.0.0 20210509 (experimental)
> 
> There are multiple build errors, like:
> In file included from ../drivers/net/tap/tap_flow.c:13:
> In function ‘rte_jhash_2hashes’,
>     inlined from ‘rte_jhash’ at ../lib/hash/rte_jhash.h:284:2,
>     inlined from ‘tap_flow_set_handle’ at
> 	../drivers/net/tap/tap_flow.c:1306:12,
>     inlined from ‘rss_enable’ at ../drivers/net/tap/tap_flow.c:1909:3,
>     inlined from ‘priv_flow_process’ at
> 	../drivers/net/tap/tap_flow.c:1228:11:
> ../lib/hash/rte_jhash.h:238:9:
> 	warning: ‘flow’ may be used uninitialized [-Wmaybe-uninitialized]
>   238 |         __rte_jhash_2hashes(key, length, pc, pb, 1);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/net/tap/tap_flow.c: In function ‘priv_flow_process’:
> ../lib/hash/rte_jhash.h:81:1: note: by argument 1 of type ‘const void *’
> 	to ‘__rte_jhash_2hashes.constprop’ declared here
>  81 | __rte_jhash_2hashes(const void *key, uint32_t length, uint32_t *pc,
>     | ^~~~~~~~~~~~~~~~~~~
> ../drivers/net/tap/tap_flow.c:1028:1: note: ‘flow’ declared here
>  1028 | priv_flow_process(struct pmd_internals *pmd,
>       | ^~~~~~~~~~~~~~~~~
> 
> Fix strict aliasing rule by using union.
> 

Bugzilla ID: 690

> Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Acked-by: Kevin Traynor <ktraynor@redhat.com>

> ---
> Cc: pascal.mazon@6wind.com
> ---
>  drivers/net/tap/tap_flow.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
> index 1ee6fb30ab2d..c4f60ce98e5e 100644
> --- a/drivers/net/tap/tap_flow.c
> +++ b/drivers/net/tap/tap_flow.c
> @@ -1300,10 +1300,16 @@ tap_flow_validate(struct rte_eth_dev *dev,
>  static void
>  tap_flow_set_handle(struct rte_flow *flow)
>  {
> +	union {
> +		struct rte_flow *flow;
> +		const void *key;
> +	} tmp;
>  	uint32_t handle = 0;
>  
> +	tmp.flow = flow;
> +
>  	if (sizeof(flow) > 4)
> -		handle = rte_jhash(&flow, sizeof(flow), 1);
> +		handle = rte_jhash(tmp.key, sizeof(flow), 1);
>  	else
>  		handle = (uintptr_t)flow;
>  	/* must be at least 1 to avoid letting the kernel choose one for us */
> 


  reply	other threads:[~2021-05-11 12:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 15:03 [dpdk-dev] [PATCH 1/4] net/bnx2x: " Ferruh Yigit
2021-05-10 15:03 ` [dpdk-dev] [PATCH 2/4] " Ferruh Yigit
2021-05-10 15:03 ` [dpdk-dev] [PATCH 3/4] net/ice/base: " Ferruh Yigit
2021-05-10 17:04   ` Wang, Haiyue
2021-05-10 17:13     ` Wang, Haiyue
2021-05-10 17:31       ` Ferruh Yigit
2021-05-10 17:55         ` Stillwell Jr, Paul M
2021-05-10 17:28     ` Ferruh Yigit
2021-05-11  1:59       ` Wang, Haiyue
2021-05-11  9:33         ` Ferruh Yigit
2021-05-11  9:08       ` Kevin Traynor
2021-05-10 15:03 ` [dpdk-dev] [PATCH 4/4] net/tap: " Ferruh Yigit
2021-05-11 12:28   ` Kevin Traynor [this message]
2021-05-11 11:44 ` [dpdk-dev] [PATCH v2 1/4] net/bnx2x: " Ferruh Yigit
2021-05-11 11:44   ` [dpdk-dev] [PATCH v2 2/4] " Ferruh Yigit
2021-05-11 12:27     ` Kevin Traynor
2021-05-11 11:44   ` [dpdk-dev] [PATCH v2 3/4] net/ice/base: " Ferruh Yigit
2021-05-11 11:44   ` [dpdk-dev] [PATCH v2 4/4] net/tap: " Ferruh Yigit
2021-05-11 12:26   ` [dpdk-dev] [PATCH v2 1/4] net/bnx2x: " Kevin Traynor
2021-05-11 13:14 ` [dpdk-dev] [PATCH v3 " Ferruh Yigit
2021-05-11 13:14   ` [dpdk-dev] [PATCH v3 2/4] " Ferruh Yigit
2021-05-11 13:14   ` [dpdk-dev] [PATCH v3 3/4] net/ice/base: " Ferruh Yigit
2021-05-12  7:43     ` [dpdk-dev] [dpdk-stable] " Wang, Haiyue
2021-05-11 13:14   ` [dpdk-dev] [PATCH v3 4/4] net/tap: " Ferruh Yigit
2021-05-12 13:04   ` [dpdk-dev] [PATCH v3 1/4] net/bnx2x: " 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=43204239-b4f5-44f4-db4e-c6d7d96b1fc2@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=keith.wiles@intel.com \
    --cc=olgas@mellanox.com \
    --cc=pascal.mazon@6wind.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).