From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30073.outbound.protection.outlook.com [40.107.3.73]) by dpdk.org (Postfix) with ESMTP id 991E95F1F for ; Thu, 6 Dec 2018 10:38:25 +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=WJiVdeGKbShKumLi7wQO4Ec+/qGE7CVXNKDyybsGLYA=; b=SQTk0bLF1oz5SlCSqTxomAsT2r3wnWOtOORZ3eb2TTZ48UQ58Fh+M/vU65e/Yko5jpS9U+iDAe9c2IJd4lIpTp3ighbTAKe+DiskR+AMBnYYZW8x7+Sm0SN/of2T3Cnr7HUvl6YQWTcqj3c5JkrO8BJR/+4+WTp61ofcQwD+Ly4= 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:24 +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:24 +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] app/testpmd: fix MPLSoGRE encapsulation Thread-Index: AQHUi9jfFJ8iTDlh/U6kP0U/qzPf6qVvF1LAgAJJZwCAABZokA== Date: Thu, 6 Dec 2018 09:38:24 +0000 Message-ID: References: <1543931522-58709-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:9zwd30gl2MPfVvKj/hUZAR8fOYHGiHMe3df+KwG6gT6DrdFjBXMAodT/hpGaOjL5wUD1FWR0KyAo/iIkGcn/4PVBE/FHmQTldW8IhPv11S0qTtp71cL8CZpfi45eOIp90Y1rDVMPqD1uPqfDbtHQXg96AgF7GmtMLLx/h7wsrZNBBgszKypHIqALtdvlsK3gwSPOGWHIZg9Oct1AnFTnK12hkfTEhtTF4TyH3UMromfLzumY/a/x4dAMvqr6gd2lkTRTkzJc1TMoxAbwywhQ/TTqcGJvAshi98RNKXWTfYkHETsN79v7++ZzIsWW1xAIPf8Okd1fq4Xt2qbqA1/1GRQQkzSxS/ZyOQ87ioYNtV09yAugJ7asgTg8qgwMX3+i0sATBMaP+X+BV7vIqR1A3CmMACXQlrqmkBMh0WxFdS2JEJ9KrsfNt/WvFUFhXKm2c7rOa+bM0v9dkJRx0lkoXA==; 5:bxZIbgq9VD3cv+nLr0y37OKvQXSSEFeWiE8SOKTD5d1u6zrtwXJGrq02KBF0Kr7+GlzQx/b5ZRTqvc+gpxwXZxgr2NmsMP8XuabiLOnavhEaZnqI9fE0CQHgNLEsscjkQ2zhyAO9yOspBhkn3lc6Q5U4zbvmKAyRhpauqoAracQ=; 7:WKBYY9Gc8jq1sv2CcadgwPK5q6zWBGRKdQOBuGDvhd22Qk6nJ8WqUJceUYM5aYI7XPo1MuREYJcQU8aEl6sGEW406GOBHI1HSFvMLgXG0W5C6eolXqbVvWh8WE7iR8mEmn6m+8STSQW4M+D90CLySQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: fcd7d2b1-95a7-49e4-6e3c-08d65b5e9196 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)(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)(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: dOMiyepsWRgBfZTz6u8jr/T4K7V42o+9iFDHlhfAb1YbTApV8EFwKOjqHaH7fPeeEe4PbcNR+u57ycUouTX1Wa8xWoVJERXPNnk9TUbCd2ASFKn1faiBE1kLb7NCH1OrUJzFV7o2wBEi6CSIWj4XJDGd36+eti13HprwO+sAop71EMU+2tXfGlTDgn8AK/Q9nQg+0i0UB4X2WL/+yhP7TvOwZOlm9B00bVIRo+u/16QVbaNPUIawq71WDSZ4kVJT5S1LAh4cHwHsmK9PlN7fEhcb3X9N3kDLyMdUB/uWX9DGQ16Ky+aNbmqVT4C8K6ltJBeN+YP47YViXyxo2sKao2V3Rk0lMgW6PeD/I6DG4pI= 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: fcd7d2b1-95a7-49e4-6e3c-08d65b5e9196 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2018 09:38:24.6231 (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] 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: Thu, 06 Dec 2018 09:38:26 -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] app/testpmd: fix MPLSoGRE encapsulation >=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] app/testpmd: fix MPLSoGRE 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] app/testpmd: fix MPLSoGRE encapsulation > > > > > > 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. > > > > > > 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. > > > > > > Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation") > > > Cc: orika@mellanox.com > > > > > > Signed-off-by: Dekel Peled > > > --- > > > 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 > > > 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 > 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->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 Acked-by: Ori Kam Thanks, Ori