[ovs-dev] [PATCH] acinclude: Strip out -mno-avx512f provided by DPDK.

Van Haaren, Harry harry.van.haaren at intel.com
Fri Jan 8 12:00:46 UTC 2021


> -----Original Message-----
> From: Ilya Maximets <i.maximets at ovn.org>
> Sent: Friday, January 8, 2021 11:47 AM
> To: ovs-dev at openvswitch.org; Stokes, Ian <ian.stokes at intel.com>
> Cc: David Marchand <david.marchand at redhat.com>; Kevin Traynor
> <ktraynor at redhat.com>; Richardson, Bruce <bruce.richardson at intel.com>; Luca
> Boccassi <bluca at debian.org>; Pai G, Sunil <sunil.pai.g at intel.com>; Van Haaren,
> Harry <harry.van.haaren at intel.com>; Ilya Maximets <i.maximets at ovn.org>
> Subject: [PATCH] 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. addign DPDK flags before OVS ones) is not an

Typo "adding" here, fix on apply?

> 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 at ovn.org>

Tested here on master branch, working as expected, and seems the best fix to me too:
Acked-by: Harry van Haaren <harry.van.haaren at intel.com>

<snip patch impl>


More information about the dev mailing list