[dpdk-dev] net/qede/base: fix freebsd compilation

Message ID 1485147758-21809-1-git-send-email-rasesh.mody@cavium.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
ci/Intel compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Mody, Rasesh Jan. 23, 2017, 5:02 a.m.
This patch addresses compilation errors on FreeBSD 11.0 clang 3.8.0.

Fixes: ec94dbc57362 ("qede: add base driver")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_init_fw_funcs.c |    2 +-
 drivers/net/qede/base/reg_addr.h            |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Andrew Rybchenko Jan. 23, 2017, 6:43 a.m. | #1
On 01/23/2017 08:02 AM, Rasesh Mody wrote:
> This patch addresses compilation errors on FreeBSD 11.0 clang 3.8.0.
>
> Fixes: ec94dbc57362 ("qede: add base driver")
>
> Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
> ---
>   drivers/net/qede/base/ecore_init_fw_funcs.c |    2 +-
>   drivers/net/qede/base/reg_addr.h            |    6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c b/drivers/net/qede/base/ecore_init_fw_funcs.c
> index a5437b5..77f9152 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 @@ enum CmInterfaceEnum {
>   #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 /* @DPDK */
>   #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 ab88671..3c369aa 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) /* @DPDK */
>   
>   #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) /* @DPDK */
>   #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) /* @DPDK */
>   #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)

FreeBSD build is OK for me with the patch applied.

Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Thomas Monjalon Jan. 23, 2017, 10:21 a.m. | #2
2017-01-22 21:02, Rasesh Mody:
> This patch addresses compilation errors on FreeBSD 11.0 clang 3.8.0.

Is it really specific to FreeBSD 11? I guess it is more about clang.
Ferruh Yigit Jan. 23, 2017, 1:25 p.m. | #3
On 1/23/2017 10:21 AM, Thomas Monjalon wrote:
> 2017-01-22 21:02, Rasesh Mody:
>> This patch addresses compilation errors on FreeBSD 11.0 clang 3.8.0.
> 
> Is it really specific to FreeBSD 11? I guess it is more about clang.
> 

Right, this seem clang 3.8.0 issue, independent from FreeBSD version.

I will remove FreeBSD version information while applying.
Ferruh Yigit Jan. 23, 2017, 1:30 p.m. | #4
On 1/23/2017 5:02 AM, Rasesh Mody wrote:
> This patch addresses compilation errors on FreeBSD 11.0 clang 3.8.0.
> 
> Fixes: ec94dbc57362 ("qede: add base driver")
> 
> Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>

Applied to dpdk-next-net/master, thanks.

(FreeBSD version information removed from commit)

Patch

diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c b/drivers/net/qede/base/ecore_init_fw_funcs.c
index a5437b5..77f9152 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 @@  enum CmInterfaceEnum {
 #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 /* @DPDK */
 #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 ab88671..3c369aa 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) /* @DPDK */
 
 #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) /* @DPDK */
 #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) /* @DPDK */
 #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)