From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00075.outbound.protection.outlook.com [40.107.0.75]) by dpdk.org (Postfix) with ESMTP id F374E1B1F7 for ; Tue, 4 Dec 2018 22:23:30 +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=mNnXKZeMHa98sKES5KVe0GbJ+YjcGyfLLu3kxKM9cZk=; b=Xz5gmpsAH2dRX2neYKtXPswNdTpiD8UTOyE7usdG7l8G0YF0FoeS3bofKA8H1XU2q27uGaUCVNoJGRyF7YZqp1M/3KmJ9S3Y7lVE6LMLWp03vbIpCiY5fojGIBBBeFg4x32XazXCOxj5pmcAG+3B7uyh96pCEwjuRc7ZL6bPL/8= 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:29 +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:29 +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] app/testpmd: fix MPLSoGRE encapsulation Thread-Index: AQHUi9jfFJ8iTDlh/U6kP0U/qzPf6qVvF1LA Date: Tue, 4 Dec 2018 21:23:29 +0000 Message-ID: References: <1543931522-58709-1-git-send-email-dekelp@mellanox.com> In-Reply-To: <1543931522-58709-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:0R4rWNDRhMQpHGP7myFH8lHper+gepCRD7Jiz8oSaP7CX6PBqgjgTZ/E1twG3WqhvbpM1PrzZMlFj97xX/KF402T5yQIUqQ92/ji8/BKTFG0Aa3GJl3/RXyW3r2TM6+YfohB+harJUDjGlCPFmVnt/GvpeNQsbJxhTXjvGm4di9+XhoGHYUeMHnOPf/bFhFsQuFHRswzDR9yoQembByvcbLz45rIipX2DevGpqTgSrMVQhGttOgrISu7o+hG4Vqh9feXVz5MqEYHF7WWsRznpIhkWxYgEBTOPJMyFxyCooOI7t4wRLIWiUx+wEjwdvQkR6Fx/Jos1icvRMC0X5auyCUHu1IMjjTwcBRyl6Nd3L+Ti83Z7wHbVhyveGYEiKxv8RXkK+JVI+xYnk4VdhS3DkYucYUuitjzHeuLejo/Q9ZuugXkC7KJkp5sqO+1I9VGZWGxsMe5SL6+pgsiFR+MXQ==; 5:L78dvGxdUOc1AbhWozRE8WlMjGtCwycYeMoJauHlS6nWZsdRE7U+rYgXlMly5kgg6WfjThKZlEMjcVdSubAIghMcP+Tvt2SCT/2qR0xYmXM82JTn1bVJFA1KDwgpHa4wSQ70P87zMkyzvGlfWzbRm7NiiRRtW+Wtmond7HxLYqw=; 7:TPabGng9HIEHdUyPkN9QMNPaiSGDJHbvZs6wxbk+ZXOuuZXCwXIt5NariITQJUoLhL5S4sQsVf5J3NwtMQ5Wa1k35Hb1dxMajMKVts4VD5DENaC6WwZ7QAzlbVzhP6CxWuWlRwigIh2knhT5jm9T0w== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 99f5ae25-3b8d-4f6a-9e0d-08d65a2ebc4c 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)(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: 4sHn16cUYh50kA6l6US2hKfBM6O618WcwUY1cWpICcoDCxo+5bn12TJjaGk9Hs7TE8EUxnEgoqdcPeI/9vYD7wBBmH5LCw7fuUNmdPDuroSwm1mCWrPkCUR05qAs1EC5JRFk2FUuKzVq9IJN8et2iqYuAADTuB5y6CFIFGIK5ZLeV7YHZf6+lrXiXq2VBbZwj77/kNWFCF7UlTjkc8RcrkjRZhno/CL+hTCqIjv+tJdAfQrm3+05IFU64swaFOfDTzoYrbsMx0j81nFiK7vB9NNl0adR2MOmbODBJD0Zvtiz+ei0W1jZiPWC4b9+ubRDPFVXzgRMtRKvTacMh5DkrqwwvXwLCM95M9Px60h/XyI= 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: 99f5ae25-3b8d-4f6a-9e0d-08d65a2ebc4c X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2018 21:23:29.2256 (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] app/testpmd: fix MPLSoGRE 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:31 -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] app/testpmd: fix MPLSoGRE encapsulation >=20 > In function cmd_set_mplsogre_encap_parsed(), MPLS label value was > set in mplsogre_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 > mplsogre_encap_conf struct, so it is correctly copied to > rte_flow_item_mpls struct. >=20 > Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation") > Cc: orika@mellanox.com >=20 > Signed-off-by: Dekel Peled > --- > 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 8630be6..3ddc3e0 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -15567,10 +15567,9 @@ static void > cmd_set_mplsogre_encap_parsed(void *parsed_result, > struct cmd_set_mplsogre_encap_result *res =3D parsed_result; > union { > uint32_t mplsogre_label; > - uint8_t label[3]; > + uint8_t label[4]; > } id =3D { > - .mplsogre_label =3D > - rte_cpu_to_be_32(res->label) & RTE_BE32(0x00ffffff), > + .mplsogre_label =3D rte_cpu_to_be_32(res->label<<12), Why did you remove the mask? > }; >=20 > if (strcmp(res->mplsogre, "mplsogre_encap") =3D=3D 0) > @@ -15583,7 +15582,7 @@ static void cmd_set_mplsogre_encap_parsed(void > *parsed_result, > mplsogre_encap_conf.select_ipv4 =3D 0; > else > return; > - rte_memcpy(mplsogre_encap_conf.label, &id.label[1], 3); > + rte_memcpy(mplsogre_encap_conf.label, &id.label, 3); > if (mplsogre_encap_conf.select_ipv4) { > IPV4_ADDR_TO_UINT(res->ip_src, > mplsogre_encap_conf.ipv4_src); > IPV4_ADDR_TO_UINT(res->ip_dst, > mplsogre_encap_conf.ipv4_dst); > -- > 1.8.3.1 Best, Ori