summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2021-01-08 12:46:56 +0100
committerIan Stokes <ian.stokes@intel.com>2021-01-15 11:27:19 +0000
commit32c8c10d94361f38331b03ccc2bcfe834c7914c4 (patch)
treee338448bef2451f797c1d8db4678d5fcb6c86fc3 /acinclude.m4
parent584bacb52d5e2111bbcb7bbf5e6d964d8a79d7f8 (diff)
downloadopenvswitch-32c8c10d94361f38331b03ccc2bcfe834c7914c4.tar.gz
acinclude: Strip out -mno-avx512f provided by DPDK.
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. In this case OVS will detect that toolchain is good and will try to build AVX512-optimized classifier. However, '-mno-avx512f' flag will be passed from the DPDK side breaking the build: In file included from /gcc/x86_64-linux-gnu/8/include/immintrin.h:55, from /gcc/x86_64-linux-gnu/8/include/x86intrin.h:48, from /dpdk/../x86_64-linux-gnu/dpdk/rte_vect.h:28, from /dpdk/../x86_64-linux-gnu/dpdk/rte_memcpy.h:17, from /dpdk/rte_mempool.h:51, from /dpdk/rte_mbuf.h:38, from ../lib/dp-packet.h:25, from ../lib/dpif.h:380, from ../lib/dpif-netdev.h:23, from ../lib/dpif-netdev-lookup-avx512-gather.c:22: /usr/lib/gcc/x86_64-linux-gnu/8/include/avx512bwintrin.h:413:1: error: inlining failed in call to always_inline '_mm512_sad_epu8': target specific option mismatch _mm512_sad_epu8 (__m512i __A, __m512i __B) 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: https://github.com/openvswitch/ovs-issues/issues/201 Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Acked-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m46
1 files changed, 6 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 60871f67a..b73526b60 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -445,6 +445,12 @@ AC_DEFUN([OVS_CHECK_DPDK], [
# forces 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')
+ # 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])