From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60084.outbound.protection.outlook.com [40.107.6.84]) by dpdk.org (Postfix) with ESMTP id 39ECF1B1F2 for ; Tue, 4 Dec 2018 22:23:06 +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=1Hn/JaRRWtDYZEhT/FlJKMQm/0oa4NXaZsGactvVhyg=; b=p1dIQPEx+vYto/8G4FmcMyETj9bitt9zN+hhykH3ZAGThSrb2zBzBOTdkBEMgdT7OtuGqKtobB5mOSoatlTtlk+ovxcaxX8pfGli/CdOrjZusxzMCYFYlzM/nLrk24AppWo0opsyla701HDcUSGJlBz21Yio0ESDQCZ0pdGZLn0= Received: from HE1PR05MB3435.eurprd05.prod.outlook.com (10.170.244.25) by HE1PR05MB4571.eurprd05.prod.outlook.com (20.176.163.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Tue, 4 Dec 2018 21:23:04 +0000 Received: from HE1PR05MB3435.eurprd05.prod.outlook.com ([fe80::e1dc:320:5827:e791]) by HE1PR05MB3435.eurprd05.prod.outlook.com ([fe80::e1dc:320:5827:e791%5]) with mapi id 15.20.1382.020; Tue, 4 Dec 2018 21:23:04 +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 , Dekel Peled Thread-Topic: [dpdk-dev] [PATCH v2] app/testpmd: fix MPLSoUDP encapsulation Thread-Index: AQHUi9jOapir3EToT0erK66RQZhIDqVvFwBQ Date: Tue, 4 Dec 2018 21:23:04 +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: <1543931493-58636-1-git-send-email-dekelp@mellanox.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=orika@mellanox.com; x-originating-ip: [37.122.157.255] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR05MB4571; 6:iPmxwEl1eLm/SeQ9v9i9/gFYmJMs3J+w+pEE3yRGHyRSnkBmArIa79VKNC4R1ZHKQKWqlaR07kAu9KhbCVOlLgsmRS0EPNkbLKHrf9mt2xuQO6bGSGgkcn+4Z1s8jTHrdhX21Zm1im0PVVbqpnR9xdoic6J9s+870LKm8QIyJZRVOc4tRSf0UyPJ+0Y+AhbSYNqkPDqsNXF+iCr7h9/Z1U8Zk+/8XQKk5jsiCplywgiQRaZV1RwYR14xdE73Ofr5lC3hG0ieG1iXl+gHrfNngHUkp8nWg/qjU1ldsGdwSNZr6VtMxOnWawoYwWDuRbLdYW3WhGfUyuCABLJAeptEzsuPJMwIhfMKLzQZLOfZD6UNniPT460WMUsB1hIkS00NTfHyoZ0IOArYnEvv9sXZLz23d24V9aeRayzYJlf+FIsjFzIaJF6oN0mcNV01mD+AkQDHjWJqaYZ3ZXf7WchbBQ==; 5:k7WHijhnzN/T9Bi+2+OkipFTBk+cU0omTAAyu2nxj/nZ5RoMU/5UDPtzDNcZPgPzxCr9Lieo3XXe2lHlkn1tpk/JI6It+KI8U+y4i/mDlhkWNQyCWKrgVdrF6FyLyGib3y+V5nDy8Li/+4E2mvNuWNQrMJJ+jWDTYoGmsM/zYuQ=; 7:KRScrFXNFiWoda1I3FyzKY13bO1f9HLiHRnDf8U1X2sj9wQsJVWtL9nJVo+Qe5ACGFWmCjL3UPrPAyxDR0vmcvO1k8U8e0PD4QRaFab09kz3zdRo5fI/31gYlJ1u/wLDH8K0e+uB7HyZvTzqEUxx5A== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: fbe6ff5b-64fc-4928-a1e0-08d65a2ead89 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:HE1PR05MB4571; x-ms-traffictypediagnostic: HE1PR05MB4571: 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)(3002001)(3231455)(999002)(944501493)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:HE1PR05MB4571; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB4571; x-forefront-prvs: 0876988AF0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(366004)(39860400002)(396003)(376002)(199004)(189003)(13464003)(14454004)(81166006)(7696005)(6116002)(6436002)(4326008)(14444005)(2201001)(2906002)(256004)(74316002)(229853002)(5660300001)(6246003)(3846002)(53936002)(305945005)(86362001)(11346002)(9686003)(102836004)(186003)(71190400001)(6506007)(71200400001)(446003)(53546011)(26005)(476003)(7736002)(99286004)(486006)(81156014)(8676002)(76176011)(110136005)(54906003)(107886003)(33656002)(106356001)(55016002)(105586002)(97736004)(2501003)(66066001)(478600001)(68736007)(8936002)(25786009)(316002)(7756004); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB4571; H:HE1PR05MB3435.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: DUpVGI2mKMXQA758p9nOsa5GOArfC92GznO/i7LmHFy/Y1FzTlw96zdCk4jqqzLK5klQO2Qbw09Ybw7IcxMNY1urlzCfO0ADlRnol8vlzDAwRDHVaiA0MjAtJ889CNklavoB/APnZzo1MCULCDjmoRlp3kRPgxNt7YnyPEnHinNqmcN0PT6YYnuWr7AQ6aFrB1YlSPH1VrNgvO2uvUtpipE93T4S8ch7Vs7WyXW84Ztbvh8k0ycJm9lT0lXhigEN8tO9K6y+vMoyt79xaVYh6aiT5hhYMTaTqW2G6YLj43IdCXWHpKuMU/FOAPUkTD2POjPojScQejD7Z1CC8Lgca/Q+DwxGsVJEQy1WdOKcbLc= 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: fbe6ff5b-64fc-4928-a1e0-08d65a2ead89 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2018 21:23:04.3645 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB4571 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: Tue, 04 Dec 2018 21:23:06 -0000 > -----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 >=20 > 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. >=20 > 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. >=20 > Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") > Cc: orika@mellanox.com >=20 > Signed-off-by: Dekel Peled >=20 > --- > v2: Update code fix and elaborate patch log for clarity. > --- > --- > app/test-pmd/cmdline.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) >=20 > 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 > 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