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 77F37A0C43; Tue, 16 Nov 2021 03:32:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70BF740141; Tue, 16 Nov 2021 03:32:19 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id C1F8740040; Tue, 16 Nov 2021 03:32:17 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="257361857" X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="257361857" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 18:32:16 -0800 X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="567014869" Received: from shwdenpg235.ccr.corp.intel.com ([10.253.106.22]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 18:32:14 -0800 From: Alvin Zhang To: qi.z.zhang@intel.com, leyi.rong@intel.com Cc: dev@dpdk.org, Alvin Zhang , stable@dpdk.org Subject: [PATCH v3] net/ice: fix secondary process Rx offload path Date: Tue, 16 Nov 2021 10:32:09 +0800 Message-Id: <20211116023209.18252-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20211115020539.20468-1-alvinx.zhang@intel.com> References: <20211115020539.20468-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Secondary process depends on the vector offload flag to select right Rx offload path. This patch adds a variable in share memory to store the vector offload flag that can be directly read by secondary process. Fixes: 808a17b3c1e6 ("net/ice: add Rx AVX512 offload path") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang --- v3: Modify the patch according to comment. --- drivers/net/ice/ice_ethdev.h | 1 + drivers/net/ice/ice_rxtx.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index 3a5bb9b..f8d0f0c 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -538,6 +538,7 @@ struct ice_adapter { bool rx_use_avx512; bool tx_use_avx2; bool tx_use_avx512; + bool rx_vec_offload_support; #endif }; diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 2d771ea..f6d8564 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -3180,6 +3180,8 @@ rx_check_ret = ice_rx_vec_dev_check(dev); if (ad->ptp_ena) rx_check_ret = -1; + ad->rx_vec_offload_support = + (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH); if (rx_check_ret >= 0 && ad->rx_bulk_alloc_allowed && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { ad->rx_vec_allowed = true; @@ -3215,7 +3217,7 @@ if (dev->data->scattered_rx) { if (ad->rx_use_avx512) { #ifdef CC_AVX512_SUPPORT - if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { + if (ad->rx_vec_offload_support) { PMD_DRV_LOG(NOTICE, "Using AVX512 OFFLOAD Vector Scattered Rx (port %d).", dev->data->port_id); @@ -3230,7 +3232,7 @@ } #endif } else if (ad->rx_use_avx2) { - if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { + if (ad->rx_vec_offload_support) { PMD_DRV_LOG(NOTICE, "Using AVX2 OFFLOAD Vector Scattered Rx (port %d).", dev->data->port_id); @@ -3252,7 +3254,7 @@ } else { if (ad->rx_use_avx512) { #ifdef CC_AVX512_SUPPORT - if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { + if (ad->rx_vec_offload_support) { PMD_DRV_LOG(NOTICE, "Using AVX512 OFFLOAD Vector Rx (port %d).", dev->data->port_id); @@ -3267,7 +3269,7 @@ } #endif } else if (ad->rx_use_avx2) { - if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { + if (ad->rx_vec_offload_support) { PMD_DRV_LOG(NOTICE, "Using AVX2 OFFLOAD Vector Rx (port %d).", dev->data->port_id); -- 1.8.3.1