DPDK patches and discussions
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Karra Satwik <kaara.satwik@chelsio.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Xueming Zhang <xuemingx.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2
Date: Wed, 18 Mar 2020 14:46:21 +0000	[thread overview]
Message-ID: <AM0PR05MB6707CA11A9AB2B44EBEB78D2C2F70@AM0PR05MB6707.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20200318134805.GA25012@chelsio.com>

Hi,
> -----Original Message-----
> From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
> Sent: Wednesday, March 18, 2020 3:48 PM
> To: Ferruh Yigit <ferruh.yigit@intel.com>
> Cc: Karra Satwik <kaara.satwik@chelsio.com>; dev@dpdk.org; Raslan
> Darawsheh <rasland@mellanox.com>; Xueming Zhang
> <xuemingx.zhang@intel.com>
> Subject: Re: [PATCH] net/cxgbe: fix build with clang 3.4.2
> 
> 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 <rasland@mellanox.com>
> > Reported-by: Xueming Zhang <xuemingx.zhang@intel.com>
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> 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.
> 
Working just fine for me as well, thanks for the update
Tested-by:  Raslan Darawsheh <rasland@mellanox.com>

> Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
> 
> > ---
> > 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
> >

  reply	other threads:[~2020-03-18 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 12:52 Ferruh Yigit
2020-03-18 13:09 ` Ferruh Yigit
2020-03-19  7:31   ` Zhang, XuemingX
2020-03-18 13:48 ` Rahul Lakkireddy
2020-03-18 14:46   ` Raslan Darawsheh [this message]
2020-03-18 14:48   ` 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=AM0PR05MB6707CA11A9AB2B44EBEB78D2C2F70@AM0PR05MB6707.eurprd05.prod.outlook.com \
    --to=rasland@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=kaara.satwik@chelsio.com \
    --cc=rahul.lakkireddy@chelsio.com \
    --cc=xuemingx.zhang@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).