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 4657BA0C4C; Wed, 18 Aug 2021 18:38:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 233B741165; Wed, 18 Aug 2021 18:38:55 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 2176C41147; Wed, 18 Aug 2021 18:38:52 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10080"; a="238474731" X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="238474731" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 09:38:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="471597632" Received: from silpixa00399126.ir.intel.com ([10.237.223.29]) by orsmga008.jf.intel.com with ESMTP; 18 Aug 2021 09:38:50 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: brian90013@gmail.com, Bruce Richardson , wenzhuo.lu@intel.com, leyi.rong@intel.com, stable@dpdk.org, Qiming Yang , Qi Zhang Date: Wed, 18 Aug 2021 17:38:16 +0100 Message-Id: <20210818163816.19143-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210818163816.19143-1-bruce.richardson@intel.com> References: <20210818163816.19143-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] net/ice: 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" 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: a4e480de268e ("net/ice: optimize Tx by using AVX512") Fixes: 20daa1c978b7 ("net/ice: fix crash in AVX512") Cc: wenzhuo.lu@intel.com Cc: leyi.rong@intel.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- drivers/net/ice/ice_rxtx_vec_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_rxtx_vec_common.h b/drivers/net/ice/ice_rxtx_vec_common.h index 2d8ef7dc8a..e609a75fc6 100644 --- a/drivers/net/ice/ice_rxtx_vec_common.h +++ b/drivers/net/ice/ice_rxtx_vec_common.h @@ -194,7 +194,7 @@ _ice_tx_queue_release_mbufs_vec(struct ice_tx_queue *txq) */ i = txq->tx_next_dd - txq->tx_rs_thresh + 1; -#ifdef CC_AVX512_SUPPORT +#ifdef __AVX512VL__ struct rte_eth_dev *dev = &rte_eth_devices[txq->vsi->adapter->pf.dev_data->port_id]; if (dev->tx_pkt_burst == ice_xmit_pkts_vec_avx512 || @@ -352,7 +352,7 @@ ice_tx_vec_dev_check_default(struct rte_eth_dev *dev) return result; } -#ifdef CC_AVX2_SUPPORT +#ifdef __AVX2__ static __rte_always_inline void ice_rxq_rearm_common(struct ice_rx_queue *rxq, __rte_unused bool avx512) { @@ -414,7 +414,7 @@ ice_rxq_rearm_common(struct ice_rx_queue *rxq, __rte_unused bool avx512) _mm_store_si128((__m128i *)&rxdp++->read, dma_addr1); } #else -#ifdef CC_AVX512_SUPPORT +#ifdef __AVX512VL__ if (avx512) { struct rte_mbuf *mb0, *mb1, *mb2, *mb3; struct rte_mbuf *mb4, *mb5, *mb6, *mb7; -- 2.30.2