patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: stable@dpdk.org
Cc: zhihong.wang@intel.com
Subject: [dpdk-stable] [PATCH 16.11] config: make AVX and AVX512 configurable
Date: Wed, 21 Nov 2018 14:09:22 +0000	[thread overview]
Message-ID: <20181121140922.32568-1-bluca@debian.org> (raw)

From: Zhihong Wang <zhihong.wang@intel.com>

[ backported from upstream commit 1838af33997daa7a2093e3aa7bf95a2d0c9578bf ]

Making AVX and AVX512 configurable is useful for performance and power
testing.

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

AVX512 support like in rte_memcpy has been in DPDK since 16.04, but it's
still unproven in rich use cases in hardware. Therefore it's marked as
experimental for now, will enable it after enough field test and possible
optimization.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
Fixes build failure with gcc 4.8 after the backport of:
  8d07c82b239f ("mk: disable gcc AVX512F support")

  gcc: error: unrecognized command line option '-mno-avx512f'

 config/common_base | 8 ++++++++
 mk/rte.cpuflags.mk | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/config/common_base b/config/common_base
index 802fb5e32..4f4480682 100644
--- a/config/common_base
+++ b/config/common_base
@@ -98,6 +98,14 @@ CONFIG_RTE_EAL_VFIO=n
 CONFIG_RTE_MALLOC_DEBUG=n
 CONFIG_RTE_USE_LIBBSD=n
 
+#
+# Recognize/ignore the AVX/AVX512 CPU flags for performance/power testing.
+# AVX512 is marked as experimental for now, will enable it after enough
+# field test and possible optimization.
+#
+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 c7027a0fe..5cef63abd 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,10 +88,13 @@ 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
 else
 # disable AVX512F support of gcc as a workaround for Bug 97
@@ -97,6 +102,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 MACHINE_CFLAGS += -mno-avx512f
 endif
 endif
+endif
 
 # IBM Power CPU flags
 ifneq ($(filter $(AUTO_CPUFLAGS),__PPC64__),)
-- 
2.19.1

                 reply	other threads:[~2018-11-21 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181121140922.32568-1-bluca@debian.org \
    --to=bluca@debian.org \
    --cc=stable@dpdk.org \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).