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 9986BA0C4C; Wed, 18 Aug 2021 18:42:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 247DE410F2; Wed, 18 Aug 2021 18:42:58 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 1D0BD4069E for ; Wed, 18 Aug 2021 18:42:55 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10080"; a="203568672" X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="203568672" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 09:42:54 -0700 X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="678642140" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.20.72]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 18 Aug 2021 09:42:52 -0700 Date: Wed, 18 Aug 2021 17:42:49 +0100 From: Bruce Richardson To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, Beilei Xing Message-ID: References: <20210818163816.19143-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210818163816.19143-1-bruce.richardson@intel.com> Subject: Re: [dpdk-dev] [PATCH 1/2] net/i40e: fix generic build on FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Aug 18, 2021 at 05:38:15PM +0100, Bruce Richardson wrote: > The common header file for vectorization is included in multiple files, > and so must use macros for the current compilation unit, rather than the > compiler-capability flag set for the whole driver. With the current, > incorrect, macro, the AVX512 or AVX2 flags may be set when compiling up > SSE code, leading to compilation errors. Changing from "CC_AVX*_SUPPORT" > to the compiler-defined "__AVX*__" macros fixes this issue. > > Bugzilla ID: 788 > Fixes: 0604b1f2208f ("net/i40e: fix crash in AVX512") > Cc: wenzhuo.lu@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Bruce Richardson > --- > drivers/net/i40e/i40e_rxtx_vec_common.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h > index f52ed98d62..65715ed1ce 100644 > --- a/drivers/net/i40e/i40e_rxtx_vec_common.h > +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h > @@ -268,7 +268,7 @@ i40e_rx_vec_dev_conf_condition_check_default(struct rte_eth_dev *dev) > #endif > } > > -#ifdef CC_AVX2_SUPPORT > +#ifdef __AVX2__ > static __rte_always_inline void > i40e_rxq_rearm_common(struct i40e_rx_queue *rxq, __rte_unused bool avx512) > { On a higher-level, I'd suggest we look to remove the use of these macros and AVX code in general from this header file (and ice driver equivalent). IIRC this file was originally meant to contain only the "common" code i.e. the scalar code, to be shared among vector implementations. Having AVX code in this file can lead to these sorts of bugs and just makes the file no longer truely common. The code in question here, should probably go in a "common_avx" header, which means that we can remove the AVX2 conditions from it etc. /Bruce