* [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2
@ 2020-03-18 12:52 Ferruh Yigit
2020-03-18 13:09 ` Ferruh Yigit
2020-03-18 13:48 ` Rahul Lakkireddy
0 siblings, 2 replies; 6+ messages in thread
From: Ferruh Yigit @ 2020-03-18 12:52 UTC (permalink / raw)
To: Rahul Lakkireddy, Karra Satwik
Cc: dev, Ferruh Yigit, Raslan Darawsheh, Xueming Zhang
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>
---
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2
2020-03-18 12:52 [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2 Ferruh Yigit
@ 2020-03-18 13:09 ` Ferruh Yigit
2020-03-19 7:31 ` Zhang, XuemingX
2020-03-18 13:48 ` Rahul Lakkireddy
1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2020-03-18 13:09 UTC (permalink / raw)
To: Raslan Darawsheh, Xueming Zhang; +Cc: Rahul Lakkireddy, Karra Satwik, dev
On 3/18/2020 12:52 PM, 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>
Hi Raslan, Xueming,
Can you please confirm the above patch on top of next-net fixes the build issue?
Thanks,
ferruh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2
2020-03-18 13:09 ` Ferruh Yigit
@ 2020-03-19 7:31 ` Zhang, XuemingX
0 siblings, 0 replies; 6+ messages in thread
From: Zhang, XuemingX @ 2020-03-19 7:31 UTC (permalink / raw)
To: Yigit, Ferruh, Raslan Darawsheh; +Cc: Rahul Lakkireddy, Karra Satwik, dev
Many thanks Ferruh.
In dpdk-next-net and dpdk-next-net-intel, the patch verified.
>-----Original Message-----
>From: Yigit, Ferruh
>Sent: Wednesday, March 18, 2020 9:10 PM
>To: Raslan Darawsheh <rasland@mellanox.com>; Zhang, XuemingX
><xuemingx.zhang@intel.com>
>Cc: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>; Karra Satwik
><kaara.satwik@chelsio.com>; dev@dpdk.org
>Subject: Re: [PATCH] net/cxgbe: fix build with clang 3.4.2
>
>On 3/18/2020 12:52 PM, 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>
>
>
>Hi Raslan, Xueming,
>
>Can you please confirm the above patch on top of next-net fixes the
>build issue?
>
>Thanks,
>ferruh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2
2020-03-18 12:52 [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2 Ferruh Yigit
2020-03-18 13:09 ` Ferruh Yigit
@ 2020-03-18 13:48 ` Rahul Lakkireddy
2020-03-18 14:46 ` Raslan Darawsheh
2020-03-18 14:48 ` Ferruh Yigit
1 sibling, 2 replies; 6+ messages in thread
From: Rahul Lakkireddy @ 2020-03-18 13:48 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Karra Satwik, dev, Raslan Darawsheh, Xueming Zhang
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.
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
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2
2020-03-18 13:48 ` Rahul Lakkireddy
@ 2020-03-18 14:46 ` Raslan Darawsheh
2020-03-18 14:48 ` Ferruh Yigit
1 sibling, 0 replies; 6+ messages in thread
From: Raslan Darawsheh @ 2020-03-18 14:46 UTC (permalink / raw)
To: Rahul Lakkireddy, Ferruh Yigit; +Cc: Karra Satwik, dev, Xueming Zhang
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
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2
2020-03-18 13:48 ` Rahul Lakkireddy
2020-03-18 14:46 ` Raslan Darawsheh
@ 2020-03-18 14:48 ` Ferruh Yigit
1 sibling, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2020-03-18 14:48 UTC (permalink / raw)
To: Rahul Lakkireddy; +Cc: Karra Satwik, dev, Raslan Darawsheh, Xueming Zhang
On 3/18/2020 1:48 PM, Rahul Lakkireddy wrote:
> 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.
>
> Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Squashed into relevant commit in next-net, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-03-19 7:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 12:52 [dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2 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
2020-03-18 14:48 ` Ferruh Yigit
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).