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 962B1A0A02; Fri, 15 Jan 2021 14:37:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 512D11410B0; Fri, 15 Jan 2021 14:37:00 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 136CC1410AF for ; Fri, 15 Jan 2021 14:36:58 +0100 (CET) IronPort-SDR: MroKpZNxGzyPHZ9yLgKj206y2SFcUcVath6N93q+HPjjbdYOQdkGDBfQVe8nHqBK+g0ySy7nQI LeeXPZ5lpqCg== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="263341661" X-IronPort-AV: E=Sophos;i="5.79,349,1602572400"; d="scan'208";a="263341661" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2021 05:36:57 -0800 IronPort-SDR: aMI1zMPj1wGz/kTHXvQZrXLssnA/s9rbYmJn9UqjCSJGXktDsm7aHVAtiZIrdiBdUsa64avpT2 FPMgRkczMlfQ== X-IronPort-AV: E=Sophos;i="5.79,349,1602572400"; d="scan'208";a="382665262" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.221.206]) ([10.213.221.206]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2021 05:36:55 -0800 To: Leyi Rong , qi.z.zhang@intel.com, wenzhuo.lu@intel.com, bruce.richardson@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org References: <20201215021945.103396-1-leyi.rong@intel.com> <20210114063951.2580-1-leyi.rong@intel.com> <20210114063951.2580-2-leyi.rong@intel.com> From: Ferruh Yigit Message-ID: <51abc9ff-a247-cfa5-9a87-15656e424cc4@intel.com> Date: Fri, 15 Jan 2021 13:36:51 +0000 MIME-Version: 1.0 In-Reply-To: <20210114063951.2580-2-leyi.rong@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 1/3] net/i40e: remove devarg use-latest-supported-vec 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 1/14/2021 6:39 AM, Leyi Rong wrote: > As eal parameter --force-max-simd-bitwidth is already introduced, > to make it more clear when setting rx/tx function, remove > devarg use-latest-supported-vec support. > > Signed-off-by: Leyi Rong > Acked-by: Wenzhuo Lu <...> > -static eth_rx_burst_t > -i40e_get_recommend_rx_vec(bool scatter) > +static inline bool > +get_avx_supported(bool request_avx512) > { > -#if defined(RTE_ARCH_X86) && defined(CC_AVX2_SUPPORT) > - /* > - * since AVX frequency can be different to base frequency, limit > - * use of AVX2 version to later plaforms, not all those that could > - * theoretically run it. > - */ > - if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) && > - rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) > - return scatter ? i40e_recv_scattered_pkts_vec_avx2 : > - i40e_recv_pkts_vec_avx2; > +#ifdef RTE_ARCH_X86 > + if (request_avx512) { > + if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 && > + rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && > + rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1) > +#ifdef CC_AVX512_SUPPORT > + return true; > +#else > + PMD_DRV_LOG(NOTICE, > + "AVX512 is not supported in build env"); > + return false; > +#endif > + } else { > + if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256 && > + rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 && > + rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) > +#ifdef CC_AVX2_SUPPORT > + return true; > +#else > + PMD_DRV_LOG(NOTICE, > + "AVX2 is not supported in build env"); > + return false; > #endif > - return scatter ? i40e_recv_scattered_pkts_vec : > - i40e_recv_pkts_vec; > + } > +#endif /* RTE_ARCH_X86 */ > + > + return false; > } This was still causing build error for non x86, becuase of not used 'request_avx512' variable, updated as below in next-net: diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index a4661cdd8377..ce2b0bc12ed9 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -3122,6 +3122,8 @@ get_avx_supported(bool request_avx512) return false; #endif } +#else + RTE_SET_USED(request_avx512); #endif /* RTE_ARCH_X86 */ return false;