From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83861A057B; Wed, 18 Mar 2020 14:58:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 955DC1AFF; Wed, 18 Mar 2020 14:58:48 +0100 (CET) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 9675CE07 for ; Wed, 18 Mar 2020 14:58:47 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id 02IDwjTS011259; Wed, 18 Mar 2020 06:58:45 -0700 Date: Wed, 18 Mar 2020 19:18:06 +0530 From: Rahul Lakkireddy To: Ferruh Yigit Cc: Karra Satwik , dev@dpdk.org, Raslan Darawsheh , Xueming Zhang Message-ID: <20200318134805.GA25012@chelsio.com> References: <20200318125236.652514-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200318125236.652514-1-ferruh.yigit@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Wednesday, March 03/18/20, 2020 at 12:52:36 +0000, Ferruh Yigit wrote: > Build error: > .../drivers/net/cxgbe/cxgbe_flow.c:315:2: > error: implicit truncation from 'int' to bitfield changes value > from -1 to 7 [-Werror,-Wbitfield-constant-conversion] > CXGBE_FILL_FS(adap->pf, ~0, pf); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > .../drivers/net/cxgbe/cxgbe_flow.c:25:2: > note: expanded from macro 'CXGBE_FILL_FS' > __CXGBE_FILL_FS(v, m, fs, elem, e) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > .../drivers/net/cxgbe/cxgbe_flow.c:15:18: note: > expanded from macro '__CXGBE_FILL_FS' > (fs)->mask.elem = (__m); \ > ^ ~~~~~ > Commit in fixes line changes 'PF_BITWIDTH' to '3', which makes 'fs->pf' > bitfield size '3', changing '~0' to '0x7' to prevent truncation in > assignment. > > Fixes: dcd456abe46f ("net/cxgbe: support flow API for matching all packets on PF") > > Reported-by: Raslan Darawsheh > Reported-by: Xueming Zhang > Signed-off-by: Ferruh Yigit I've tested CLANG compilation with 9.0.1 without this patch, but couldn't hit the above mentioned error. # clang --version clang version 9.0.1 (Fedora 9.0.1-2.fc31) However, after grabbing CLANG 3.4.2, I could see the error. # clang --version clang version 3.4.2 (tags/RELEASE_34/dot2-final) This patch fixes it and the fix is correct too. Thanks for fixing it. Acked-by: Rahul Lakkireddy > --- > Cc: kaara.satwik@chelsio.com > --- > drivers/net/cxgbe/cxgbe_flow.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c > index 13fd78aaf..a46515d3b 100644 > --- a/drivers/net/cxgbe/cxgbe_flow.c > +++ b/drivers/net/cxgbe/cxgbe_flow.c > @@ -312,7 +312,7 @@ ch_rte_parsetype_pf(const void *dmask __rte_unused, > > CXGBE_FILL_FS(1, 1, pfvf_vld); > > - CXGBE_FILL_FS(adap->pf, ~0, pf); > + CXGBE_FILL_FS(adap->pf, 0x7, pf); > return 0; > } > > -- > 2.25.1 >