net/bnx2x: fix meson build failure

Message ID 20191101060228.23271-1-rmody@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series net/bnx2x: fix meson build failure |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/checkpatch warning coding style issues

Commit Message

Rasesh Mody Nov. 1, 2019, 6:02 a.m. UTC
  Use kernel headers for __le* types to avoid potential conflicts
resulting in redefinition errors during Linux builds. Add check
for BSD builds.

Fixes: 38dff79ba736 ("net/bnx2x: update HSI")

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Tested-by: Gavin Hu <gavin.hu@arm.com>
---
 drivers/net/bnx2x/bnx2x_osal.h | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Thomas Monjalon Nov. 5, 2019, 6:14 p.m. UTC | #1
01/11/2019 07:02, Rasesh Mody:
> Use kernel headers for __le* types to avoid potential conflicts
> resulting in redefinition errors during Linux builds. Add check
> for BSD builds.

I don't see the error with my test builds.
Please could you describe a case where it happens?
And please provide an error log.

> Fixes: 38dff79ba736 ("net/bnx2x: update HSI")
> 
> Signed-off-by: Rasesh Mody <rmody@marvell.com>
> Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Tested-by: Gavin Hu <gavin.hu@arm.com>
> ---
> +#ifdef __FreeBSD__

Please prefer RTE_EXEC_ENV_FREEBSD
  

Patch

diff --git a/drivers/net/bnx2x/bnx2x_osal.h b/drivers/net/bnx2x/bnx2x_osal.h
index 7cd293259..72e4b6d6b 100644
--- a/drivers/net/bnx2x/bnx2x_osal.h
+++ b/drivers/net/bnx2x/bnx2x_osal.h
@@ -8,7 +8,11 @@ 
 #ifndef BNX2X_OSAL_H
 #define BNX2X_OSAL_H
 
+#ifdef __FreeBSD__
 #include <sys/stat.h>
+#else
+#include <linux/types.h>
+#endif
 
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
 #ifndef __LITTLE_ENDIAN
@@ -22,8 +26,10 @@ 
 #undef __LITTLE_ENDIAN
 #endif
 
+#ifdef __FreeBSD__
 #define __le16		uint16_t
 #define __le32		uint32_t
 #define __le64		uint64_t
+#endif
 
 #endif /* BNX2X_OSAL_H */