From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30056.outbound.protection.outlook.com [40.107.3.56]) by dpdk.org (Postfix) with ESMTP id 85BDD1041 for ; Tue, 9 Jan 2018 07:47:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LweVAVDSUd4r2oGj5mOYjHhBdnLPcymFoycimTiISTM=; b=ciES6wsw36QNLf5i0yZwlqVCeyg0YVZulX03TtV8SPvqskU9+u+60SfeZcV8hFYrnyTFOuMXPvWkB6RiOXtPc55xUjMqvZQWS1EbTnO2qjNuhfhb0Z3mhE1fKRNxdkhisjBhjs1WdC9x0bW479FDyvSAuf6A9MkcxSs2UTc3wc4= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB3151.eurprd05.prod.outlook.com (10.170.237.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 06:47:48 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::789c:3f06:bb88:e29c]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::789c:3f06:bb88:e29c%13]) with mapi id 15.20.0386.009; Tue, 9 Jan 2018 06:47:48 +0000 From: Shahaf Shuler To: "Lu, Wenzhuo" , "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: AQHTfi5PlcAuFUYAJ0GqcKAnlfCYXqNrGMaAgAAUHhA= Date: Tue, 9 Jan 2018 06:47:48 +0000 Message-ID: References: <6A0DE07E22DDAD4C9103DF62FEBC09093B70C42F@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B70C42F@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB3151; 7:B8nhWgwr9nnizK7Yy4wWLHlof//rzrqELOBOGnauQ89Lt/zw1Nc1g0zEBm3aWsrL0/SL5slklh7DcWoNqEhTstm1wvmFeZvh6zp7M7IrV1mb1FljkCqovhjiJyjWu8E+c6gaAasS3j0Ngqyp2cjaHix8TUItvoKV/sGbWVJ+PEE+/rXxES6LmHsurCRq1J3tndssrtPTmFnR/JdYTuwUNarH4KIlUxGVTmKi/iZbewQ2q6ubQuFsEd9rQVrmfxzQ x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5941f29e-2712-4ced-d2a5-08d5572ce5ac x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:VI1PR05MB3151; x-ms-traffictypediagnostic: VI1PR05MB3151: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231023)(944501075)(93006095)(93001095)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:VI1PR05MB3151; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3151; x-forefront-prvs: 0547116B72 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(366004)(396003)(39380400002)(199004)(189003)(13464003)(76176011)(8936002)(81156014)(316002)(53936002)(81166006)(14454004)(7696005)(99286004)(6506007)(106356001)(53546011)(110136005)(105586002)(55016002)(3280700002)(4326008)(229853002)(66066001)(93886005)(102836004)(9686003)(2950100002)(6436002)(33656002)(2900100001)(6246003)(305945005)(5660300001)(97736004)(6116002)(3846002)(7736002)(478600001)(3660700001)(25786009)(2906002)(86362001)(74316002)(68736007)(5250100002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3151; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Sk8GtF94rPQkdkXJCBa6/z0hoNlFM0srcZpIWynv5/L/XsikhFIdqkPj2rrpNoKWJDLZzORipJPoOy5b+mkTLQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5941f29e-2712-4ced-d2a5-08d5572ce5ac X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2018 06:47:48.4598 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3151 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 06:47:50 -0000 Hi, Tuesday, January 9, 2018 7:28 AM, Lu, Wenzhuo: > Hi Shahaf, >=20 > > -----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' and = ' > cmd_reconfig_device_queue '. > 1, seems this behavior change is not necessary for using the new offload = API. > Maybe splitting this patch to 2 is better. It is related. Because as part of the offloads API the Tx offloads configur= ation 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 configuratio= n on the flight are the Rx VLAN offloads.=20 As you can see, this API is respected and no need to check the port status = in it > 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 bet= ter. The original code doesn't have such restriction because testpmd wasn't conf= iguring Tx offloads at all. It used it's own Tx offloads enum (which I remo= ved on later patches) to indicate which offloads is set. From the device pe= rspective all the Tx offloads should be set.=20 It did had a way to configure offloads with txqflags parameter, but this re= quired queues reconfigurations.=20