DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0
@ 2017-01-17 14:59 Andrew Rybchenko
  2017-01-17 22:04 ` Thomas Monjalon
  2017-01-18  1:33 ` Mody, Rasesh
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2017-01-17 14:59 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, Harish Patil

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

Andrew.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0
  2017-01-17 14:59 [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0 Andrew Rybchenko
@ 2017-01-17 22:04 ` Thomas Monjalon
  2017-01-17 22:06   ` Thomas Monjalon
  2017-01-18  1:33 ` Mody, Rasesh
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2017-01-17 22:04 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: dev, Jianfeng Tan, yuanhan.liu

2017-01-17 17:59, Andrew Rybchenko:
> build is broken for me on FreeBSD 11.0. Just default config and gmake:

Thanks for reporting.
It is due to the pull of next-virtio tree.
It is broken also on Linux when virtio-user is disabled.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0
  2017-01-17 22:04 ` Thomas Monjalon
@ 2017-01-17 22:06   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2017-01-17 22:06 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: dev, Jianfeng Tan, yuanhan.liu

2017-01-17 23:04, Thomas Monjalon:
> 2017-01-17 17:59, Andrew Rybchenko:
> > build is broken for me on FreeBSD 11.0. Just default config and gmake:
> 
> Thanks for reporting.
> It is due to the pull of next-virtio tree.
> It is broken also on Linux when virtio-user is disabled.

Sorry, wrong thread

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0
  2017-01-17 14:59 [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0 Andrew Rybchenko
  2017-01-17 22:04 ` Thomas Monjalon
@ 2017-01-18  1:33 ` Mody, Rasesh
  2017-01-18 20:45   ` Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Mody, Rasesh @ 2017-01-18  1:33 UTC (permalink / raw)
  To: Andrew Rybchenko, dev; +Cc: Patil, Harish

> 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.

Thanks!
-Rasesh
 
> Andrew.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0
  2017-01-18  1:33 ` Mody, Rasesh
@ 2017-01-18 20:45   ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-01-18 20:45 UTC (permalink / raw)
  To: Mody, Rasesh, Andrew Rybchenko, dev; +Cc: Patil, Harish

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:


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)


> 
> Thanks!
> -Rasesh
>  
>> Andrew.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-18 20:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-17 14:59 [dpdk-dev] net/qede/base: build is broken on FreeBSD 11.0 with clang 3.8.0 Andrew Rybchenko
2017-01-17 22:04 ` Thomas Monjalon
2017-01-17 22:06   ` Thomas Monjalon
2017-01-18  1:33 ` Mody, Rasesh
2017-01-18 20:45   ` 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).