From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150072.outbound.protection.outlook.com [40.107.15.72]) by dpdk.org (Postfix) with ESMTP id 22CDE5B3A for ; Thu, 6 Dec 2018 09:17:39 +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:X-MS-Exchange-SenderADCheck; bh=mqb/QymQmiIKoZAq1APnksrWvkcEPHDeJ06b+qZ4sRc=; b=YaD/dDRxhGEy4lqXm6Gq8aJ+PZXTpGzYjuQpIi97Fs3lAKnLvlnNMLPrdCbsvPFzZXHJpPAQO7v5YFbxPzcF4XayomNYcg5xwmzg2f8PUmODLvQBj8htH3EHLsZI04zFKpCCj6x1JQRCX/yBHQWpPrJzRttsXvo3LjDAml8eXmI= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB4959.eurprd05.prod.outlook.com (20.177.51.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.20; Thu, 6 Dec 2018 08:17:37 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f13d:c2e7:1972:4e51]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f13d:c2e7:1972:4e51%5]) with mapi id 15.20.1404.021; Thu, 6 Dec 2018 08:17:37 +0000 From: Dekel Peled To: Ori Kam , "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" CC: "dev@dpdk.org" , Shahaf Shuler Thread-Topic: [dpdk-dev] [PATCH v2] app/testpmd: fix MPLSoUDP encapsulation Thread-Index: AQHUi9jTFrfz7csrl0y0OdLSIkvMX6VvF2MAgAJAgzA= Date: Thu, 6 Dec 2018 08:17:37 +0000 Message-ID: References: <1542646490-37406-1-git-send-email-dekelp@mellanox.com> <1543931493-58636-1-git-send-email-dekelp@mellanox.com> In-Reply-To: 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=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB4959; 6:LQmY1KUdWLDe++CddoA9TNJXfgESxi0NJ7h7uoCXvLpNK6Tt4Jpr9UkDds2bNuwPv+0/WUqNOo9zjtqwLTUnxBGO98jXgzB8wMkSbgpMRJCRGjZg4FeM67Z3EwddZoJ9SNkPeBCZQ8YWylhcKiVh2k5+bflv7NpL6rIxYnc76a8Flyamg0H+XCZZyI2DC9HLyYlGGlg0E6CcW6JtxCmy+iPDgyOjDwCzVzrNkjmFFy1mI6hJdrv5Y0LSEMU5DmNa8A5NyX/NLvDfnIsaV/l+mZb3fBod2QzerCu6O+VbR3h6hU62xL7GGsNHWtERzw4PBVKq1EBLJzpCTAHzDwdxuEGFyX9EgZvV4+NiOQ4koHo/mhDrCUUsOC5jMwa1uqyyL3VZttK8UP7LsA4SsytnFoC0RbM++Ue5rxzoUEHiBsNC34XNB/cGvtYSALpIga4sEv14u1NvlSmLaBb2ZJ+sCA==; 5:l1lSxPZV2ulky7FGn5HWJiePslp9vXyqJh19DFMRjyu1JauqJoTzjbYFjDf5R5MPT0o8Z13NR5dphBpz3TrfED3f0ayOGLlvDzJiJyJFVfSG9iXtk3Br7CJAWx5kQbkX8G15Jp5X6cnemydclMwizlyn9oOUGkbzQDedUuSnuFs=; 7:GPaZ8Heshr71m02hpyrO7+idcwgNgLVzUZSMz3JLIJNGKyIUqoB/fRjGlOPULlN+4ukLZI9pswZR80s/wSGC6nWJVBAwIQaCtA2e8QmKejLBlfyRNpWtXVXVzCNhLpfJiP+gm3UPL/484Gz47HFcKw== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 94efb381-e445-472b-29b0-08d65b53484a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4959; x-ms-traffictypediagnostic: VI1PR05MB4959: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231455)(999002)(944501520)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB4959; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4959; x-forefront-prvs: 087894CD3C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(136003)(366004)(396003)(376002)(199004)(189003)(13464003)(66066001)(305945005)(74316002)(11346002)(7736002)(486006)(476003)(5660300001)(446003)(2201001)(2906002)(86362001)(106356001)(229853002)(105586002)(6436002)(33656002)(14444005)(256004)(68736007)(76176011)(6506007)(97736004)(53546011)(26005)(6116002)(3846002)(102836004)(9686003)(55016002)(7696005)(71190400001)(186003)(8936002)(14454004)(71200400001)(478600001)(2501003)(316002)(54906003)(110136005)(8676002)(81166006)(4326008)(81156014)(53936002)(6246003)(99286004)(107886003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4959; H:VI1PR05MB4224.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: WE19RRMkKwYjhp25P1vV9mRRMXWssWNrTpJd9SAdfeu2wc6cqAuJBVojaXt61Pbz1sfB+P5vnMs8rg6Mgdo0DPjQUSo7DEeQhmQdECZSZu58RFYcLNVrPIhFPnVUDxZe1n4N/gtgMy7rWZZqeLwknKIN80wDqP1b43UoR1iowzFIiXgITGiX8GFp6xceZARM3LmW0nD53QAGmuaYa7HZIh7j27+Md2Qd+4EfwRhLMl0yw4ZgQVH1NReN3+InxrtJCKJzGqBtnmCuwySPFSjYaV7vV8IdfDI3Kitd4ny4y1/dFu9J+gqb7lHpkgzNU20wzQqNinbDVujRJbIcsAnG7e/vzfZGh9wm9a9EIBm7xeY= 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: 94efb381-e445-472b-29b0-08d65b53484a X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2018 08:17:37.0985 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4959 Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix MPLSoUDP encapsulation 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, 06 Dec 2018 08:17:39 -0000 Thanks, PSB. > -----Original Message----- > From: Ori Kam > Sent: Tuesday, December 4, 2018 11:23 PM > To: Dekel Peled ; wenzhuo.lu@intel.com; > jingjing.wu@intel.com; bernard.iremonger@intel.com > Cc: dev@dpdk.org; Shahaf Shuler ; Dekel Peled > > Subject: RE: [dpdk-dev] [PATCH v2] app/testpmd: fix MPLSoUDP > encapsulation >=20 >=20 >=20 > > -----Original Message----- > > From: dev On Behalf Of Dekel Peled > > Sent: Tuesday, December 4, 2018 3:52 PM > > To: wenzhuo.lu@intel.com; jingjing.wu@intel.com; > > bernard.iremonger@intel.com > > Cc: dev@dpdk.org; Ori Kam ; Shahaf Shuler > > ; Dekel Peled > > Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix MPLSoUDP encapsulation > > > > In function cmd_set_mplsoudp_encap_parsed(), MPLS label value was set > > in mplsoudp_encap_conf struct without the required offset. > > As a result the value was copied incorrectly into rte_flow_item_mpls > > struct. > > > > This patch sets MPLS label value in appropriate location at > > mplsoudp_encap_conf struct, so it is correctly copied to > > rte_flow_item_mpls struct. > > > > Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") > > Cc: orika@mellanox.com > > > > Signed-off-by: Dekel Peled > > > > --- > > v2: Update code fix and elaborate patch log for clarity. > > --- > > --- > > app/test-pmd/cmdline.c | 7 +++---- > > 1 file changed, 3 insertions(+), 4 deletions(-) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > 1275074..8630be6 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -15804,10 +15804,9 @@ static void > > cmd_set_mplsoudp_encap_parsed(void *parsed_result, > > struct cmd_set_mplsoudp_encap_result *res =3D parsed_result; > > union { > > uint32_t mplsoudp_label; > > - uint8_t label[3]; > > + uint8_t label[4]; > > } id =3D { > > - .mplsoudp_label =3D > > - rte_cpu_to_be_32(res->label) & > RTE_BE32(0x00ffffff), > > + .mplsoudp_label =3D rte_cpu_to_be_32(res->label<<12), >=20 > Why did you remove the mask? The mask of all valid bits set to 1 is redundant. After <<12 the 20 valid bits are not changed, and the other 12 bits are set= to 0. >=20 > > }; > > > > if (strcmp(res->mplsoudp, "mplsoudp_encap") =3D=3D 0) @@ -15820,7 > > +15819,7 @@ static void cmd_set_mplsoudp_encap_parsed(void > > *parsed_result, > > mplsoudp_encap_conf.select_ipv4 =3D 0; > > else > > return; > > - rte_memcpy(mplsoudp_encap_conf.label, &id.label[1], 3); > > + rte_memcpy(mplsoudp_encap_conf.label, &id.label, 3); > > mplsoudp_encap_conf.udp_src =3D rte_cpu_to_be_16(res->udp_src); > > mplsoudp_encap_conf.udp_dst =3D rte_cpu_to_be_16(res->udp_dst); > > if (mplsoudp_encap_conf.select_ipv4) { > > -- > > 1.8.3.1 >=20 > Best, > Ori