From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 822B8A0C48 for ; Tue, 20 Jul 2021 13:58:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73FE440E0F; Tue, 20 Jul 2021 13:58:25 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 36A2E4069F; Tue, 20 Jul 2021 13:58:21 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10050"; a="211279633" X-IronPort-AV: E=Sophos;i="5.84,254,1620716400"; d="scan'208";a="211279633" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2021 04:58:19 -0700 X-IronPort-AV: E=Sophos;i="5.84,254,1620716400"; d="scan'208";a="657510977" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.7.183]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 20 Jul 2021 04:58:17 -0700 Date: Tue, 20 Jul 2021 12:58:13 +0100 From: Bruce Richardson To: Liang Ma Cc: dev@dpdk.org, leyi.rong@intel.com, Liang Ma , stable@dpdk.org, Konstantin Ananyev Message-ID: References: <20210717170830.1736-1-liangma@liangbit.com> <20210720112059.2547-1-liangma@liangbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210720112059.2547-1-liangma@liangbit.com> Subject: Re: [dpdk-stable] [PATCH v3] build: check AVX512 rather than compiler version X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Tue, Jul 20, 2021 at 12:20:59PM +0100, Liang Ma wrote: > From: Liang Ma > > 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 > Signed-off-by: Liang Ma > --- 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 > 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 > + 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 >