From: Liang Ma <liangma@bytedance.com> GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which casue building failure with debug buildtype. Therefore, it's helpful to disable avx512 for GCC 6.3.0 Bugzilla ID: 717 Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) Cc: stable@dpdk.org Reported-by: Liang Ma <liangma@liangbit.com> Signed-off-by: Liang Ma <liangma@bytedance.com> --- buildtools/binutils-avx512-check.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/buildtools/binutils-avx512-check.sh b/buildtools/binutils-avx512-check.sh index 2a833b64b7..b86d0b179e 100755 --- a/buildtools/binutils-avx512-check.sh +++ b/buildtools/binutils-avx512-check.sh @@ -5,6 +5,13 @@ AS=${AS:-as} OBJFILE=$(mktemp -t dpdk.binutils-check.XXXXXX) trap 'rm -f "$OBJFILE"' EXIT + +# from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 +GCC_VER=6.3.0 +gcc --version|grep $GCC_VER && { + echo "GCC 6.3.0 is broken with _mm512_extracti64x4_epi64" + exit 1 +} # from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028 GATHER_PARAMS='0x8(,%ymm1,1),%ymm0{%k2}' -- 2.17.1
On Sat, 17 Jul 2021 18:08:30 +0100
Liang Ma <liangma@liangbit.com> wrote:
> From: Liang Ma <liangma@bytedance.com>
>
> GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64.
> Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
>
> Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6,
> which casue building failure with debug buildtype.
>
> Therefore, it's helpful to disable avx512 for GCC 6.3.0
>
> Bugzilla ID: 717
> Fixes: e6a6a138919f (net/i40e: add AVX512 vector path)
> Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
> Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
> Cc: stable@dpdk.org
>
> Reported-by: Liang Ma <liangma@liangbit.com>
> Signed-off-by: Liang Ma <liangma@bytedance.com>
What distro still has GCC 6.3.0?
On Sat, Jul 17, 2021 at 10:48:49AM -0700, Stephen Hemminger wrote:
> On Sat, 17 Jul 2021 18:08:30 +0100
> Liang Ma <liangma@liangbit.com> wrote:
>
> > From: Liang Ma <liangma@bytedance.com>
> >
> > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64.
> > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
> >
> > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6,
> > which casue building failure with debug buildtype.
> >
> > Therefore, it's helpful to disable avx512 for GCC 6.3.0
> >
> > Bugzilla ID: 717
> > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path)
> > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
> > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
> > Cc: stable@dpdk.org
> >
> > Reported-by: Liang Ma <liangma@liangbit.com>
> > Signed-off-by: Liang Ma <liangma@bytedance.com>
>
> What distro still has GCC 6.3.0?
For example Debian 9.x
On Sat, 17 Jul 2021 23:13:04 +0100
Liang Ma <liangma@liangbit.com> wrote:
> On Sat, Jul 17, 2021 at 10:48:49AM -0700, Stephen Hemminger wrote:
> > On Sat, 17 Jul 2021 18:08:30 +0100
> > Liang Ma <liangma@liangbit.com> wrote:
> >
> > > From: Liang Ma <liangma@bytedance.com>
> > >
> > > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64.
> > > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
> > >
> > > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6,
> > > which casue building failure with debug buildtype.
> > >
> > > Therefore, it's helpful to disable avx512 for GCC 6.3.0
> > >
> > > Bugzilla ID: 717
> > > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path)
> > > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
> > > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
> > > Cc: stable@dpdk.org
> > >
> > > Reported-by: Liang Ma <liangma@liangbit.com>
> > > Signed-off-by: Liang Ma <liangma@bytedance.com>
> >
> > What distro still has GCC 6.3.0?
> For example Debian 9.x
Ok, thanks. Is there a bug fix in Debian LTS yet?
On Sat, Jul 17, 2021 at 06:08:04PM -0700, Stephen Hemminger wrote: > On Sat, 17 Jul 2021 23:13:04 +0100 > Liang Ma <liangma@liangbit.com> wrote: > > > On Sat, Jul 17, 2021 at 10:48:49AM -0700, Stephen Hemminger wrote: > > > On Sat, 17 Jul 2021 18:08:30 +0100 > > > Liang Ma <liangma@liangbit.com> wrote: > > > > > > > From: Liang Ma <liangma@bytedance.com> > > > > > > > > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. > > > > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 > > > > > > > > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, > > > > which casue building failure with debug buildtype. > > > > > > > > Therefore, it's helpful to disable avx512 for GCC 6.3.0 > > > > > > > > Bugzilla ID: 717 > > > > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) > > > > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) > > > > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) > > > > Cc: stable@dpdk.org > > > > > > > > Reported-by: Liang Ma <liangma@liangbit.com> > > > > Signed-off-by: Liang Ma <liangma@bytedance.com> > > > > > > What distro still has GCC 6.3.0? > > For example Debian 9.x > > Ok, thanks. Is there a bug fix in Debian LTS yet? I look into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887, and find gcc community has no plan to backport fix. Hence, I don't think Debian LTS will have any fix for this. That's why I send out this patch.
On Sun, Jul 18, 2021 at 10:33:15AM +0100, Liang Ma wrote:
> On Sat, Jul 17, 2021 at 06:08:04PM -0700, Stephen Hemminger wrote:
> > On Sat, 17 Jul 2021 23:13:04 +0100
> > Liang Ma <liangma@liangbit.com> wrote:
> >
> > > On Sat, Jul 17, 2021 at 10:48:49AM -0700, Stephen Hemminger wrote:
> > > > On Sat, 17 Jul 2021 18:08:30 +0100
> > > > Liang Ma <liangma@liangbit.com> wrote:
> > > >
> > > > > From: Liang Ma <liangma@bytedance.com>
> > > > >
> > > > > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64.
> > > > > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
> > > > >
> > > > > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6,
> > > > > which casue building failure with debug buildtype.
> > > > >
> > > > > Therefore, it's helpful to disable avx512 for GCC 6.3.0
> > > > >
> > > > > Bugzilla ID: 717
> > > > > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path)
> > > > > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
> > > > > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
> > > > > Cc: stable@dpdk.org
> > > > >
> > > > > Reported-by: Liang Ma <liangma@liangbit.com>
> > > > > Signed-off-by: Liang Ma <liangma@bytedance.com>
> > > >
> > > > What distro still has GCC 6.3.0?
> > > For example Debian 9.x
> >
> > Ok, thanks. Is there a bug fix in Debian LTS yet?
> I look into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887, and
> find gcc community has no plan to backport fix. Hence, I don't think
> Debian LTS will have any fix for this. That's why I send out this patch.
>
Thanks for the report. However, rather than just disabling based on version
number, can we instead use a compile-time check for broken compiler. This
is what we did previously for other similar issues and it works better
because:
* removes the possibility of us missing a broken compiler version
* takes account of the possibility of a fix backport (even if we don't
expect one, it's best not to count it out)
Looking at the bug report, it seems this issue could be detected directly
in meson using "cc.compiles" and the code snippet from the report.
Regards,
/Bruce
On Mon, Jul 19, 2021 at 09:38:14AM +0100, Bruce Richardson wrote:
> On Sun, Jul 18, 2021 at 10:33:15AM +0100, Liang Ma wrote:
> > On Sat, Jul 17, 2021 at 06:08:04PM -0700, Stephen Hemminger wrote:
> > > On Sat, 17 Jul 2021 23:13:04 +0100
> > > Liang Ma <liangma@liangbit.com> wrote:
> > >
> > > > On Sat, Jul 17, 2021 at 10:48:49AM -0700, Stephen Hemminger wrote:
> > > > > On Sat, 17 Jul 2021 18:08:30 +0100
> > > > > Liang Ma <liangma@liangbit.com> wrote:
> > > > >
> > > > > > From: Liang Ma <liangma@bytedance.com>
> > > > > >
> > > > > > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64.
> > > > > > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
> > > > > >
> > > > > > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6,
> > > > > > which casue building failure with debug buildtype.
> > > > > >
> > > > > > Therefore, it's helpful to disable avx512 for GCC 6.3.0
> > > > > >
> > > > > > Bugzilla ID: 717
> > > > > > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path)
> > > > > > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
> > > > > > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
> > > > > > Cc: stable@dpdk.org
> > > > > >
> > > > > > Reported-by: Liang Ma <liangma@liangbit.com>
> > > > > > Signed-off-by: Liang Ma <liangma@bytedance.com>
> > > > >
> > > > > What distro still has GCC 6.3.0?
> > > > For example Debian 9.x
> > >
> > > Ok, thanks. Is there a bug fix in Debian LTS yet?
> > I look into https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887, and
> > find gcc community has no plan to backport fix. Hence, I don't think
> > Debian LTS will have any fix for this. That's why I send out this patch.
> >
> Thanks for the report. However, rather than just disabling based on version
> number, can we instead use a compile-time check for broken compiler. This
> is what we did previously for other similar issues and it works better
> because:
> * removes the possibility of us missing a broken compiler version
> * takes account of the possibility of a fix backport (even if we don't
> expect one, it's best not to count it out)
>
> Looking at the bug report, it seems this issue could be detected directly
> in meson using "cc.compiles" and the code snippet from the report.
>
> Regards,
> /Bruce
Many thanks for the suggestion. I will rework the patch with the
suggested solution.
From: Liang Ma <liangma@bytedance.com> GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype. Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6. This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512. Bugzilla ID: 717 Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) Cc: stable@dpdk.org Reported-by: Liang Ma <liangma@liangbit.com> Signed-off-by: Liang Ma <liangma@bytedance.com> --- config/x86/meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/x86/meson.build b/config/x86/meson.build index b9348c44de..77370a91f7 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -10,6 +10,19 @@ if not is_windows endif endif +#check if compiler is working with _mm512_extracti64x4_epi64 +#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 +if not is_windows + code = '''#include <immintrin.h> + void test(__m512i zmm){ + __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' + result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking') + if result == false and cc.has_argument('-mno-avx512f') + machine_args += '-mno-avx512f' + warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') + endif +endif + # we require SSE4.2 for DPDK if cc.get_define('__SSE4_2__', args: machine_args) == '' message('SSE 4.2 not enabled by default, explicitly enabling') -- 2.17.1
On Mon, Jul 19, 2021 at 11:34:33PM +0100, Liang Ma wrote: > From: Liang Ma <liangma@bytedance.com> > > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 > > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, > which cause building failure with debug buildtype. > > Therefore, it's helpful to check if compiler work with > _mm512_extracti64x4_epi6. > > This patch check the compiler compile result against the test code > snippet. If the checking is failed then disable avx512. > > Bugzilla ID: 717 > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) > Cc: stable@dpdk.org > > Reported-by: Liang Ma <liangma@liangbit.com> > Signed-off-by: Liang Ma <liangma@bytedance.com> > --- Looks generally ok, but some comments below. > config/x86/meson.build | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/config/x86/meson.build b/config/x86/meson.build > index b9348c44de..77370a91f7 100644 > --- a/config/x86/meson.build > +++ b/config/x86/meson.build > @@ -10,6 +10,19 @@ if not is_windows > endif > endif > > +#check if compiler is working with _mm512_extracti64x4_epi64 > +#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 > +if not is_windows Don't think this is needed here. The reason for it in the previous check for avx512 is because that check is done by a shell script which won't work on windows. Since we use meson functions for this check, it will work anywhere. > + code = '''#include <immintrin.h> > + void test(__m512i zmm){ > + __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' > + result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking') > + if result == false and cc.has_argument('-mno-avx512f') Rather than checking for -mno-avx512f here, the whole block should probably be in an avx512 block itself. If the compiler doesn't have the "-mavx512f" flag, there may be problems with the "cc.compiles" command (or maybe it just counts as an error case?). I'd suggest changing the "is_windows" condition to a cc.has_argument() one for avx512. > + machine_args += '-mno-avx512f' > + warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') > + endif > +endif > + > # we require SSE4.2 for DPDK > if cc.get_define('__SSE4_2__', args: machine_args) == '' > message('SSE 4.2 not enabled by default, explicitly enabling') > -- > 2.17.1 >
From: Liang Ma <liangma@bytedance.com> GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype. Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6. This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512. Bugzilla ID: 717 Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) Cc: stable@dpdk.org Reported-by: Liang Ma <liangma@liangbit.com> Signed-off-by: Liang Ma <liangma@bytedance.com> --- config/x86/meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/x86/meson.build b/config/x86/meson.build index b9348c44de..87b051cd2d 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -10,6 +10,19 @@ if not is_windows endif endif +#check if compiler is working with _mm512_extracti64x4_epi64 +#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 +if cc.has_argument('-mavx512f') + code = '''#include <immintrin.h> + void test(__m512i zmm){ + __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' + result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking') + if result == false + machine_args += '-mno-avx512f' + warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') + endif +endif + # we require SSE4.2 for DPDK if cc.get_define('__SSE4_2__', args: machine_args) == '' message('SSE 4.2 not enabled by default, explicitly enabling') -- 2.17.1
On Tue, Jul 20, 2021 at 11:19:48AM +0100, Bruce Richardson wrote: > On Mon, Jul 19, 2021 at 11:34:33PM +0100, Liang Ma wrote: > > From: Liang Ma <liangma@bytedance.com> > > > > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. > > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 > > > > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, > > which cause building failure with debug buildtype. > > > > Therefore, it's helpful to check if compiler work with > > _mm512_extracti64x4_epi6. > > > > This patch check the compiler compile result against the test code > > snippet. If the checking is failed then disable avx512. > > > > Bugzilla ID: 717 > > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) > > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) > > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) > > Cc: stable@dpdk.org > > > > Reported-by: Liang Ma <liangma@liangbit.com> > > Signed-off-by: Liang Ma <liangma@bytedance.com> > > --- > > Looks generally ok, but some comments below. > > > config/x86/meson.build | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/config/x86/meson.build b/config/x86/meson.build > > index b9348c44de..77370a91f7 100644 > > --- a/config/x86/meson.build > > +++ b/config/x86/meson.build > > @@ -10,6 +10,19 @@ if not is_windows > > endif > > endif > > > > +#check if compiler is working with _mm512_extracti64x4_epi64 > > +#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 > > +if not is_windows > > Don't think this is needed here. The reason for it in the previous check > for avx512 is because that check is done by a shell script which won't work > on windows. Since we use meson functions for this check, it will work > anywhere. > > > + code = '''#include <immintrin.h> > > + void test(__m512i zmm){ > > + __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' > > + result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking') > > + if result == false and cc.has_argument('-mno-avx512f') > > Rather than checking for -mno-avx512f here, the whole block should probably > be in an avx512 block itself. If the compiler doesn't have the "-mavx512f" > flag, there may be problems with the "cc.compiles" command (or maybe it > just counts as an error case?). > > I'd suggest changing the "is_windows" condition to a cc.has_argument() one > for avx512. agree, I will fix that on v3. > > > + machine_args += '-mno-avx512f' > > + warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') > > + endif > > +endif > > + > > # we require SSE4.2 for DPDK > > if cc.get_define('__SSE4_2__', args: machine_args) == '' > > message('SSE 4.2 not enabled by default, explicitly enabling') > > -- > > 2.17.1 > >
On Tue, Jul 20, 2021 at 12:20:59PM +0100, Liang Ma wrote: > From: Liang Ma <liangma@bytedance.com> > > GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. > Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 > > Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, > which cause building failure with debug buildtype. > > Therefore, it's helpful to check if compiler work with > _mm512_extracti64x4_epi6. > > This patch check the compiler compile result against the test code > snippet. If the checking is failed then disable avx512. > > Bugzilla ID: 717 > Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) > Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) > Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) > Cc: stable@dpdk.org > > Reported-by: Liang Ma <liangma@liangbit.com> > Signed-off-by: Liang Ma <liangma@bytedance.com> > --- One minor comment below. Also the commit title needs rewording, since the current title is based on the changes from V1->V2 of your patch. I'd suggest something like: "build: check for broken AVX-512 compiler support" With fixed title: Acked-by: Bruce richardson <bruce.richardson@intel.com> > config/x86/meson.build | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/config/x86/meson.build b/config/x86/meson.build > index b9348c44de..87b051cd2d 100644 > --- a/config/x86/meson.build > +++ b/config/x86/meson.build > @@ -10,6 +10,19 @@ if not is_windows > endif > endif > > +#check if compiler is working with _mm512_extracti64x4_epi64 > +#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 > +if cc.has_argument('-mavx512f') > + code = '''#include <immintrin.h> > + void test(__m512i zmm){ > + __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' > + result = cc.compiles(code, args : '-mavx512f', name : 'avx512 checking') > + if result == false You can get rid of the "result" variable and just do if not cc.compiles(...) It might be a little more readable. > + machine_args += '-mno-avx512f' > + warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') > + endif > +endif > + > # we require SSE4.2 for DPDK > if cc.get_define('__SSE4_2__', args: machine_args) == '' > message('SSE 4.2 not enabled by default, explicitly enabling') > -- > 2.17.1 >
On Tue, Jul 20, 2021 at 12:58:13PM +0100, Bruce Richardson wrote:
> One minor comment below. Also the commit title needs rewording, since the
> current title is based on the changes from V1->V2 of your patch. I'd
> suggest something like:
> "build: check for broken AVX-512 compiler support"
>
> With fixed title:
> Acked-by: Bruce richardson <bruce.richardson@intel.com>
>
Thanks. I will send out V4 to address that.
From: Liang Ma <liangma@bytedance.com> GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64. Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6, which cause building failure with debug buildtype. Therefore, it's helpful to check if compiler work with _mm512_extracti64x4_epi6. This patch check the compiler compile result against the test code snippet. If the checking is failed then disable avx512. Bugzilla ID: 717 Fixes: e6a6a138919f (net/i40e: add AVX512 vector path) Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path) Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path) Cc: stable@dpdk.org Reported-by: Liang Ma <liangma@liangbit.com> Signed-off-by: Liang Ma <liangma@bytedance.com> Acked-by: Bruce richardson <bruce.richardson@intel.com> --- config/x86/meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/x86/meson.build b/config/x86/meson.build index b9348c44de..87b051cd2d 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -10,6 +10,19 @@ if not is_windows endif endif +#check if compiler is working with _mm512_extracti64x4_epi64 +#Ref https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 +if cc.has_argument('-mavx512f') + code = '''#include <immintrin.h> + void test(__m512i zmm){ + __m256i ymm = _mm512_extracti64x4_epi64(zmm, 0);}''' + result = cc.compiles(code, args : '-mavx512f', name : 'AVX512 checking') + if result == false + machine_args += '-mno-avx512f' + warning('Broken _mm512_extracti64x4_epi64, disabling AVX512 support') + endif +endif + # we require SSE4.2 for DPDK if cc.get_define('__SSE4_2__', args: machine_args) == '' message('SSE 4.2 not enabled by default, explicitly enabling') -- 2.17.1
20/07/2021 15:36, Liang Ma:
> From: Liang Ma <liangma@bytedance.com>
>
> GCC 6.3.0 has a known bug which related to _mm512_extracti64x4_epi64.
> Please reference https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
>
> Some DPDK PMD avx512 version heavily use _mm512_extracti64x4_epi6,
> which cause building failure with debug buildtype.
>
> Therefore, it's helpful to check if compiler work with
> _mm512_extracti64x4_epi6.
>
> This patch check the compiler compile result against the test code
> snippet. If the checking is failed then disable avx512.
>
> Bugzilla ID: 717
> Fixes: e6a6a138919f (net/i40e: add AVX512 vector path)
> Fixes: 808a17b3c1e6 (net/ice: add Rx AVX512 offload path)
> Fixes: 4b64ccb328c9 (net/iavf: fix VLAN extraction in AVX512 path)
> Cc: stable@dpdk.org
>
> Reported-by: Liang Ma <liangma@liangbit.com>
> Signed-off-by: Liang Ma <liangma@bytedance.com>
> Acked-by: Bruce richardson <bruce.richardson@intel.com>
Applied, thanks.