From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1109E23C for ; Tue, 1 May 2018 15:24:41 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 May 2018 06:24:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,351,1520924400"; d="scan'208";a="55051341" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga002.jf.intel.com with ESMTP; 01 May 2018 06:24:40 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.214]) by IRSMSX103.ger.corp.intel.com ([169.254.3.179]) with mapi id 14.03.0319.002; Tue, 1 May 2018 14:24:39 +0100 From: "Ananyev, Konstantin" To: "Richardson, Bruce" , "Xing, Beilei" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Yigit, Ferruh" , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix Tx fn selection when using new ethdev offloads Thread-Index: AQHT4UzTvqMYEWLKhUaatuKE2dylBqQa2r+g Date: Tue, 1 May 2018 13:24:39 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258AEDC0D90@irsmsx105.ger.corp.intel.com> References: <20180501130309.39444-1-bruce.richardson@intel.com> In-Reply-To: <20180501130309.39444-1-bruce.richardson@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzhkMGY0ZjYtZmI3ZC00Zjc2LWIxM2ItYjZmN2RjY2MxZjMwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkVuWXVwXC9SZUlsWktnRWhsYkxCT01cL3lLNGRZRHcrUmV0RmZOR215S3lSbz0ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] 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: Tue, 01 May 2018 13:24:42 -0000 Hi Bruce, >=20 > 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. >=20 > Fixes: 7497d3e2f777 ("net/i40e: convert to new Tx offloads API") >=20 > Signed-off-by: Bruce Richardson > --- > drivers/net/i40e/i40e_rxtx.c | 45 +++++++++++++++++++++++---------------= ------ > 1 file changed, 24 insertions(+), 21 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index ec1ce54ca..c523af575 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 >=20 > -#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) >=20 > #ifdef RTE_LIBRTE_IEEE1588 > @@ -70,6 +67,12 @@ > #define I40E_TX_OFFLOAD_NOTSUP_MASK \ > (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) >=20 > +static const uint64_t i40e_simple_ol_mask =3D (DEV_TX_OFFLOAD_MULTI_SEGS= | > + DEV_TX_OFFLOAD_VLAN_INSERT | > + DEV_TX_OFFLOAD_SCTP_CKSUM | > + DEV_TX_OFFLOAD_UDP_CKSUM | > + DEV_TX_OFFLOAD_TCP_CKSUM); > + Seems incomplete. >>From i40e_ethdev.c full-featured tx supports: dev_info->tx_offload_capa =3D DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_QINQ_INSERT | DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM | DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_TX_OFFLOAD_TCP_TSO | DEV_TX_OFFLOAD_VXLAN_TNL_TSO | DEV_TX_OFFLOAD_GRE_TNL_TSO | DEV_TX_OFFLOAD_IPIP_TNL_TSO | DEV_TX_OFFLOAD_GENEVE_TNL_TSO; So we probably need the same here plus multiseg. BTW, it is really strange that we don't have multiseg in tx_offload_capa. Should be present I think. Might be worse to create a new define for it, or just use dev_info->tx_offl= oad_capa directly. Konstantin > static inline void > i40e_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union i40e_rx_desc *r= xdp) > { > @@ -2108,11 +2111,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 +2129,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 & i40e_simple_ol_mask) !=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 +3080,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); >=20 > /* 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 & i40e_simple_ol_mask) =3D=3D= 0 && > + txq->tx_rs_thresh >=3D RTE_PMD_I40E_TX_MAX_BURST); > + ad->tx_vec_allowed =3D (ad->tx_simple_allowed && > + txq->tx_rs_thresh <=3D RTE_I40E_TX_MAX_FREE_BUF_SZ); > + > + if (ad->tx_vec_allowed) > + PMD_INIT_LOG(DEBUG, "Vector Tx can be enabled on Tx queue %u.", > + txq->queue_id); > + else if (ad->tx_simple_allowed) > + PMD_INIT_LOG(DEBUG, "Simple Tx can be enabled on Tx queue %u.", > + txq->queue_id); > + else > + PMD_INIT_LOG(DEBUG, > + "Neither simple nor vector Tx enabled on Tx queue %u\n", > + txq->queue_id); > } >=20 > void __attribute__((cold)) > -- > 2.14.3