From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30065.outbound.protection.outlook.com [40.107.3.65]) by dpdk.org (Postfix) with ESMTP id 136DC7CEB for ; Thu, 6 Dec 2018 10:38:04 +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=+CUQSYokGZ51mJizDtkS7dm7ZF1KhCLinunzEumMstI=; b=tAu5X48pKWWAZvan+w+mrciibhfDgZ8BUsgTG1eu/lhwWII2DqazlDQ5i1N1J+0szNswmT2y2V4Ypxn+WSCUzNPRLQdvkMb8NYhGhqQ2ul7DdMAXGwIFOM7Filf3mfjU2ZOd9V2KPzvi1XaTNuVbjTAJoR3ZDtdklGZhwbbH5TI= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB3459.eurprd05.prod.outlook.com (10.171.187.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Thu, 6 Dec 2018 09:38:03 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::9d0a:b97d:5b24:9961]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::9d0a:b97d:5b24:9961%3]) with mapi id 15.20.1404.020; Thu, 6 Dec 2018 09:38:03 +0000 From: Ori Kam To: Dekel Peled , "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: AQHUi9jOapir3EToT0erK66RQZhIDqVvFwBQgAJJmYCAABZaIA== Date: Thu, 6 Dec 2018 09:38:03 +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=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3459; 6:F+9Yhg9J3TMak0/C3V4Hkx8l75KtZlvLzhO2i4qpgCpyhlCkIoE6oLAyT3yBuuGM5htNGaRMOQgLjxuI1AeCIKk1hVEXCUPDe5Yrhy4xz0gJr5iVzlzH/NBPl7lav7DNSDe4RMD0VXYdj9oEOgO0COAkGm6BS2+TZxMi+EVBHxhHzLFxMiTAC2HiN9I3YMp96oay9tc5ZM/wyMfXUlbra9rRGpda6+DPiB/n7j6jzqmHaKaVW0+ld9tdd+VDXygIjo7Nm60Nl6/Mtco/DpTl5bL1GyLI2R/BgPcAyMEt/PXlDgVDHX4aLvsZz6WcsUFq1FXrSk73rgcIXSi6WZ6OBjDr/tq4xO581BxWr/NO7sUSm4TNtnfx4MZSjE12l7p2JWnHFa0vh3ohjlnupyuGkZQvuP+PbLlJOcuBrw0YIOI9FCStQpzdvHoBC27xc6vyF+x20TQpFHrHFdINCEUFDQ==; 5:h9GIzx81r1RoZAKWMDatOy9yEErCIVdKU6B4/LaPq8kz/KtL5z/yJCNpdr4qmYISAp8iBY2GVxglTRB7TMBq//e2gL3KY6SamFcwNLLPKdO+j4jsg7U/cWrLNygNnua/EPBrU6tMTFAXKI4RFpODki5Sxwc0ONaZkVJIi+cYIQ8=; 7:dLFrY4fJKwKo2XUSvfGjbI/F3Sh6owzhcgxLSP6lsEtKU5IFrlbru107f4AK8lEstJ/iRTeXfo3GmgwG2yJfAHziPKXCG1pSED6vZelfkvrfi3YqHBm6GxKwH0LYHMlaq4qycNEE1CJk7VUj0XgaiA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 717d6961-1c46-4086-7cbe-08d65b5e84c8 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:AM4PR05MB3459; x-ms-traffictypediagnostic: AM4PR05MB3459: 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)(10201501046)(93006095)(93001095)(3002001)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3459; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3459; x-forefront-prvs: 087894CD3C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(396003)(376002)(39860400002)(136003)(199004)(189003)(13464003)(6436002)(102836004)(6506007)(53546011)(256004)(25786009)(14444005)(76176011)(26005)(68736007)(99286004)(7696005)(66066001)(55016002)(4326008)(229853002)(486006)(478600001)(107886003)(6246003)(2201001)(9686003)(11346002)(476003)(86362001)(186003)(14454004)(53936002)(446003)(81156014)(81166006)(5660300001)(8936002)(33656002)(8676002)(74316002)(305945005)(316002)(110136005)(54906003)(97736004)(71190400001)(71200400001)(2501003)(93886005)(2906002)(105586002)(106356001)(3846002)(7736002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3459; H:AM4PR05MB3425.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: uw/sUbvK1YdDj/H62SXdSg2m0lihh0kKUWOdYoMshhIORZlYhk8nSZrfe9nWvFKToboyuLMI/BnvW+KePFGfuRp8bqw0rjjjGNQnBtAWFhFZCPMQdeegJh1AyQuqGJfxxh71/I/wCNnNhUwS8ld0RabP+duhTHllSxNwkyaib1X8KjYRbOOJS76QmiVZenOAUVJ1ZXj3gbuLAkNw/tfTg7Qe9QERV2Yzn9F9hA3Zyk5kMb1TbIB4/3Yn/sw0i6gGslyw8ifzhOaIXt9f8BwcWMroxYEU6yYOim5f4CTD+Fz1zFZC74cZEpbLk5vIuXhg+zgRM61EYir8VOZWvIhAzojgbx3g1FD6QBJNO6ZkB60= 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: 717d6961-1c46-4086-7cbe-08d65b5e84c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2018 09:38:03.1438 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3459 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 09:38:04 -0000 > -----Original Message----- > From: Dekel Peled > Sent: Thursday, December 6, 2018 10:18 AM > To: Ori Kam ; wenzhuo.lu@intel.com; > jingjing.wu@intel.com; bernard.iremonger@intel.com > Cc: dev@dpdk.org; Shahaf Shuler > Subject: RE: [dpdk-dev] [PATCH v2] app/testpmd: fix MPLSoUDP encapsulatio= n >=20 > Thanks, PSB. >=20 > > -----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 > > > > > > > > > -----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 encapsulatio= n > > > > > > 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), > > > > Why did you remove the mask? >=20 > 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 s= et 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 > > > > Best, > > Ori Acked-by: Ori Kam Thanks, Ori