DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnx2x: fix meson build failure
@ 2019-11-01  6:02 Rasesh Mody
  2019-11-05 18:14 ` Thomas Monjalon
  2019-11-06  5:45 ` [dpdk-dev] [PATCH v2] " Rasesh Mody
  0 siblings, 2 replies; 5+ messages in thread
From: Rasesh Mody @ 2019-11-01  6:02 UTC (permalink / raw)
  To: dev, bruce.richardson, ferruh.yigit, jerinj
  Cc: Rasesh Mody, GR-Everest-DPDK-Dev

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(+)

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 */
-- 
2.18.0


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

* Re: [dpdk-dev] [PATCH] net/bnx2x: fix meson build failure
  2019-11-01  6:02 [dpdk-dev] [PATCH] net/bnx2x: fix meson build failure Rasesh Mody
@ 2019-11-05 18:14 ` Thomas Monjalon
  2019-11-06  5:45 ` [dpdk-dev] [PATCH v2] " Rasesh Mody
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2019-11-05 18:14 UTC (permalink / raw)
  To: Rasesh Mody
  Cc: dev, bruce.richardson, ferruh.yigit, jerinj, GR-Everest-DPDK-Dev

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



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

* [dpdk-dev] [PATCH v2] net/bnx2x: fix meson build failure
  2019-11-01  6:02 [dpdk-dev] [PATCH] net/bnx2x: fix meson build failure Rasesh Mody
  2019-11-05 18:14 ` Thomas Monjalon
@ 2019-11-06  5:45 ` Rasesh Mody
  2019-11-06 11:02   ` Thomas Monjalon
  1 sibling, 1 reply; 5+ messages in thread
From: Rasesh Mody @ 2019-11-06  5:45 UTC (permalink / raw)
  To: Thomas Monjalon, dev @ dpdk . org, Bruce Richardson,
	Ferruh Yigit, Jerin Jacob Kollanukkaran
  Cc: Rasesh Mody, GR-Everest-DPDK-Dev

Use kernel headers for __le* types to avoid potential conflicts
resulting in redefinition errors for Linux build environments.
Add check for FreeBSD execution environments.

Without this fix, aarch64 builds can fail with error [1] below.

[1]
In file included from ../drivers/net/bnx2x/bnx2x.h:22,
                 from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
../drivers/net/bnx2x/bnx2x_osal.h:27:17: error: conflicting types for
‘uint64_t’
 #define __le64  uint64_t
               ^~~~~~~~
In file included from /usr/include/stdint.h:37,
                 from
/usr/lib/gcc/aarch64-linux-gnu/8/include/stdint.h:9,
                 from
../lib/librte_eal/common/include/arch/arm/rte_byteorder.h:16,
                 from ../drivers/net/bnx2x/bnx2x.h:17,
                 from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
/usr/include/aarch64-linux-gnu/bits/stdint-uintn.h:27:20: note: previous
declaration of ‘uint64_t’ was here
 typedef __uint64_t uint64_t;
                    ^~~~~~~~

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

v2:
  Use RTE_EXEC_ENV_FREEBSD in place of __FreeBSD__

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.c      | 4 ++--
 drivers/net/bnx2x/bnx2x.h      | 4 ++--
 drivers/net/bnx2x/bnx2x_osal.h | 6 ++++++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index e1dfe602c..ed31335ac 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -9581,7 +9581,7 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc)
 		return -ENOMEM;
 	}
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_FREEBSD
 	pci_read(sc, PCI_STATUS, &status, 2);
 	if (!(status & PCI_STATUS_CAP_LIST)) {
 #else
@@ -9592,7 +9592,7 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc)
 		return -1;
 	}
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_FREEBSD
 	pci_read(sc, PCI_CAPABILITY_LIST, &pci_cap.next, 1);
 #else
 	pci_read(sc, PCIR_CAP_PTR, &pci_cap.next, 1);
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 43c60408a..3383c7675 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -30,7 +30,7 @@
 
 #include "elink.h"
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_FREEBSD
 #include <linux/pci_regs.h>
 
 #define PCIY_PMG                       PCI_CAP_ID_PM
@@ -60,7 +60,7 @@
 #define IFM_10G_TWINAX                 22 /* 10GBase Twinax copper */
 #define IFM_10G_T                      26 /* 10GBase-T - RJ45 */
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_FREEBSD
 #define PCIR_EXPRESS_DEVICE_STA        PCI_EXP_TYPE_RC_EC
 #define PCIM_EXP_STA_TRANSACTION_PND   PCI_EXP_DEVSTA_TRPND
 #define PCIR_EXPRESS_LINK_STA          PCI_EXP_LNKSTA
diff --git a/drivers/net/bnx2x/bnx2x_osal.h b/drivers/net/bnx2x/bnx2x_osal.h
index 7cd293259..c4818bb22 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 RTE_EXEC_ENV_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 RTE_EXEC_ENV_FREEBSD
 #define __le16		uint16_t
 #define __le32		uint32_t
 #define __le64		uint64_t
+#endif
 
 #endif /* BNX2X_OSAL_H */
-- 
2.18.0


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

* Re: [dpdk-dev] [PATCH v2] net/bnx2x: fix meson build failure
  2019-11-06  5:45 ` [dpdk-dev] [PATCH v2] " Rasesh Mody
