[dpdk-dev] [PATCH] net/cxgbe: fix build with clang 3.4.2

Zhang, XuemingX xuemingx.zhang at intel.com
Thu Mar 19 08:31:20 CET 2020


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 at mellanox.com>; Zhang, XuemingX
><xuemingx.zhang at intel.com>
>Cc: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>; Karra Satwik
><kaara.satwik at chelsio.com>; dev at 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 at mellanox.com>
>> Reported-by: Xueming Zhang <xuemingx.zhang at intel.com>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
>
>
>Hi Raslan, Xueming,
>
>Can you please confirm the above patch on top of next-net fixes the
>build issue?
>
>Thanks,
>ferruh


More information about the dev mailing list