diff mbox

[dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0

Message ID 20af9aa0-1ab3-dc8a-3758-eea48d7f001c@intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Checks

Context Check Description
ci/Intel compilation fail apply patch file failure

Commit Message

Ferruh Yigit Jan. 18, 2017, 8:45 p.m. UTC
On 1/18/2017 1:33 AM, Mody, Rasesh wrote:
>> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
>> Sent: Tuesday, January 17, 2017 7:00 AM
>>
>> Hi,
>>
>> build is broken for me on FreeBSD 11.0. Just default config and gmake:
>>
>> == Build drivers/net/qede
>>    CC base/ecore_dev.o
>>    CC base/ecore_hw.o
>>    CC base/ecore_cxt.o
>> /tmp/dpdk-next-net/drivers/net/qede/base/ecore_cxt.c:1257:2: error:
>>        shifting a negative signed value is undefined [-Werror,-Wshift-negative-
>> value]
>>          SET_FIELD(cdu_params, CDUC_NCIB, elems_per_page);
>>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /tmp//dpdk-next-net/drivers/net/qede/base/ecore.h:82:27: note:
>>        expanded from macro 'SET_FIELD'
>>          (value) &= ~(name##_MASK << name##_SHIFT);                      \
>>                       ~~~~~~~~~~~ ^
>> /tmp/dpdk-next-net/drivers/net/qede/base/ecore_cxt.c:1268:2: error:
>>        shifting a negative signed value is undefined [-Werror,-Wshift-negative-
>> value]
>>          SET_FIELD(cdu_params, CDUT_TYPE0_CXT_SIZE, (cxt_size >> 3));
>>
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ~
>> /tmp/dpdk-next-net/drivers/net/qede/base/ecore.h:82:27: note:
>>        expanded from macro 'SET_FIELD'
>>          (value) &= ~(name##_MASK << name##_SHIFT);                      \
>>                       ~~~~~~~~~~~ ^
>> /tmp/dpdk-next-net/drivers/net/qede/base/ecore_cxt.c:1280:2: error:
>>        shifting a negative signed value is undefined [-Werror,-Wshift-negative-
>> value]
>>          SET_FIELD(cdu_params, CDUT_TYPE1_CXT_SIZE, (cxt_size >> 3));
>>
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ~
>> /tmp/dpdk-next-net/drivers/net/qede/base/ecore.h:82:27: note:
>>        expanded from macro 'SET_FIELD'
>>          (value) &= ~(name##_MASK << name##_SHIFT);                      \
>>                       ~~~~~~~~~~~ ^
>> 3 errors generated.
>> gmake[5]: *** [/tmp/dpdk-next-net/mk/internal/rte.compile-pre.mk:140:
>> base/ecore_cxt.o] Error 1
>> gmake[4]: *** [/tmp/dpdk-next-net/mk/rte.subdir.mk:63: qede] Error 2
>> gmake[3]: *** [/tmp/dpdk-next-net/mk/rte.subdir.mk:63: net] Error 2
>> gmake[2]: *** [/tmp/dpdk-next-net/mk/rte.sdkbuild.mk:80: drivers] Error 2
>> gmake[1]: *** [/tmp/dpdk-next-net/mk/rte.sdkroot.mk:127: all] Error 2
>> gmake: *** [Makefile:12: all] Error 2
>>
>> $ clang --version
>> FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM
>> 3.8.0)
>> Target: x86_64-unknown-freebsd11.0
>> Thread model: posix
>> InstalledDir: /usr/bin
> 
> We didn’t see these errors reported in our internal testing.
> FreeBSD clang version 3.6.1 (tags/RELEASE_361/final 237755) 20150525
> Target: x86_64-unknown-freebsd11.0
> Thread model: posix
> 
> We'll update our FreeBSD clang compiler version to test against 3.8.0.

Confirmed the build error with clang 3.8 (clang 3.4 was compiling fine).

Something like following is fixing the build:




> 
> Thanks!
> -Rasesh
>  
>> Andrew.
diff mbox

Patch

diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c
b/drivers/net/qede/base/ecore_init_fw_funcs.c
index a5437b55c..71ff1548a 100644
--- a/drivers/net/qede/base/ecore_init_fw_funcs.c
+++ b/drivers/net/qede/base/ecore_init_fw_funcs.c
@@ -89,7 +89,7 @@  voq * (PBF_REG_YCMD_QS_NUM_LINES_VOQ1_RT_OFFSET \
 #define QM_STOP_CMD_STRUCT_SIZE                        2
 #define QM_STOP_CMD_PAUSE_MASK_OFFSET  0
 #define QM_STOP_CMD_PAUSE_MASK_SHIFT   0
-#define QM_STOP_CMD_PAUSE_MASK_MASK            -1
+#define QM_STOP_CMD_PAUSE_MASK_MASK            0xffffffff
 #define QM_STOP_CMD_GROUP_ID_OFFSET            1
 #define QM_STOP_CMD_GROUP_ID_SHIFT             16
 #define QM_STOP_CMD_GROUP_ID_MASK              15
diff --git a/drivers/net/qede/base/reg_addr.h
b/drivers/net/qede/base/reg_addr.h
index ab886716a..62b30f47b 100644
--- a/drivers/net/qede/base/reg_addr.h
+++ b/drivers/net/qede/base/reg_addr.h
@@ -30,7 +30,7 @@ 
        24

 #define  CDU_REG_CID_ADDR_PARAMS_NCIB                  ( \
-               0xff << 24)
+               0xffUL << 24)

 #define  XSDM_REG_OPERATION_GEN \
        0xf80408UL
@@ -436,11 +436,11 @@ 
 #define NIG_REG_LLH_FUNC_FILTER_VALUE 0x501a00UL
 #define XMAC_REG_CTRL_TX_EN (0x1 << 0)
 #define XMAC_REG_CTRL_RX_EN (0x1 << 1)
-#define CDU_REG_SEGMENT0_PARAMS_T0_TID_SIZE (0xff << 24)
+#define CDU_REG_SEGMENT0_PARAMS_T0_TID_SIZE (0xffUL << 24)
 #define CDU_REG_SEGMENT0_PARAMS_T0_TID_BLOCK_WASTE (0xff << 16)
 #define CDU_REG_SEGMENT0_PARAMS_T0_TID_BLOCK_WASTE_SHIFT 16
 #define CDU_REG_SEGMENT1_PARAMS_T1_TID_BLOCK_WASTE (0xff << 16)
-#define CDU_REG_SEGMENT1_PARAMS_T1_TID_SIZE (0xff << 24)
+#define CDU_REG_SEGMENT1_PARAMS_T1_TID_SIZE (0xffUL << 24)
 #define CDU_REG_SEGMENT1_PARAMS_T1_NUM_TIDS_IN_BLOCK (0xfff << 0)
 #define CDU_REG_SEGMENT1_PARAMS_T1_NUM_TIDS_IN_BLOCK_SHIFT 0
 #define CDU_REG_SEGMENT0_PARAMS_T0_NUM_TIDS_IN_BLOCK (0xfff << 0)