From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D61D4A0C3F for ; Tue, 11 May 2021 14:28:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ABE0A410E9; Tue, 11 May 2021 14:28:09 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 92DFD40140 for ; Tue, 11 May 2021 14:28:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620736086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/K5KGm6ZveJBPDHt28Xj7MVbpZ0nO69dwmSh4XT6yn0=; b=YTougmz49B/EthimQatzV7WTAEbZy83T2Ioqo9AdKxl4zDIHXTgQe4UMjeN2RK2ALzc1dQ SshP00cmj86qjJ4tu4oJEoSIOTZfqCZ+vDlMQa0F+W9SY1UwUaWn3yUpH4Yl8/7t/0nbpt FdW2fQWMheskCfWd0CNPsWdrhUiXS2k= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-184-aeim0orNOBiq65mrt_eFtA-1; Tue, 11 May 2021 08:28:04 -0400 X-MC-Unique: aeim0orNOBiq65mrt_eFtA-1 Received: by mail-wr1-f72.google.com with SMTP id p19-20020adfc3930000b029010e10128a04so8641796wrf.3 for ; Tue, 11 May 2021 05:28:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/K5KGm6ZveJBPDHt28Xj7MVbpZ0nO69dwmSh4XT6yn0=; b=XknMCF9UBpAk5ED+CAVbx7Tejw6uWEhkYJN2n2sEGmW3AafQn2xlDY8iTlXVj0EMVM qb+QzHALcJQvQ1w4PSF6APWhbnPEpW3qrDCsGXKTT9eNb1qjNv21eK40mGLkJy5WPwIe D0EHZ0KuKQ8uiQ6NsW44e7K1p6MXWpZgr5jf5xjuDviun73HpdLbA3yRom7PSsyVAO/I mlpZaeXW++Z7cSSbXLOQ/NaB7BuC7CA6802k6mEDXVN2xshEb0Pw+hACdXp+8g1fZjbY KNDG/YPwjzgYWTFA+SC1FSMXef2whFHe0zCKueH7zvk4ZmKfq8AIEONK3+g3hfEsLyY2 9dUA== X-Gm-Message-State: AOAM530/+U9riemhCSQSTFmLrlY7zCNI3EBDZQgY43fNy8c9Byu+L43D nt9y4Va0VZIJdgHkLK/IZ3TkavqYiJJQaGItOsAUrGD4gLdyfEF3A/0xeopxpGFsBFSlpigdjql /t4f+6vX/wsoqGVK+VO5909uPJ9tLSdTFYs1uJ+JVdxNMcR53niN3Xt6LFrM= X-Received: by 2002:a5d:6551:: with SMTP id z17mr36773221wrv.372.1620736083320; Tue, 11 May 2021 05:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+a7XoxaU2WE3+XSHq2fI9lK+ff+A3mCK0RIgBuOJGHzmviyJ3SU7/XBNv+h2p4hz17i8iBQ== X-Received: by 2002:a5d:6551:: with SMTP id z17mr36773199wrv.372.1620736083104; Tue, 11 May 2021 05:28:03 -0700 (PDT) Received: from [192.168.0.36] ([78.18.27.43]) by smtp.gmail.com with ESMTPSA id v1sm8358084wru.73.2021.05.11.05.28.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 May 2021 05:28:02 -0700 (PDT) To: Ferruh Yigit , Keith Wiles , Pascal Mazon , Olga Shern Cc: dev@dpdk.org, stable@dpdk.org References: <20210510150319.1496105-1-ferruh.yigit@intel.com> <20210510150319.1496105-4-ferruh.yigit@intel.com> From: Kevin Traynor Message-ID: <43204239-b4f5-44f4-db4e-c6d7d96b1fc2@redhat.com> Date: Tue, 11 May 2021 13:28:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210510150319.1496105-4-ferruh.yigit@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 4/4] net/tap: fix build with gcc11 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 Acked-by: Kevin Traynor > --- > 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 */ >