patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Liang Ma <liangma@liangbit.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, leyi.rong@intel.com,
	Liang Ma <liangma@bytedance.com>,
	stable@dpdk.org,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Subject: Re: [dpdk-stable] [PATCH v2] build: check AVX512 rather than compiler version
Date: Tue, 20 Jul 2021 12:24:31 +0100	[thread overview]
Message-ID: <20210720112431.GA2625@DESKTOP-POQV63C.localdomain> (raw)
In-Reply-To: <YPajRB2/eDIC2W3g@bricha3-MOBL.ger.corp.intel.com>

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
> > 

  reply	other threads:[~2021-07-20 11:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17 17:08 [dpdk-stable] [PATCH] buildtools: Check GCC version to avoid GCC 6.3.0 avx512 bug Liang Ma
2021-07-17 17:48 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger
2021-07-17 22:13   ` Liang Ma
2021-07-18  1:08     ` Stephen Hemminger
2021-07-18  9:33       ` Liang Ma
2021-07-19  8:38         ` Bruce Richardson
2021-07-19 10:04           ` Liang Ma
2021-07-19 22:34 ` [dpdk-stable] [PATCH v2] build: check AVX512 rather than compiler version Liang Ma
2021-07-20 10:19   ` Bruce Richardson
2021-07-20 11:24     ` Liang Ma [this message]
2021-07-20 11:20 ` [dpdk-stable] [PATCH v3] " Liang Ma
2021-07-20 11:58   ` Bruce Richardson
2021-07-20 13:25     ` Liang Ma
2021-07-20 13:36 ` [dpdk-stable] [PATCH v4] build: check for broken AVX-512 compiler support Liang Ma
2021-07-22 17:58   ` Thomas Monjalon

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=20210720112431.GA2625@DESKTOP-POQV63C.localdomain \
    --to=liangma@liangbit.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=leyi.rong@intel.com \
    --cc=liangma@bytedance.com \
    --cc=stable@dpdk.org \
    /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).