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 992B0A0032; Tue, 16 Nov 2021 02:22:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F53340141; Tue, 16 Nov 2021 02:22:06 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 86F7B40040; Tue, 16 Nov 2021 02:22:04 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="220483211" X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="220483211" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 17:22:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="604114294" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga004.jf.intel.com with ESMTP; 15 Nov 2021 17:22:03 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 15 Nov 2021 17:22:02 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 16 Nov 2021 09:21:55 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2242.012; Tue, 16 Nov 2021 09:21:55 +0800 From: "Zhang, Qi Z" To: "Zhang, AlvinX" , "Rong, Leyi" CC: "dev@dpdk.org" , "stable@dpdk.org" Subject: RE: [PATCH v2] net/ice: fix secondary process Rx offload path Thread-Topic: [PATCH v2] net/ice: fix secondary process Rx offload path Thread-Index: AQHX2cVP4GhvUXpjbUu6UNaUo9CPdKwFW20Q Date: Tue, 16 Nov 2021 01:21:54 +0000 Message-ID: References: <20211112054313.20132-1-alvinx.zhang@intel.com> <20211115020539.20468-1-alvinx.zhang@intel.com> In-Reply-To: <20211115020539.20468-1-alvinx.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 > -----Original Message----- > From: Zhang, AlvinX > Sent: Monday, November 15, 2021 10:06 AM > To: Zhang, Qi Z ; Rong, Leyi > Cc: dev@dpdk.org; Zhang, AlvinX ; stable@dpdk.org > Subject: [PATCH v2] net/ice: fix secondary process Rx offload path >=20 > Secondary process depends on the vector offload flag to select right Rx o= ffload > path. This patch adds a variable in share memory to store the vector offl= oad > flag that can be directly read by secondary process. >=20 > Fixes: 808a17b3c1e6 ("net/ice: add Rx AVX512 offload path") > Cc: stable@dpdk.org >=20 > Signed-off-by: Alvin Zhang > --- > drivers/net/ice/ice_ethdev.h | 1 + > drivers/net/ice/ice_rxtx.c | 19 +++++++++++-------- > 2 files changed, 12 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h = index > 3a5bb9b..52daae0 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; > + int rx_vec_path; Can we make the type/ name more specific, how about defined as: "bool rx_ve= c_offload_support;" ? Then we can keep most thing unchanged in primary process branch, but only a= dd below , ad->rx_vec_offload_support =3D (rx_check_ret =3D=3D ICE_VECTOR_OFFLOAD_PATH= ); in following branch we can avoid duplicate if (rx_check_ret =3D=3D ICE_VECTOR_OFFLOAD_PATH).. =20 > #endif > }; >=20 > diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c inde= x > 2d771ea..981493e 100644 > --- a/drivers/net/ice/ice_rxtx.c > +++ b/drivers/net/ice/ice_rxtx.c > @@ -3172,15 +3172,14 @@ > #ifdef RTE_ARCH_X86 > struct ice_rx_queue *rxq; > int i; > - int rx_check_ret =3D -1; >=20 > if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) { > ad->rx_use_avx512 =3D false; > ad->rx_use_avx2 =3D false; > - rx_check_ret =3D ice_rx_vec_dev_check(dev); > + ad->rx_vec_path =3D ice_rx_vec_dev_check(dev); > if (ad->ptp_ena) > - rx_check_ret =3D -1; > - if (rx_check_ret >=3D 0 && ad->rx_bulk_alloc_allowed && > + ad->rx_vec_path =3D -1; > + if (ad->rx_vec_path >=3D 0 && ad->rx_bulk_alloc_allowed && > rte_vect_get_max_simd_bitwidth() >=3D RTE_VECT_SIMD_128) { > ad->rx_vec_allowed =3D true; > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { @@ -3215,7 > +3214,8 @@ > if (dev->data->scattered_rx) { > if (ad->rx_use_avx512) { > #ifdef CC_AVX512_SUPPORT > - if (rx_check_ret =3D=3D ICE_VECTOR_OFFLOAD_PATH) { > + if (ad->rx_vec_path =3D=3D > + ICE_VECTOR_OFFLOAD_PATH) { > PMD_DRV_LOG(NOTICE, > "Using AVX512 OFFLOAD Vector Scattered Rx > (port %d).", > dev->data->port_id); > @@ -3230,7 +3230,8 @@ > } > #endif > } else if (ad->rx_use_avx2) { > - if (rx_check_ret =3D=3D ICE_VECTOR_OFFLOAD_PATH) { > + if (ad->rx_vec_path =3D=3D > + ICE_VECTOR_OFFLOAD_PATH) { > PMD_DRV_LOG(NOTICE, > "Using AVX2 OFFLOAD Vector Scattered Rx > (port %d).", > dev->data->port_id); > @@ -3252,7 +3253,8 @@ > } else { > if (ad->rx_use_avx512) { > #ifdef CC_AVX512_SUPPORT > - if (rx_check_ret =3D=3D ICE_VECTOR_OFFLOAD_PATH) { > + if (ad->rx_vec_path =3D=3D > + ICE_VECTOR_OFFLOAD_PATH) { > PMD_DRV_LOG(NOTICE, > "Using AVX512 OFFLOAD Vector Rx (port %d).", > dev->data->port_id); > @@ -3267,7 +3269,8 @@ > } > #endif > } else if (ad->rx_use_avx2) { > - if (rx_check_ret =3D=3D ICE_VECTOR_OFFLOAD_PATH) { > + if (ad->rx_vec_path =3D=3D > + ICE_VECTOR_OFFLOAD_PATH) { > PMD_DRV_LOG(NOTICE, > "Using AVX2 OFFLOAD Vector Rx > (port %d).", > dev->data->port_id); > -- > 1.8.3.1