[dpdk-dev] config: make AVX and AVX512 configurable

Message ID 1493310859-49106-1-git-send-email-zhihong.wang@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Zhihong Wang April 27, 2017, 4:34 p.m. UTC
  Making AVX and AVX512 configurable is useful for performance and power
testing.

The similar kernel patch at https://patchwork.kernel.org/patch/9618883/.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
---
 config/common_base | 6 ++++++
 mk/rte.cpuflags.mk | 6 ++++++
 2 files changed, 12 insertions(+)
  

Comments

Thomas Monjalon April 27, 2017, 9:08 a.m. UTC | #1
27/04/2017 18:34, Zhihong Wang:
> Making AVX and AVX512 configurable is useful for performance and power
> testing.
> 
> The similar kernel patch at https://patchwork.kernel.org/patch/9618883/.
[...]
> +#
> +# Recognize/ignore the AVX/AVX512 CPU flags for performance/power testing
> +#
> +CONFIG_RTE_ENABLE_AVX=y
> +CONFIG_RTE_ENABLE_AVX512=n

It is disabling AVX512 in default configuration.
Please explain this behaviour change.
  
Zhihong Wang April 27, 2017, 9:18 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, April 27, 2017 5:08 PM
> To: Wang, Zhihong <zhihong.wang@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Cc: dev@dpdk.org; yuanhan.liu@linux.intel.com
> Subject: Re: [dpdk-dev] [PATCH] config: make AVX and AVX512 configurable
> 
> 27/04/2017 18:34, Zhihong Wang:
> > Making AVX and AVX512 configurable is useful for performance and power
> > testing.
> >
> > The similar kernel patch at https://patchwork.kernel.org/patch/9618883/.
> [...]
> > +#
> > +# Recognize/ignore the AVX/AVX512 CPU flags for performance/power
> testing
> > +#
> > +CONFIG_RTE_ENABLE_AVX=y
> > +CONFIG_RTE_ENABLE_AVX512=n
> 
> It is disabling AVX512 in default configuration.
> Please explain this behaviour change.

Though AVX512 rte_memcpy has been in DPDK for quite a while it's still
unproven in hardware with rich use cases. Mark it as experimental for
now, user can enable it for their own testing.

Will enable it with enough field tests and possible optimization.

Should I add the explanation in commit log, or comments in the source,
or both?
  
Thomas Monjalon April 27, 2017, 9:20 a.m. UTC | #3
27/04/2017 11:18, Wang, Zhihong:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 27/04/2017 18:34, Zhihong Wang:
> > > Making AVX and AVX512 configurable is useful for performance and power
> > > testing.
> > >
> > > The similar kernel patch at https://patchwork.kernel.org/patch/9618883/.
> > [...]
> > > +#
> > > +# Recognize/ignore the AVX/AVX512 CPU flags for performance/power
> > testing
> > > +#
> > > +CONFIG_RTE_ENABLE_AVX=y
> > > +CONFIG_RTE_ENABLE_AVX512=n
> > 
> > It is disabling AVX512 in default configuration.
> > Please explain this behaviour change.
> 
> Though AVX512 rte_memcpy has been in DPDK for quite a while it's still
> unproven in hardware with rich use cases. Mark it as experimental for
> now, user can enable it for their own testing.
> 
> Will enable it with enough field tests and possible optimization.
> 
> Should I add the explanation in commit log, or comments in the source,
> or both?

Yes please, add the explanation in the commit log and experimental comment
in the config.
  
Zhihong Wang April 27, 2017, 10:03 a.m. UTC | #4
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, April 27, 2017 5:20 PM
> To: Wang, Zhihong <zhihong.wang@intel.com>
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org;
> yuanhan.liu@linux.intel.com
> Subject: Re: [dpdk-dev] [PATCH] config: make AVX and AVX512 configurable
> 
> 27/04/2017 11:18, Wang, Zhihong:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > 27/04/2017 18:34, Zhihong Wang:
> > > > Making AVX and AVX512 configurable is useful for performance and
> power
> > > > testing.
> > > >
> > > > The similar kernel patch at
> https://patchwork.kernel.org/patch/9618883/.
> > > [...]
> > > > +#
> > > > +# Recognize/ignore the AVX/AVX512 CPU flags for
> performance/power
> > > testing
> > > > +#
> > > > +CONFIG_RTE_ENABLE_AVX=y
> > > > +CONFIG_RTE_ENABLE_AVX512=n
> > >
> > > It is disabling AVX512 in default configuration.
> > > Please explain this behaviour change.
> >
> > Though AVX512 rte_memcpy has been in DPDK for quite a while it's still
> > unproven in hardware with rich use cases. Mark it as experimental for
> > now, user can enable it for their own testing.
> >
> > Will enable it with enough field tests and possible optimization.
> >
> > Should I add the explanation in commit log, or comments in the source,
> > or both?
> 
> Yes please, add the explanation in the commit log and experimental
> comment
> in the config.

Thanks a lot! It's included in v2.
  

Patch

diff --git a/config/common_base b/config/common_base
index 0b4297c..9ca94a8 100644
--- a/config/common_base
+++ b/config/common_base
@@ -103,6 +103,12 @@  CONFIG_RTE_EAL_IGB_UIO=n
 CONFIG_RTE_EAL_VFIO=n
 CONFIG_RTE_MALLOC_DEBUG=n
 
+#
+# Recognize/ignore the AVX/AVX512 CPU flags for performance/power testing
+#
+CONFIG_RTE_ENABLE_AVX=y
+CONFIG_RTE_ENABLE_AVX512=n
+
 # Default driver path (or "" to disable)
 CONFIG_RTE_EAL_PMD_PATH=""
 
diff --git a/mk/rte.cpuflags.mk b/mk/rte.cpuflags.mk
index e634abc..4288c14 100644
--- a/mk/rte.cpuflags.mk
+++ b/mk/rte.cpuflags.mk
@@ -70,8 +70,10 @@  CPUFLAGS += PCLMULQDQ
 endif
 
 ifneq ($(filter $(AUTO_CPUFLAGS),__AVX__),)
+ifeq ($(CONFIG_RTE_ENABLE_AVX),y)
 CPUFLAGS += AVX
 endif
+endif
 
 ifneq ($(filter $(AUTO_CPUFLAGS),__RDRND__),)
 CPUFLAGS += RDRAND
@@ -86,12 +88,16 @@  CPUFLAGS += F16C
 endif
 
 ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
+ifeq ($(CONFIG_RTE_ENABLE_AVX),y)
 CPUFLAGS += AVX2
 endif
+endif
 
 ifneq ($(filter $(AUTO_CPUFLAGS),__AVX512F__),)
+ifeq ($(CONFIG_RTE_ENABLE_AVX512),y)
 CPUFLAGS += AVX512F
 endif
+endif
 
 # IBM Power CPU flags
 ifneq ($(filter $(AUTO_CPUFLAGS),__PPC64__),)