DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] net/octeontx: disable PMD for old compilers
@ 2018-01-23 16:22 Pavan Nikhilesh
  2018-01-25 13:58 ` Ferruh Yigit
  2018-01-26  6:40 ` [dpdk-dev] [PATCH v2] net/octeontx: use stub for building in " Pavan Nikhilesh
  0 siblings, 2 replies; 5+ messages in thread
From: Pavan Nikhilesh @ 2018-01-23 16:22 UTC (permalink / raw)
  To: jerin.jacob, santosh.shukla, ferruh.yigit; +Cc: dev, Pavan Nikhilesh

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

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
-- 
2.16.0

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

* Re: [dpdk-dev] [PATCH] net/octeontx: disable PMD for old compilers
  2018-01-23 16:22 [dpdk-dev] [PATCH] net/octeontx: disable PMD for old compilers Pavan Nikhilesh
@ 2018-01-25 13:58 ` Ferruh Yigit
  2018-01-26  5:25   ` Pavan Nikhilesh
  2018-01-26  6:40 ` [dpdk-dev] [PATCH v2] net/octeontx: use stub for building in " Pavan Nikhilesh
  1 sibling, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2018-01-25 13:58 UTC (permalink / raw)
  To: Pavan Nikhilesh, jerin.jacob, santosh.shukla; +Cc: dev

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?

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

* Re: [dpdk-dev] [PATCH] net/octeontx: disable PMD for old compilers
  2018-01-25 13:58 ` Ferruh Yigit
@ 2018-01-26  5:25   ` Pavan Nikhilesh
  0 siblings, 0 replies; 5+ messages in thread
From: Pavan Nikhilesh @ 2018-01-26  5:25 UTC (permalink / raw)
  To: Ferruh Yigit, jerin.jacob, santosh.shukla; +Cc: dev

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.

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

* [dpdk-dev] [PATCH v2] net/octeontx: use stub for building in old compilers
  2018-01-23 16:22 [dpdk-dev] [PATCH] net/octeontx: disable PMD for old compilers Pavan Nikhilesh
  2018-01-25 13:58 ` Ferruh Yigit
@ 2018-01-26  6:40 ` Pavan Nikhilesh
  2018-01-26  7:20   ` Jerin Jacob
  1 sibling, 1 reply; 5+ messages in thread
From: Pavan Nikhilesh @ 2018-01-26  6:40 UTC (permalink / raw)
  To: jerin.jacob, santosh.shukla, ferruh.yigit; +Cc: dev, Pavan Nikhilesh

Use stub for building clang < 4.0 as it doesn't support the following
arm machine directives:

.cpu

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 v2 Changes:
 - use stub for older clang compilers instead of disabling PMD

 drivers/net/octeontx/Makefile           | 8 ++++++++
 drivers/net/octeontx/base/octeontx_io.h | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/octeontx/Makefile b/drivers/net/octeontx/Makefile
index b47bf7a40..5244eedd3 100644
--- a/drivers/net/octeontx/Makefile
+++ b/drivers/net/octeontx/Makefile
@@ -30,6 +30,14 @@ SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_pkivf.c
 SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_bgx.c
 SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_ethdev.c

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+
+ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 40 && echo 1), 1)
+CFLAGS += -D CLANG_BUILD_BUG
+endif
+
+endif
+
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 CFLAGS_octeontx_rxtx.o += -fno-prefetch-loop-arrays

diff --git a/drivers/net/octeontx/base/octeontx_io.h b/drivers/net/octeontx/base/octeontx_io.h
index d51ded236..1c0a941a5 100644
--- a/drivers/net/octeontx/base/octeontx_io.h
+++ b/drivers/net/octeontx/base/octeontx_io.h
@@ -51,7 +51,7 @@ do {							\
 } while (0)
 #endif

-#if defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_ARM64) && !defined(CLANG_BUILD_BUG)
 /**
  * Perform an atomic fetch-and-add operation.
  */
--
2.16.0

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

* Re: [dpdk-dev] [PATCH v2] net/octeontx: use stub for building in old compilers
  2018-01-26  6:40 ` [dpdk-dev] [PATCH v2] net/octeontx: use stub for building in " Pavan Nikhilesh
@ 2018-01-26  7:20   ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2018-01-26  7:20 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: santosh.shukla, ferruh.yigit, dev

-----Original Message-----
> Date: Fri, 26 Jan 2018 12:10:16 +0530
> From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com,
>  ferruh.yigit@intel.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2] net/octeontx: use stub for building in old
>  compilers
> X-Mailer: git-send-email 2.14.1
> 
> Use stub for building clang < 4.0 as it doesn't support the following
> arm machine directives:
> 
> .cpu
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> 
>  v2 Changes:
>  - use stub for older clang compilers instead of disabling PMD
> 
>  drivers/net/octeontx/Makefile           | 8 ++++++++
>  drivers/net/octeontx/base/octeontx_io.h | 2 +-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/octeontx/Makefile b/drivers/net/octeontx/Makefile
> index b47bf7a40..5244eedd3 100644
> --- a/drivers/net/octeontx/Makefile
> +++ b/drivers/net/octeontx/Makefile
> @@ -30,6 +30,14 @@ SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_pkivf.c
>  SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_bgx.c
>  SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_ethdev.c
> 
> +ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
> +
> +ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 40 && echo 1), 1)
> +CFLAGS += -D CLANG_BUILD_BUG
> +endif
> +
> +endif
> +
>  ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
>  CFLAGS_octeontx_rxtx.o += -fno-prefetch-loop-arrays
> 
> diff --git a/drivers/net/octeontx/base/octeontx_io.h b/drivers/net/octeontx/base/octeontx_io.h
> index d51ded236..1c0a941a5 100644
> --- a/drivers/net/octeontx/base/octeontx_io.h
> +++ b/drivers/net/octeontx/base/octeontx_io.h
> @@ -51,7 +51,7 @@ do {							\
>  } while (0)
>  #endif
> 
> -#if defined(RTE_ARCH_ARM64)
> +#if defined(RTE_ARCH_ARM64) && !defined(CLANG_BUILD_BUG)

It will build silently and break while running the PMD.

I think, We should disable building the PMD if dependencies are not meet.
Instead of building something that known to not work.


>  /**
>   * Perform an atomic fetch-and-add operation.
>   */
> --
> 2.16.0
> 

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

end of thread, other threads:[~2018-01-26  7:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 16:22 [dpdk-dev] [PATCH] net/octeontx: disable PMD for old compilers Pavan Nikhilesh
2018-01-25 13:58 ` Ferruh Yigit
2018-01-26  5:25   ` Pavan Nikhilesh
2018-01-26  6:40 ` [dpdk-dev] [PATCH v2] net/octeontx: use stub for building in " Pavan Nikhilesh
2018-01-26  7:20   ` Jerin Jacob

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