From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 195921B01E for ; Tue, 9 Jan 2018 08:14:00 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 23:13:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,334,1511856000"; d="scan'208";a="20087494" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 08 Jan 2018 23:13:59 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 23:13:59 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 23:13:59 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Tue, 9 Jan 2018 15:13:56 +0800 From: "Lu, Wenzhuo" To: Shahaf Shuler , "Wu, Jingjing" , "Yigit, Ferruh" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 04/10] app/testpmd: convert to new Ethdev Tx offloads API Thread-Index: AQHTfi5U+ewllJ8umUG0NKuYsrNbl6NrFnag//+SlgCAAIyMsA== Date: Tue, 9 Jan 2018 07:13:56 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B70C530@shsmsx102.ccr.corp.intel.com> References: <6A0DE07E22DDAD4C9103DF62FEBC09093B70C42F@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v3 04/10] app/testpmd: convert to new Ethdev 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: Tue, 09 Jan 2018 07:14:01 -0000 Hi Shahaf, > -----Original Message----- > From: Shahaf Shuler [mailto:shahafs@mellanox.com] > Sent: Tuesday, January 9, 2018 2:48 PM > To: Lu, Wenzhuo ; Wu, Jingjing > ; Yigit, Ferruh > Cc: dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v3 04/10] app/testpmd: convert to new > Ethdev Tx offloads API >=20 > Hi, >=20 > Tuesday, January 9, 2018 7:28 AM, Lu, Wenzhuo: > > Hi Shahaf, > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shahaf Shuler > > > Sent: Tuesday, December 26, 2017 5:44 PM > > > To: Wu, Jingjing ; Yigit, Ferruh > > > > > > Cc: dev@dpdk.org > > > Subject: [dpdk-dev] [PATCH v3 04/10] app/testpmd: convert to new > > > Ethdev Tx offloads API > > > > > > Ethdev Tx offloads API has changed since: > > > > > > commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") > > > > > > Convert the application to use the new API. > > > > > > This patch mandates the port to be stopped when configure the Tx > > offloads. > > > This is because the PMD must be aware to the offloads changes on the > > > device and queue configuration. > > > > > > Signed-off-by: Shahaf Shuler > > > --- > > > app/test-pmd/cmdline.c | 90 > > > ++++++++++++++++++++++++++++++++++++++++++--- > > > app/test-pmd/config.c | 55 ++++++++++++++++++--------- app/test- > > > pmd/testpmd.c | 3 ++ > > > 3 files changed, 124 insertions(+), 24 deletions(-) > > > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > > d8c73a9b1..58125839a 100644 > > > --- a/app/test-pmd/cmdline.c > > > +++ b/app/test-pmd/cmdline.c > > > @@ -3439,7 +3439,14 @@ cmd_tx_vlan_set_parsed(void *parsed_result, > > { > > > struct cmd_tx_vlan_set_result *res =3D parsed_result; > > > > > > + if (!port_is_stopped(res->port_id)) { > > > + printf("Please stop port %d first\n", res->port_id); > > > + return; > > > + } > > > + > > > tx_vlan_set(res->port_id, res->vlan_id); > > > + > > > + cmd_reconfig_device_queue(res->port_id, 1, 1); > > > } > > > > > I do have some concern about this behavior change, 'port_is_stopped' an= d > ' > > cmd_reconfig_device_queue '. > > 1, seems this behavior change is not necessary for using the new offloa= d > API. > > Maybe splitting this patch to 2 is better. >=20 > It is related. Because as part of the offloads API the Tx offloads config= uration > is set on the rte_eth_dev_configure. To configure a device it must be > stopped in advance. >=20 > Also, per my understanding, the only API which allows offloads configurat= ion > on the flight are the Rx VLAN offloads. > As you can see, this API is respected and no need to check the port statu= s in > it >=20 > > 2, some NICs doesn't need to be stopped or re-configured to make vlan > > functions enabled. >=20 > Only for the Rx vlan. The Tx vlan insert is not configured on the flight. >=20 > That's why the original code doesn't have this restriction. > > Maybe figuring out a way to do the restriction in the driver layer is b= etter. >=20 > The original code doesn't have such restriction because testpmd wasn't > configuring Tx offloads at all. It used it's own Tx offloads enum (which = I > removed on later patches) to indicate which offloads is set. From the dev= ice > perspective all the Tx offloads should be set. > It did had a way to configure offloads with txqflags parameter, but this > required queues reconfigurations. ' cmd_tx_vlan_set_parsed' is the function which configures TX vlan insertio= n. This patch adds the restriction in it. For example, on ixgbe it does support on the fly configuration. APP doesn't= need to stop the device or reconfigure the queues.