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 8749DA0A0E; Tue, 11 May 2021 14:28:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B09140140; Tue, 11 May 2021 14:28:08 +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 8FCE44003E 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-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-nwS1jv3EPy6MRdJDREtiiA-1; Tue, 11 May 2021 08:28:04 -0400 X-MC-Unique: nwS1jv3EPy6MRdJDREtiiA-1 Received: by mail-wr1-f70.google.com with SMTP id s7-20020adfc5470000b0290106eef17cbdso8663100wrf.11 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=aDx/zzQ+cEAQJz9HSbPk3vC3GqBAzkEt2MwviMMvIgkD+qZ4XsizQPIJXksUvjhiu6 pKhKqPYefh8Qc8dSrWD0Kr9RuhVMfu6tF88pIoIDOO+WbqYIAndwR4oM6WJRWYdbCG91 8G0o5vkKa+7yCB57jicF9d0iSQjBIuD1o5MX7wbD86Fv/kW7YKuYdntPz7ernZilL0oP JD0TEIEsBfKiqYTW3irWdiHotOiuWbMBE4FnigN0NwYwprFRmjL9fEoGmFuYF/KkAShO nqM+3qj5Jrr51JwvwglCGKASiLC/WhC4dmDGv4gulMw4jUROkg690uDs5LoyyxCXa0Fn 4Qkw== X-Gm-Message-State: AOAM5301NwjESalvHEwhmradG2Oea+Y3VKG+hqouTXEI4ppUcUud0LU2 ld+3oosu2qS9hmVYZyZ1jeygNbLuepELmYWOjrXvsaeAXRYAyQfQwuOuaF/bhfxTMACvLBhFXdX w/7k= X-Received: by 2002:a5d:6551:: with SMTP id z17mr36773210wrv.372.1620736083225; 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-dev] [PATCH 4/4] net/tap: fix build with gcc11 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 */ >