From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 312802B96 for ; Thu, 29 Mar 2018 07:52:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2018 22:52:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,375,1517904000"; d="scan'208";a="29826571" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 28 Mar 2018 22:52:52 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Mar 2018 22:52:51 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Mar 2018 22:52:51 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.129]) with mapi id 14.03.0319.002; Thu, 29 Mar 2018 13:51:44 +0800 From: "Zhang, Qi Z" To: "Wu, Yanglong" , "dev@dpdk.org" CC: "Dai, Wei" , "Xing, Beilei" Thread-Topic: [PATCH v2 2/2] net/i40e: convert to new Tx offloads API Thread-Index: AQHTxx8pBsV8QT/gtEezqbJdnoWc5KPmtO/Q Date: Thu, 29 Mar 2018 05:51:43 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153175E05@SHSMSX103.ccr.corp.intel.com> References: <20180302090552.120049-1-yanglong.wu@intel.com> <20180329052655.44220-1-yanglong.wu@intel.com> In-Reply-To: <20180329052655.44220-1-yanglong.wu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 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 2/2] net/i40e: convert to new Tx offloads API 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: Thu, 29 Mar 2018 05:52:54 -0000 > -----Original Message----- > From: Wu, Yanglong > Sent: Thursday, March 29, 2018 1:27 PM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Dai, Wei ; Xin= g, > Beilei ; Wu, Yanglong > Subject: [PATCH v2 2/2] net/i40e: convert to new Tx offloads API I think this is v3, not v2, please keep this correct and always update chan= ge log=20 >=20 >=20 > +static int > +i40e_check_tx_queue_offloads(struct rte_eth_dev *dev, uint64_t > +requested) { > + struct rte_eth_dev_info dev_info; > + uint64_t mandatory =3D dev->data->dev_conf.txmode.offloads; > + uint64_t supported; /* All per port offloads */ > + > + dev->dev_ops->dev_infos_get(dev, &dev_info); > + supported =3D dev_info.tx_offload_capa ^ > dev_info.tx_queue_offload_capa; > + if ((requested & dev_info.tx_queue_offload_capa) !=3D requested) > + return 0; /* requested range check */ I think the fix for rx should also be applied on tx, right? Regards Qi > + return !((mandatory ^ requested) & supported); } > + > int > i40e_dev_tx_queue_setup(struct rte_eth_dev *dev, > uint16_t queue_idx, > @@ -2015,6 +2029,16 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev > *dev, > uint16_t tx_rs_thresh, tx_free_thresh; > uint16_t reg_idx, i, base, bsf, tc_mapping; > int q_offset; > + struct rte_eth_dev_info dev_info; > + > + if (!i40e_check_tx_queue_offloads(dev, tx_conf->offloads)) { > + dev->dev_ops->dev_infos_get(dev, &dev_info); > + PMD_INIT_LOG(ERR, "%p: Tx queue offloads 0x%" PRIx64 > + " don't match port offloads 0x%" PRIx64 > + " or supported offloads 0x%" PRIx64, > + (void *)dev, tx_conf->offloads, > + dev->data->dev_conf.txmode.offloads, > + dev_info.tx_offload_capa); } >=20 > if (hw->mac.type =3D=3D I40E_MAC_VF || hw->mac.type =3D=3D > I40E_MAC_X722_VF) { > vf =3D I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h = index > cb5f8c714..10feec4a2 100644 > --- a/drivers/net/i40e/i40e_rxtx.h > +++ b/drivers/net/i40e/i40e_rxtx.h > @@ -149,6 +149,7 @@ struct i40e_tx_queue { > bool q_set; /**< indicate if tx queue has been configured */ > bool tx_deferred_start; /**< don't start this queue in dev start */ > uint8_t dcb_tc; /**< Traffic class of tx queue */ > + uint64_t offloads; /**< Tx offload flags of DEV_RX_OFFLOAD_* */ > }; >=20 > /** Offload features */ > -- > 2.11.0