From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 20D8916E for ; Wed, 2 May 2018 10:30:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2018 01:30:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,354,1520924400"; d="scan'208";a="36206942" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 02 May 2018 01:30:47 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 May 2018 01:30:47 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 May 2018 01:30:46 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.210]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.240]) with mapi id 14.03.0319.002; Wed, 2 May 2018 16:30:45 +0800 From: "Zhang, Qi Z" To: "Richardson, Bruce" , "Ananyev, Konstantin" CC: "Xing, Beilei" , "dev@dpdk.org" , "Yigit, Ferruh" Thread-Topic: [PATCH v2] net/i40e: fix Tx fn selection when using new ethdev offloads Thread-Index: AQHT4Vau7zQws/TUqE2T68wfE5BmyaQaoYEAgADzywCAAIa64A== Date: Wed, 2 May 2018 08:30:44 +0000 Message-ID: <039ED4275CED7440929022BC67E70611531AB040@SHSMSX103.ccr.corp.intel.com> References: <20180501130309.39444-1-bruce.richardson@intel.com> <20180501141354.13935-1-bruce.richardson@intel.com> <2601191342CEEE43887BDE71AB977258AEDC109B@irsmsx105.ger.corp.intel.com> <20180502082451.GA94280@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20180502082451.GA94280@bricha3-MOBL.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWMzNzliYzktZGE5Yi00NjE0LTgyYjEtNmM3MTljZWEyOTU0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJjRzhZSEdpbjZEcGRUYzl0alVHaXJwVkQ2bzUyd21DYXhSa3pPTmJBMDRkQmZ5d29cL2VSOXJuRlhWV3MxOHJuTyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix Tx fn selection when using new ethdev offloads X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2018 08:30:50 -0000 > -----Original Message----- > From: Richardson, Bruce > Sent: Wednesday, May 2, 2018 4:25 PM > To: Ananyev, Konstantin > Cc: Xing, Beilei ; Zhang, Qi Z ; > dev@dpdk.org; Yigit, Ferruh > Subject: Re: [PATCH v2] net/i40e: fix Tx fn selection when using new ethd= ev > offloads >=20 > On Tue, May 01, 2018 at 06:52:18PM +0100, Ananyev, Konstantin wrote: > > > > > > > -----Original Message----- > > > From: Richardson, Bruce > > > Sent: Tuesday, May 1, 2018 3:14 PM > > > To: Xing, Beilei ; Zhang, Qi Z > > > > > > Cc: dev@dpdk.org; Yigit, Ferruh ; Ananyev, > > > Konstantin ; Richardson, Bruce > > > > > > Subject: [PATCH v2] net/i40e: fix Tx fn selection when using new > > > ethdev offloads > > > > > > The Tx function selection code in the driver only used the older txq > > > flags values to check whether the scalar or vector functions should > > > be used. This caused performance regressions with testpmd io-fwd as > > > the scalar path rather than the vector one was being used in the > > > default case. Fix this by changing the code to take account of new > > > offloads and deleting the defines used for the old ones. > > > > > > Fixes: 7497d3e2f777 ("net/i40e: convert to new Tx offloads API") > > > > > > Signed-off-by: Bruce Richardson > > > --- > > > drivers/net/i40e/i40e_rxtx.c | 39 > > > ++++++++++++++++++--------------------- > > > 1 file changed, 18 insertions(+), 21 deletions(-) > > > > > > diff --git a/drivers/net/i40e/i40e_rxtx.c > > > b/drivers/net/i40e/i40e_rxtx.c index ec1ce54ca..006f5b846 100644 > > > --- a/drivers/net/i40e/i40e_rxtx.c > > > +++ b/drivers/net/i40e/i40e_rxtx.c > > > @@ -40,9 +40,6 @@ > > > /* Base address of the HW descriptor ring should be 128B aligned. */ > > > #define I40E_RING_BASE_ALIGN 128 > > > > > > -#define I40E_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS > | \ > > > - ETH_TXQ_FLAGS_NOOFFLOADS) > > > - > > > #define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | > I40E_TX_DESC_CMD_RS) > > > > > > #ifdef RTE_LIBRTE_IEEE1588 > > > @@ -2108,11 +2105,9 @@ i40e_dev_tx_queue_setup_runtime(struct > rte_eth_dev *dev, > > > dev->data->nb_tx_queues)) { > > > /** > > > * If it is the first queue to setup, > > > - * set all flags to default and call > > > + * set all flags and call > > > * i40e_set_tx_function. > > > */ > > > - ad->tx_simple_allowed =3D true; > > > - ad->tx_vec_allowed =3D true; > > > i40e_set_tx_function_flag(dev, txq); > > > i40e_set_tx_function(dev); > > > return 0; > > > @@ -2128,9 +2123,8 @@ i40e_dev_tx_queue_setup_runtime(struct > rte_eth_dev *dev, > > > } > > > /* check simple tx conflict */ > > > if (ad->tx_simple_allowed) { > > > - if (((txq->txq_flags & I40E_SIMPLE_FLAGS) !=3D > > > - I40E_SIMPLE_FLAGS) || > > > - txq->tx_rs_thresh < RTE_PMD_I40E_TX_MAX_BURST) { > > > + if (txq->offloads !=3D 0 || > > > + txq->tx_rs_thresh < RTE_PMD_I40E_TX_MAX_BURST) > { > > > PMD_DRV_LOG(ERR, "No-simple tx is required."); > > > return -EINVAL; > > > } > > > @@ -3080,18 +3074,21 @@ i40e_set_tx_function_flag(struct > rte_eth_dev *dev, struct i40e_tx_queue *txq) > > > I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > > > > > > /* Use a simple Tx queue (no offloads, no multi segs) if possible *= / > > > - if (((txq->txq_flags & I40E_SIMPLE_FLAGS) =3D=3D I40E_SIMPLE_FLAGS) > > > - && (txq->tx_rs_thresh >=3D RTE_PMD_I40E_TX_MAX_BURST)) { > > > - if (txq->tx_rs_thresh <=3D RTE_I40E_TX_MAX_FREE_BUF_SZ) { > > > - PMD_INIT_LOG(DEBUG, "Vector tx" > > > - " can be enabled on this txq."); > > > - > > > - } else { > > > - ad->tx_vec_allowed =3D false; > > > - } > > > - } else { > > > - ad->tx_simple_allowed =3D false; > > > - } > > > + ad->tx_simple_allowed =3D (txq->offloads =3D=3D 0 && > > > + txq->tx_rs_thresh >=3D RTE_PMD_I40E_TX_MAX_BURST); > > > > Actually after another thought - who setup txq->offloads? > > I did a quick scan, through i40e code and seems no one does. > > So now it seems not possible to enable TX offloads at all. > > Konstantin > > > > BTW, seems like rxq->offloads are not properly initialised too. > > > The offloads value should come from the app, no? This should be a separate issue, I have submit the fix. http://dpdk.org/dev/patchwork/patch/39229/ Regard Qi