@ 2019-11-06 11:02   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2019-11-06 11:02 UTC (permalink / raw)
  To: Rasesh Mody
  Cc: dev, Bruce Richardson, Ferruh Yigit, Jerin Jacob Kollanukkaran,
	GR-Everest-DPDK-Dev

06/11/2019 06:45, Rasesh Mody:
> Use kernel headers for __le* types to avoid potential conflicts
> resulting in redefinition errors for Linux build environments.

Errors happen only with "some" Linux environments.

> Add check for FreeBSD execution environments.
> 
> Without this fix, aarch64 builds can fail with error [1] below.
> 
> [1]
> In file included from ../drivers/net/bnx2x/bnx2x.h:22,
>                  from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
> ../drivers/net/bnx2x/bnx2x_osal.h:27:17: error: conflicting types for
> ‘uint64_t’
>  #define __le64  uint64_t
>                ^~~~~~~~
> In file included from /usr/include/stdint.h:37,
>                  from
> /usr/lib/gcc/aarch64-linux-gnu/8/include/stdint.h:9,
>                  from
> ../lib/librte_eal/common/include/arch/arm/rte_byteorder.h:16,
>                  from ../drivers/net/bnx2x/bnx2x.h:17,
>                  from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
> /usr/include/aarch64-linux-gnu/bits/stdint-uintn.h:27:20: note: previous
> declaration of ‘uint64_t’ was here
>  typedef __uint64_t uint64_t;
>                     ^~~~~~~~
> 
> Fixes: 38dff79ba736 ("net/bnx2x: update HSI")
> 
> v2:
>   Use RTE_EXEC_ENV_FREEBSD in place of __FreeBSD__

It's a bit strange to change the existing __FreeBSD__ in this patch.
I'll add a note to mention this change in the commit.

> Signed-off-by: Rasesh Mody <rmody@marvell.com>
> Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Tested-by: Gavin Hu <gavin.hu@arm.com>

Applied, thanks



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

* Re: [dpdk-dev] [PATCH] net/bnx2x: fix meson build failure
@ 2019-11-05 20:34 Rasesh Mody
  0 siblings, 0 replies; 5+ messages in thread
From: Rasesh Mody @ 2019-11-05 20:34 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, bruce.richardson, ferruh.yigit, Jerin Jacob Kollanukkaran,
	GR-Everest-DPDK-Dev

>From: Thomas Monjalon <thomas@monjalon.net>
>Sent: Tuesday, November 05, 2019 10:15 AM
>
>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.
>
Without this change, the aarch64 build failed with error [1] below.

[1]
In file included from ../drivers/net/bnx2x/bnx2x.h:22,
                 from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
../drivers/net/bnx2x/bnx2x_osal.h:27:17: error: conflicting types for ‘uint64_t’
 #define __le64  uint64_t
                 ^~~~~~~~
In file included from /usr/include/stdint.h:37,
                 from /usr/lib/gcc/aarch64-linux-gnu/8/include/stdint.h:9,
                 from ../lib/librte_eal/common/include/arch/arm/rte_byteorder.h:16,
                 from ../drivers/net/bnx2x/bnx2x.h:17,
                 from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
/usr/include/aarch64-linux-gnu/bits/stdint-uintn.h:27:20: note: previous declaration of ‘uint64_t’ was here
 typedef __uint64_t uint64_t;
                    ^~~~~~~~
The details of build environment and complete error log can be found at
https://bugs.dpdk.org/show_bug.cgi?id=355

>> 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
>
I'll send v2 replacing all __FreeBSD__ with RTE_EXEC_ENV_FREEBSD.



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

end of thread, other threads:[~2019-11-06 11:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-01  6:02 [dpdk-dev] [PATCH] net/bnx2x: fix meson build failure Rasesh Mody
2019-11-05 18:14 ` Thomas Monjalon
2019-11-06  5:45 ` [dpdk-dev] [PATCH v2] " Rasesh Mody
2019-11-06 11:02   ` Thomas Monjalon
2019-11-05 20:34 [dpdk-dev] [PATCH] " Rasesh Mody

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