From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150050.outbound.protection.outlook.com [40.107.15.50]) by dpdk.org (Postfix) with ESMTP id BEA561B216 for ; Thu, 22 Nov 2018 10:56:11 +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=PP7GlNllN7z149xsqWHuJ/DXEZ84Hh/chvrJYKCSEpg=; b=Vkvp5JW1cenfoYRUdwwHBRkDRWNRsRmHVC3r2R3ua/wYyDUQXE/KnPNRFDi51yyQRxvpvidwF9VlgCkYyG4GkHNnmJkVmDUdqY+L55hFpW8vO9YRWo8WEWgw83YNUNOMboazrinEFNOoNG3SH03QQMF9+wN7HfGg5E/mUqbo2bo= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB4670.eurprd05.prod.outlook.com (20.176.3.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.14; Thu, 22 Nov 2018 09:56:09 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f13d:c2e7:1972:4e51]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f13d:c2e7:1972:4e51%3]) with mapi id 15.20.1361.015; Thu, 22 Nov 2018 09:56:09 +0000 From: Dekel Peled To: Adrien Mazarguil CC: "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" , "dev@dpdk.org" , Ori Kam , Shahaf Shuler Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix MPLSoUDP encapsulation Thread-Index: AQHUgCkfqwAhwYOjj0KKel6jHH3weaVbhHKAgAANBBA= Date: Thu, 22 Nov 2018 09:56:09 +0000 Message-ID: References: <1542646490-37406-1-git-send-email-dekelp@mellanox.com> <20181122090433.GJ17131@6wind.com> In-Reply-To: <20181122090433.GJ17131@6wind.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=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB4670; 6:jZDNRx8miIb97C1btd7tfYgh+wKBjNSOobghQM/kqV0IGUD1qhmn6UGg8AdujS7IcaVtHXXy9+sMPXYMKG+wN3NB/924v+/79q648CLF2pve1wXHtQ6KftgMOwAljTuWWblOzR2GOtKuNPFtXAkYKotNq3n/NG1fNTcIXtOlDDQG6dvjGuZfGmdWSG61mrAdtmQQV4E575mxkjsveZD6arEs0JREqecC7Z4C7Gi4XDtftxkzFaEWkeHR5/6CWg4h1zlBFLrhLOB6X/yz5iNC94jB4DzjkLvhVCsW7SXdW/dvrvr4VMl7EpoFZE0AAYrwTByFp3RQbUC0nRIBCl5jGqkNo/UPvl7Voz/pKWVsL2la2fxoKh3IS1TwrLMyRczZQ9wHChCd0hTKKMl4RHFXXAXwf5Z34GBtwngOoEgHW9mW8wcFK7ihegumXCuOX4MMYuKE7/JdqfyaUBjfgT1YxA==; 5:PaS4EF3nbDDX9nNwAckxwNeAXj+W7VNq0zpVBM+gGAAy8+QWhbJItMIKcaKkSidolQ8+NrEXDtVsGkcKE9BRiBOOdtHN0K6CrV9KMfo72Z2YG1mMydIp6vRp7sFlC/0CquAaZtmekvki/y8Dtet52hAuxee9ahPj1JPUBXSgCfc=; 7:8ghcI25NQsmpF8dVqgK6K2PPtH9ddTL2DAdoJQmtjPfiqA+XRLu+sYuxRY5lyslKPVyEmJEDjqJvPXXFyiq0H3wGuKPaM2PGuF/CDAWTxDUnj2SVdsbIJFE4mYQTpTvZxM9dAPSAAGP95lfBwdgYsA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 0c1d506b-71ce-4781-8d2b-08d65060ba46 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4670; x-ms-traffictypediagnostic: VI1PR05MB4670: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(93006095)(93001095)(3231442)(944501410)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB4670; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4670; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(136003)(376002)(366004)(13464003)(189003)(199004)(74316002)(229853002)(66066001)(8936002)(25786009)(6436002)(81156014)(106356001)(11346002)(105586002)(81166006)(5660300001)(3846002)(6116002)(55016002)(186003)(9686003)(446003)(14454004)(2906002)(8676002)(102836004)(53546011)(6506007)(99286004)(486006)(26005)(476003)(7696005)(76176011)(54906003)(2900100001)(4326008)(68736007)(305945005)(7736002)(316002)(6916009)(97736004)(107886003)(53936002)(33656002)(6246003)(256004)(71200400001)(71190400001)(478600001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4670; 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: 1u7rtm6x2YvOzymIZUKGWi/UN9HScGs92qlYhOnTrv75HASE13u5yPp2P9wX/QjPUT7nvJ1ifHSp9NtOkWQvlIU/Xy7mU5pYavMuhX0u7hW5cPpXfLRphOyB/j8FL+Wi9SfCsdMSFJEc9EfDepiROxthvpd4iwrZmhjrcMNBKFIRib4UD/n6ftJkLAE061CXqcV4Zs1dYytG+mscV3R4gps+PKI/pkpg4YMXPUnT4rT7nmsAnEW2D6H62aepgTmCIngZ2Gmvy1uGKkF9J2wrt2Vr7aCxiWHH1dpRqzqscGuDBcgfHdx79GgDaMr4Jx62wiX59mz5fC2HOVPsRONQzjzb7+gvFQ5WfGmthoPguOw= 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: 0c1d506b-71ce-4781-8d2b-08d65060ba46 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 09:56:09.1147 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4670 Subject: Re: [dpdk-dev] [PATCH] 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, 22 Nov 2018 09:56:12 -0000 Thanks, PSB. > -----Original Message----- > From: Adrien Mazarguil > Sent: Thursday, November 22, 2018 11:05 AM > To: Dekel Peled > Cc: wenzhuo.lu@intel.com; jingjing.wu@intel.com; > bernard.iremonger@intel.com; dev@dpdk.org; Ori Kam > ; Shahaf Shuler > Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix MPLSoUDP encapsulation >=20 > On Mon, Nov 19, 2018 at 06:54:50PM +0200, Dekel Peled wrote: > > Set MPLS label value in appropriate location at mplsoudp_encap_conf, > > so it is correctly copied to rte_flow_item_mpls. > > > > Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") > > Cc: orika@mellanox.com > > > > Signed-off-by: Dekel Peled > > --- > > app/test-pmd/cmdline.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > 1275074..40e64cc 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -15804,10 +15804,10 @@ 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), > > + rte_cpu_to_be_32(res->label<<4) & > RTE_BE32(0x00ffffff), >=20 > Just to be sure, since label is a 20-bit value, isn't the shift supposed = to be 12 > bits? In which case that mask is harmless but misleading. How about: >=20 > .mplsoudp_label =3D rte_cpu_to_be32((res->label & 0xfffff) << 12); >=20 Label is 20-bits value in a 24-bits field, see struct rte_flow_item_mpls. > > }; > > > > if (strcmp(res->mplsoudp, "mplsoudp_encap") =3D=3D 0) > > -- > > 1.8.3.1 > > >=20 > -- > Adrien Mazarguil > 6WIND