[dpdk-dev] net/octeontx: disable PMD for old compilers

Message ID 20180123162240.26831-1-pbhagavatula@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Pavan Nikhilesh Jan. 23, 2018, 4:22 p.m. UTC
  Disable for clang < 4.0 as it doesn't support the following
arm machine directives:

.cpu

This also disables event octeontx as it depends on net octeontx.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 drivers/event/Makefile                     | 4 ++++
 drivers/net/Makefile                       | 3 +++
 mk/toolchain/clang/rte.toolchain-compat.mk | 5 +++++
 3 files changed, 12 insertions(+)
  

Comments

Ferruh Yigit Jan. 25, 2018, 1:58 p.m. UTC | #1
On 1/23/2018 4:22 PM, Pavan Nikhilesh wrote:
> Disable for clang < 4.0 as it doesn't support the following
> arm machine directives:
> 
> .cpu
> 
> This also disables event octeontx as it depends on net octeontx.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

<...>

> @@ -20,3 +20,8 @@ CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.)
>  ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 35 && echo 1), 1)
>  	CC_SUPPORTS_Z := false
>  endif
> +
> +ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 40 && echo 1), 1)
> +	CONFIG_RTE_LIBRTE_OCTEONTX_PMD=d
> +	CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=d
> +endif

I remember we did this before but this is ugly.

Can it be done in a generic way that compiler dependencies defined in the PMD
Makefile and during config PMD may be disable based on dependency and
environment. If there is no dependency PMD will not do anything special, does it
make sense?
  
Pavan Nikhilesh Jan. 26, 2018, 5:25 a.m. UTC | #2
On Thu, Jan 25, 2018 at 01:58:32PM +0000, Ferruh Yigit wrote:
> On 1/23/2018 4:22 PM, Pavan Nikhilesh wrote:
> > Disable for clang < 4.0 as it doesn't support the following
> > arm machine directives:
> >
> > .cpu
> >
> > This also disables event octeontx as it depends on net octeontx.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
>
> <...>
>
> > @@ -20,3 +20,8 @@ CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.)
> >  ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 35 && echo 1), 1)
> >  	CC_SUPPORTS_Z := false
> >  endif
> > +
> > +ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 40 && echo 1), 1)
> > +	CONFIG_RTE_LIBRTE_OCTEONTX_PMD=d
> > +	CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=d
> > +endif
>
> I remember we did this before but this is ugly.
>
> Can it be done in a generic way that compiler dependencies defined in the PMD
> Makefile and during config PMD may be disable based on dependency and
> environment. If there is no dependency PMD will not do anything special, does it
> make sense?

Makes sense, Will disable compiler dependent code in PMD makefile.

Thanks,
Pavan.
  

Patch

diff --git a/drivers/event/Makefile b/drivers/event/Makefile
index c3d89a151..2bb0464f4 100644
--- a/drivers/event/Makefile
+++ b/drivers/event/Makefile
@@ -4,6 +4,10 @@ 
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF),d)
+        $(warning pmd octeontx ssovf is not supported by old compilers)
+endif
+
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV) += skeleton
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += sw
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += octeontx
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index e1127326b..bf7816d1e 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -7,6 +7,9 @@  include $(RTE_SDK)/mk/rte.vars.mk
 ifeq ($(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD),d)
         $(warning thunderx pmd is not supported by old compilers)
 endif
+ifeq ($(CONFIG_RTE_LIBRTE_OCTEONTX_PMD),d)
+        $(warning octeontx pmd is not supported by old compilers)
+endif
 
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet
 DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark
diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk
index e6189b498..d81aa1c86 100644
--- a/mk/toolchain/clang/rte.toolchain-compat.mk
+++ b/mk/toolchain/clang/rte.toolchain-compat.mk
@@ -20,3 +20,8 @@  CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.)
 ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 35 && echo 1), 1)
 	CC_SUPPORTS_Z := false
 endif
+
+ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 40 && echo 1), 1)
+	CONFIG_RTE_LIBRTE_OCTEONTX_PMD=d
+	CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=d
+endif