[dpdk-dev,v2,1/3] net/thunderx: disable pmd for older compilers
Checks
Commit Message
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/thunderx/Makefile | 15 +++++++++++++++
mk/toolchain/gcc/rte.toolchain-compat.mk | 4 ++++
mk/toolchain/icc/rte.toolchain-compat.mk | 4 ++++
3 files changed, 23 insertions(+)
Comments
2017-04-06 14:46, Ferruh Yigit:
> --- a/mk/toolchain/gcc/rte.toolchain-compat.mk
> +++ b/mk/toolchain/gcc/rte.toolchain-compat.mk
> @@ -89,4 +89,8 @@ else
> ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1)
> MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
> endif
> +
> + ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
> + CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n
> + endif
In previous version you were disabling the PMD inside the PMD Makefile.
It was better.
On 4/6/2017 2:59 PM, Thomas Monjalon wrote:
> 2017-04-06 14:46, Ferruh Yigit:
>> --- a/mk/toolchain/gcc/rte.toolchain-compat.mk
>> +++ b/mk/toolchain/gcc/rte.toolchain-compat.mk
>> @@ -89,4 +89,8 @@ else
>> ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1)
>> MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
>> endif
>> +
>> + ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
>> + CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n
>> + endif
>
> In previous version you were disabling the PMD inside the PMD Makefile.
> It was better.
Agreed, but I that is causing a build error in applications. I have
missed it in previous release because an .a file was already created.
So, need a way to disable linking pmd against application.
2017-04-06 15:05, Ferruh Yigit:
> On 4/6/2017 2:59 PM, Thomas Monjalon wrote:
> > 2017-04-06 14:46, Ferruh Yigit:
> >> --- a/mk/toolchain/gcc/rte.toolchain-compat.mk
> >> +++ b/mk/toolchain/gcc/rte.toolchain-compat.mk
> >> @@ -89,4 +89,8 @@ else
> >> ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1)
> >> MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
> >> endif
> >> +
> >> + ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
> >> + CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n
> >> + endif
> >
> > In previous version you were disabling the PMD inside the PMD Makefile.
> > It was better.
>
> Agreed, but I that is causing a build error in applications. I have
> missed it in previous release because an .a file was already created.
>
> So, need a way to disable linking pmd against application.
I see.
If it is disabled here, we won't see the warning in the PMD Makefile?
On 4/6/2017 3:09 PM, Thomas Monjalon wrote:
> 2017-04-06 15:05, Ferruh Yigit:
>> On 4/6/2017 2:59 PM, Thomas Monjalon wrote:
>>> 2017-04-06 14:46, Ferruh Yigit:
>>>> --- a/mk/toolchain/gcc/rte.toolchain-compat.mk
>>>> +++ b/mk/toolchain/gcc/rte.toolchain-compat.mk
>>>> @@ -89,4 +89,8 @@ else
>>>> ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1)
>>>> MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
>>>> endif
>>>> +
>>>> + ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
>>>> + CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n
>>>> + endif
>>>
>>> In previous version you were disabling the PMD inside the PMD Makefile.
>>> It was better.
>>
>> Agreed, but I that is causing a build error in applications. I have
>> missed it in previous release because an .a file was already created.
>>
>> So, need a way to disable linking pmd against application.
>
> I see.
>
> If it is disabled here, we won't see the warning in the PMD Makefile?
Oh, you are right, warnings in PMD Makefile become useless.
I can set another flag in compat headers and check it in pmd makefile,
will it be too much noise?
@@ -60,8 +60,23 @@ SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_ethdev.c
SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_bsvf.c
SRCS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += nicvf_svf.c
+# GCC
ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
CFLAGS_nicvf_rxtx.o += -fno-prefetch-loop-arrays
+
+# Disable PMD for gcc < 4.7 in mk/toolchain/gcc/rte.toolchain-compat.mk
+ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
+$(warning thunderx pmd not supported by gcc < 4.7)
+endif
+
+# ICC
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
+
+# Disable PMD for icc <= 14.0 in mk/toolchain/gcc/rte.toolchain-compat.mk
+ifeq ($(shell test $(ICC_MAJOR_VERSION) -le 14 && echo 1), 1)
+$(warning thunderx pmd not supported by icc <= 14.0)
+endif
+
endif
CFLAGS_nicvf_rxtx.o += -Ofast
@@ -89,4 +89,8 @@ else
ifeq ($(shell test $(GCC_VERSION) -lt 42 && echo 1), 1)
MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
endif
+
+ ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
+ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n
+ endif
endif
@@ -64,6 +64,10 @@ else
MACHINE_CFLAGS := $(patsubst -march=core-avx2,-xCORE-AVX2,$(MACHINE_CFLAGS))
# remove westmere flags
MACHINE_CFLAGS := $(filter-out -mpclmul -maes,$(MACHINE_CFLAGS))
+
+ ifeq ($(shell test $(ICC_MAJOR_VERSION) -le 14 && echo 1), 1)
+ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n
+ endif
endif
# if icc version == 12.0
ifeq ($(shell test $(ICC_MAJOR_VERSION) -eq 12 && test $(ICC_MINOR_VERSION) -eq 0 && echo 1), 1)