net/bnx2x: fix meson build failure
Checks
Commit Message
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
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
@@ -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 */