From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80055.outbound.protection.outlook.com [40.107.8.55]) by dpdk.org (Postfix) with ESMTP id 9DD6A5B3A for ; Thu, 6 Dec 2018 09:18: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=NKJ2uvzjrAVG1E1J6kkRuuL2eEk3np1PUoupiSurFPI=; b=dL2YiHJbmK0GniKN27Re9fPrya/Bix8k5HzKb3qlUd0Bu8w1vF/NI8XMIZcELY+ys5B/FIJodDpr5xVdPZPqo8wXr3K7awaY3qx49kcyzw5p9Tl1e0ZPhY34QmRpaCYc5JiTqsATlDJU0LsPc9wJCuhomcsBkgDtQDOmWfifOtE= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB1216.eurprd05.prod.outlook.com (10.162.15.24) 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 08:18:04 +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:18:04 +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] app/testpmd: fix MPLSoGRE encapsulation Thread-Index: AQHUi9jeUxOpE9kLzE+FI6Zxtk1C96VvF4GAgAJCFuA= Date: Thu, 6 Dec 2018 08:18:04 +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=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB1216; 6:zkvNtDB2Z7bGPChN2oU7E5SA2ti33OrKJC2K+1iHY+B36TcBccyKtoUnK9o0kML1NRyVSZmKjCo/BcnqoCWNAwXh6m5bV/px8PY0AmcYPi+9hHDbHGPfWvKFD8F5HkE7RP0sUN5akc0Xs1PRX7Sx9H+NnlBXi+VotG2s5sDmh+0hOiqUNi4hq7NVkyMeaUgwke1ZVghdfELciySwY/Al9ykIDKNQaDUH14sTF415cKUfB1Q9eacoqKLFuORyE2+T5aFtDSWcI5IwCtABQbkD5t/Dy1fvozagT8vaMYZrIVhao/2zAbxlwgx0thZ+ldOT0UD5fl3YIc0xtNvC2dvrmxvt22HkEvJPYMW1dgNiHVnnA+yfpvp2wmeDNqsoZk67a3P8Py9olXtznPpWkRW3MPh06uneG1nxqiObPPx4cL6Cs4oVcKI4NH6dVLdqTJYNJWB6ELOVcr5r9WGyzOCRaw==; 5:3WEl2CDTOqhbfmn0WrhXllx8DYdurEHYQ9meKH+t0QCsBLFsARv4tQYGfejBlEm/QUd0EqfVn52LHCLDMLYLX4ty1ikvXaiS5yolGXVJPgl+i/bisEpLxRRu/FXcII2Uj6Glo3+x98Dt+HFpXXk3DzDLK39WZqx63fgb7A4E4tY=; 7:gY/FkW08UkxvqspHWbTR+Z/qH4QyL4I9I9+jpc9u9QTeLlbBMJP9Om+Ob0b4niNDP5K9gUnR0b6iWCQ+VQcP1bJX1P5jiwIkWkXa4dDyVjoCiKn0vBJnE25p1eFvAurg2wmmV4ejfGwDjugggyrDmw== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 2e29984d-a969-40f7-59bc-08d65b535876 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:VI1PR05MB1216; x-ms-traffictypediagnostic: VI1PR05MB1216: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231455)(999002)(944501520)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB1216; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1216; x-forefront-prvs: 087894CD3C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(366004)(396003)(376002)(346002)(13464003)(189003)(199004)(8936002)(6506007)(86362001)(97736004)(53546011)(102836004)(26005)(66066001)(68736007)(2201001)(99286004)(81156014)(33656002)(81166006)(106356001)(6116002)(105586002)(3846002)(53936002)(316002)(6246003)(4326008)(107886003)(8676002)(5660300001)(6436002)(478600001)(76176011)(256004)(110136005)(7696005)(71190400001)(229853002)(71200400001)(186003)(14454004)(305945005)(74316002)(55016002)(2906002)(486006)(7736002)(446003)(11346002)(476003)(9686003)(54906003)(2501003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1216; H:VI1PR05MB4224.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Oq0iOpqa2cTR/S7HSbovfdHz7K4/OKk9o6UHvxL8rR32cTx38VbvoF7iE0v3V79J9X60Y0aSmB1ZPjvPLMWZJ/+ajZc0OTSklAOJxEJyq+il6jzstOv0ozBJNBXsjyWZtrKmGBMoL8gj8/j4gCos2sreVbv8kpIlkN5Z3e88z7wImn7xgrUSvhRnwi3blSVhym2InlnyayUYC341LSWB49mwAKSINY+8Uff3gWATHjSwt1umVrlYy+4IqhVqG0AEmrmb9VYUWZFuTfyYWqsg2XdECKm8qBkk6fIMZz5RUuFcE3Q6/Sq2fxsEVgHvYEoR+c4T/mLlIoCEhoikQAmKMBXLniVhwAiVjIRqjbG0FzU= 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: 2e29984d-a969-40f7-59bc-08d65b535876 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2018 08:18:04.3097 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1216 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 08:18:06 -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] app/testpmd: fix MPLSoGRE 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] 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), >=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->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 >=20 > Best, > Ori