[dpdk-dev,v3,1/3] net/thunderx: disable PMD for older compilers

Message ID 20170406170511.22289-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

Ferruh Yigit April 6, 2017, 5:05 p.m. UTC
  Disable for gcc < 4.7 and icc <= 14.0

PMD uses some compiler builtins and new compiler options. Tested with
gcc 4.5.1 and following were not supported:

option:
-Ofast

macros:
_Static_assert

__ORDER_LITTLE_ENDIAN__
__ORDER_BIG_ENDIAN__
__BYTE_ORDER__

__atomic_fetch_add
__ATOMIC_ACQUIRE
__atomic_load_n
__ATOMIC_RELAXED
__atomic_store_n
__ATOMIC_RELEASE

It is not easy to fix all in PMD, disabling PMD for older compilers.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/Makefile                     | 5 +++++
 mk/toolchain/gcc/rte.toolchain-compat.mk | 5 +++++
 mk/toolchain/icc/rte.toolchain-compat.mk | 5 +++++
 3 files changed, 15 insertions(+)
  

Comments

Thomas Monjalon April 6, 2017, 6:40 p.m. UTC | #1
2017-04-06 18:05, Ferruh Yigit:
> Disable for gcc < 4.7 and icc <= 14.0
> 
> PMD uses some compiler builtins and new compiler options. Tested with
> gcc 4.5.1 and following were not supported:
> 
> option:
> -Ofast
> 
> macros:
> _Static_assert
> 
> __ORDER_LITTLE_ENDIAN__
> __ORDER_BIG_ENDIAN__
> __BYTE_ORDER__
> 
> __atomic_fetch_add
> __ATOMIC_ACQUIRE
> __atomic_load_n
> __ATOMIC_RELAXED
> __atomic_store_n
> __ATOMIC_RELEASE
> 
> It is not easy to fix all in PMD, disabling PMD for older compilers.
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied, thanks
  

Patch

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index b94582d..3481eff 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -31,6 +31,11 @@ 
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
+# set in mk/toolchain/xxx/rte.toolchain-compat.mk
+ifeq ($(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD),d)
+        $(warning thunderx pmd is not supported by older compilers)
+endif
+
 core-libs := librte_eal librte_mbuf librte_mempool librte_ring librte_ether
 core-libs += librte_net librte_kvargs
 
diff --git a/mk/toolchain/gcc/rte.toolchain-compat.mk b/mk/toolchain/gcc/rte.toolchain-compat.mk
index 6eed20c..280dde2 100644
--- a/mk/toolchain/gcc/rte.toolchain-compat.mk
+++ b/mk/toolchain/gcc/rte.toolchain-compat.mk
@@ -89,4 +89,9 @@  else
 	ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1)
 		MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
 	endif
+
+	# Disable thunderx PMD for gcc < 4.7
+	ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
+		CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=d
+	endif
 endif
diff --git a/mk/toolchain/icc/rte.toolchain-compat.mk b/mk/toolchain/icc/rte.toolchain-compat.mk
index 4134466..73770f7 100644
--- a/mk/toolchain/icc/rte.toolchain-compat.mk
+++ b/mk/toolchain/icc/rte.toolchain-compat.mk
@@ -72,4 +72,9 @@  else
 		# remove march options
 		MACHINE_CFLAGS := $(patsubst -march=%,-xSSE3,$(MACHINE_CFLAGS))
 	endif
+
+	# Disable thunderx PMD for icc <= 14.0
+	ifeq ($(shell test $(ICC_MAJOR_VERSION) -le 14 && echo 1), 1)
+		CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=d
+	endif
 endif