net/ixgbe: fix issue for change definitions of bool
PATCH 1/1 net/ixgbe: fix issue for change definitions of bool
We had better not to change code in base folder, that patch will introduce a bug for etag/etag_strip for x550 NIC. So change back to the aboriginal definition.
--- drivers/net/ixgbe/base/ixgbe_osdep.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ixgbe/base/ixgbe_osdep.h +4 -1
@@ -9,7 +9,6 @@#include <stdint.h> #include <stdio.h> #include <stdarg.h> -#include <stdbool.h> #include <rte_common.h> #include <rte_debug.h> #include <rte_cycles.h>
@@ -84,6 +83,10 @@ typedef uint32_t u32;typedef int32_t s32 ;typedef uint64_t u64 ; +#ifndef __cplusplus +typedef int bool ; +#endif +#define mb () rte_mb()#define wmb () rte_wmb()#define rmb () rte_rmb()
Signature · 1 line
2.17.1
Hi, Wei
Quoted 2 lines · Wei Zhao
We had better not to change code in base folder, that patch will introduce a bug for etag/etag_strip for x550 NIC. So change back
Could you elaborate the details of this bug?
Thanks,
Xiaolong
Quoted 36 lines
to the aboriginal definition.
Fixes ad43b7bce95b ("net/ixgbe: avoid multiple definitions of bool")Signed-off-by Wei Zhao <[email protected]>---
drivers/net/ixgbe/base/ixgbe_osdep.h| 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ixgbe/base/ixgbe_osdep.h +4
-1@@ -9,7 +9,6 @@#include <stdint.h> #include <stdio.h> #include <stdarg.h> -#include <stdbool.h> #include <rte_common.h> #include <rte_debug.h> #include <rte_cycles.h> @@ -84,6 +83,10 @@ typedef uint32_t u32;typedef int32_t s32 ;typedef uint64_t u64 ; +#ifndef __cplusplus +typedef int bool ; +#endif +#define mb () rte_mb()#define wmb () rte_wmb()#define rmb () rte_rmb()Signature · 1 line
2.17.1
Hi,
Quoted 6 lines · Wei Zhao
We had better not to change code in base folder, that patch will introduce a bug for etag/etag_strip for x550 NIC. So change back to the aboriginal definition.
Fixes ad43b7bce95b ("net/ixgbe: avoid multiple definitions of bool")
I think this patch makes sense to remove local bool type to avoid possible multiple definitions of 'bool', could you try to investigate the root cause of the bug that this patch revealed?
Thanks,
Xiaolong
Quoted 32 lines
Signed-off-by Wei Zhao <[email protected]>---
drivers/net/ixgbe/base/ixgbe_osdep.h| 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ixgbe/base/ixgbe_osdep.h +4
-1@@ -9,7 +9,6 @@#include <stdint.h> #include <stdio.h> #include <stdarg.h> -#include <stdbool.h> #include <rte_common.h> #include <rte_debug.h> #include <rte_cycles.h> @@ -84,6 +83,10 @@ typedef uint32_t u32;typedef int32_t s32 ;typedef uint64_t u64 ; +#ifndef __cplusplus +typedef int bool ; +#endif +#define mb () rte_mb()#define wmb () rte_wmb()#define rmb () rte_rmb()Signature · 1 line
2.17.1
Ok,more info will be update to this patch
Quoted 57 lines
-----Original Message-----
From: Ye, Xiaolong <[email protected]>
Sent: Thursday, February 27, 2020 11:09 AM
To: Zhao1, Wei <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] net/ixgbe: fix issue for change definitions of boolHi,
Quoted 6 lines · Wei Zhao
We had better not to change code in base folder, that patch will introduce a bug for etag/etag_strip for x550 NIC. So change back to the aboriginal definition.
Fixes ad43b7bce95b ("net/ixgbe: avoid multiple definitions of bool")I think this patch makes sense to remove local bool type to avoid possible multiple definitions of 'bool', could you try to investigate the root cause of the bug that this patch revealed?
Thanks,
XiaolongQuoted 33 lines
Signed-off-by Wei Zhao <[email protected]>---
drivers/net/ixgbe/base/ixgbe_osdep.h| 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ixgbe/base/ixgbe_osdep.h +4
-2@@ -9,7 +9,6 @@#include <stdint.h> #include <stdio.h> #include <stdarg.h> -#include <stdbool.h> #include <rte_common.h> #include <rte_debug.h> #include <rte_cycles.h> @@ -84,6 +83,10 @@ typedef uint32_t u32;typedef int32_t s32 ;typedef uint64_t u64 ; +#ifndef __cplusplus +typedef int bool ; +#endif +#define mb () rte_mb()#define wmb () rte_wmb()#define rmb () rte_rmb() --2.17.1
PATCH v2 1/1 net/ixgbe: fix issue for e-tag defination
In reply to Wei ZhaoAn issue has been caused after change definations of bool, we had better use uint16_t to define e-tag ethertype, not 8 bits length bool, that patch will change bool bits length, which introduce a bug for etag/etag_strip for x550 NIC. So change to the 16 bits defination.
v2:
-add more info and find root cause for this issue
--- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.h +1 -1
@@ -358,7 +358,7 @@ struct ixgbe_l2_tn_info {struct rte_hash *hash_handle;bool e_tag_en;/* e-tag enabled */ bool e_tag_fwd_en;/* e-tag based forwarding enabled */ -bool e_tag_ether_type;/* ether type for e-tag */ +uint16_t e_tag_ether_type;/* ether type for e-tag */ };struct rte_flow {
Signature · 1 line
2.19.1
Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix issue for e-tag defination
Hi, Wei
Thanks for identifying the root cause.
Quoted 33 lines · Wei Zhao
An issue has been caused after change definations of bool, we had better use
uint16_tto define e-tag ethertype, not 8 bits length bool, that patch will change bool bits length, which introduce a bug for etag/etag_strip for x550 NIC. So change to the 16 bits defination.Fixes ad43b7bce95b ("net/ixgbe: avoid multiple definitions of bool")Signed-off-by Wei Zhao <[email protected]>v2:
-add more info and find root cause for this issue
---drivers/net/ixgbe/ixgbe_ethdev.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ixgbe/ixgbe_ethdev.h +1
-1@@ -358,7 +358,7 @@ struct ixgbe_l2_tn_info {struct rte_hash *hash_handle;bool e_tag_en;/* e-tag enabled */ bool e_tag_fwd_en;/* e-tag based forwarding enabled */ -bool e_tag_ether_type;/* ether type for e-tag */ +uint16_t e_tag_ether_type;/* ether type for e-tag */ };struct rte_flow {Signature · 1 line
2.19.1
Applied to dpdk-next-net-intel, Thanks.