[ovs-dev] [PATCH v1 branch-2.13 2/2] acinclude: Strip out -mno-avx512f provided by DPDK.

Ian Stokes ian.stokes at intel.com
Fri Jan 15 17:38:55 UTC 2021


DPDK forces '-mno-avx512f' flag for the application if the toolchain
used to build DPDK had broken AVX512 support.

DPDK forces '-mno-avx512f' flag for the application if the toolchain
used to build DPDK had broken AVX512 support.  But OVS could be built
with a completely different or fixed toolchain with correct avx512
support.

Fix that by stripping out `-mno-avx512f` as we already do for '-march'.
This will allow the OVS to decide if the AVX512 can be used.

Reordering of CFLAGS (i.e. adding DPDK flags before OVS ones) is not an
option since autotools might reorder them back later and it's very
unpredictable.

Reported-at: openvswitch/ovs-issues#201
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Co-authored-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
 acinclude.m4 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 9922c69b0..4033e28eb 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -433,7 +433,13 @@ AC_DEFUN([OVS_CHECK_DPDK], [
     fi
     # Force in pkg-config since this could override user-specified options.
     # It's enough to have -mssse3 to build with DPDK headers.
-    DPDK_INCLUDE=$(echo "$DPDK_INCLUDE" | sed 's/-march=[[^ ]]*//g')
+    DPDK_INCLUDE=$(echo "$DPDK_INCLUDE" | sed 's/-march=[[^ ]]*//g'
+    # Also stripping out '-mno-avx512f'.  Support for AVX512 will be disabled
+    # if OVS will detect that it's broken.  OVS could be built with a
+    # completely different toolchain that correctly supports AVX512, flags
+    # forced by DPDK only breaks our feature detection mechanism and leads to
+    # build failures: https://github.com/openvswitch/ovs-issues/issues/201
+    DPDK_INCLUDE=$(echo "$DPDK_INCLUDE" | sed 's/-mno-avx512f//g'))
     OVS_CFLAGS="$OVS_CFLAGS $DPDK_INCLUDE"
     OVS_ENABLE_OPTION([-mssse3])
 
-- 
2.13.6



More information about the dev mailing list