From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20048.outbound.protection.outlook.com [40.107.2.48]) by dpdk.org (Postfix) with ESMTP id DE9E71B477 for ; Thu, 22 Nov 2018 17: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=+MRkkr7ksFjtWLeZaEKVrOuXglpODvyXrvRiEfG5IIw=; b=RKiuFMrpf2aRfaO94Rq1pFqCuN1Y6k38A+l7pLP0pESPrpe4jxMm7F396Mp0BWg7vRsbwzwzoyGueQjVXT79LBCQlmTODRSpSnIcdpeVwjgd1+Nr6L/uCJ4I6qrS99nRkm5jX0b3GYTY1Lpq8Hj+zKDtlAuTpJDLoul2Tjkg0qA= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB4542.eurprd05.prod.outlook.com (20.176.3.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.16; Thu, 22 Nov 2018 16: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%3]) with mapi id 15.20.1361.015; Thu, 22 Nov 2018 16:18:04 +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 , "Yigit, Ferruh" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix MPLSoUDP encapsulation Thread-Index: AQHUgCkfqwAhwYOjj0KKel6jHH3weaVbhHKAgAANBBCAAAZ8gIAAZQOA Date: Thu, 22 Nov 2018 16:18:04 +0000 Message-ID: References: <1542646490-37406-1-git-send-email-dekelp@mellanox.com> <20181122090433.GJ17131@6wind.com> <20181122101421.GK17131@6wind.com> In-Reply-To: <20181122101421.GK17131@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; VI1PR05MB4542; 6:oayr7xGQHTO8zAE6CiSBenKpxP9m6wfmNbHSlF+ay3ENa3IDcooyfy6X8whPQx+hzRNO7byY3YsGn4cW62dy3eBzFhcLjIJAbQVARRgRZgOeaOcAN4WybfUPSi7p9VFpAqy5QCygg9t/xXW6k02W+MXrC/cVo0Amf6c2+Vn5hOErF6d4LRuYxAi06ghlhLAprSOlNtj5K7Md9k9O/DlyVNmcCUtl8PwMf87XLD6ylVaGAkg+arxgE2wYXswgClQ1uBNaNnwLL32GrAmAXyN0RbbOaF7RYG7aYrRZjm1TeOl4mMWAWNhEgJ4Yj4zUnH78eXxvHQzqZI2YqYOrTNvMRi4W63PgU9Oc9lPfi6U+uamx3aFblO3i549FDr8KsTUGZ5W5BDj8hkThIphvJhfKgQgfBO2aKr5eHfjOK3meKN+pj6uaetmU6/SjQOgQmGw2KwAK6XAWAVvSNekwI0aEMQ==; 5:fho1BsWhaTCPJ7ysF7aVXuNb/lfIM78CRm68MfhjtFaKiwbROzhnh6kiW9j0uLlRg4vZJHH4VUSNMq/QkyYUzh+NkH3cXGKuQfAHvUibAFdVk+JAoGdp87KQSDx5n6TsbfO7h4F9gYGezONlCqsGnYAmbSUHhX/rtsyVAnYHA/M=; 7:dZqB2v1TlMz4om2EWJs0nKG1OukDRj1R3ow7EnS5u5UrnIDZbUBsj1IFxASIuom3S+22TiZFegW/eGNfClNnie6hKz2pLatYwyR0/wC6z4bX8Ccp1PPDtZHCH8xjLi8VV3vTPYaurtRJLtXE81qDXA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 4f60d6ee-2e21-4339-bdfc-08d6509614ab 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:VI1PR05MB4542; x-ms-traffictypediagnostic: VI1PR05MB4542: 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)(3002001)(3231442)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB4542; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4542; x-forefront-prvs: 0864A36BBF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(39860400002)(136003)(376002)(13464003)(199004)(189003)(5660300001)(102836004)(6506007)(2906002)(53546011)(81156014)(81166006)(8936002)(8676002)(33656002)(478600001)(106356001)(3846002)(97736004)(68736007)(25786009)(6916009)(26005)(6116002)(186003)(229853002)(4326008)(316002)(54906003)(71200400001)(71190400001)(93886005)(6436002)(105586002)(99286004)(14454004)(256004)(74316002)(76176011)(9686003)(55016002)(7696005)(7736002)(14444005)(305945005)(446003)(11346002)(2900100001)(486006)(86362001)(66066001)(476003)(53936002)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4542; H:VI1PR05MB4224.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: ulhXpOGMThS8w92PzHjyDI1Ovk3KqmfjwS0wTFdApwFUdl/lW1wPBD4fert8EubZyZ1Uu8mZUhZavGSniOCAA6tvV5Q9EF+hmDOGHtWzhxkXJ7CM5A0zEGXNTkedRB47GS/91AwIgq4xuAbVm6gp9w6Epgrtk1kxcm6/woJVHa35EoeeZNiYMqMoVeSPQ7tVx9EoaUUrQGuUH8PzP7Cz8ubx7bY8tlKuoJSUbiyssUTX/0U//PlQWO9aJnD01R+LHmJNrG2ZmG8t4O5HlKIo60wxbMH6KskM7UwI6ku71QC5USu7tuIJjvmI+ZbGLfV39twjJLahV/YMU+wP0iaG758vllCP4zkCWC1xjfiDwJ0= 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: 4f60d6ee-2e21-4339-bdfc-08d6509614ab X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2018 16:18:04.1307 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4542 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 16:18:07 -0000 Hi, The current implementation is already validated, and since this is the last= minute I prefer my patch to be applied as-is. Please ack. Regards, Dekel > -----Original Message----- > From: Adrien Mazarguil > Sent: Thursday, November 22, 2018 12:14 PM > 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 Thu, Nov 22, 2018 at 09:56:09AM +0000, Dekel Peled wrote: > > 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 > > > > > > 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_mpl= s. > > > > > > > > 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), > > > > > > 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: > > > > > > .mplsoudp_label =3D rte_cpu_to_be32((res->label & 0xfffff) << 12); > > > > > > > Label is 20-bits value in a 24-bits field, see struct rte_flow_item_mpl= s. >=20 > OK, I know, what I missed was the following line: >=20 > rte_memcpy(mplsoudp_encap_conf.label, &id.label[1], 3); >=20 > Just a suggestion then: using the same memcpy() offsets in both places fo= r > clarity: >=20 > rte_be32_t label =3D rte_cpu_to_be32(res->label << 12); >=20 > memcpy(mplsodudp_encap_conf.label, &label, 3); >=20 > -- > Adrien Mazarguil > 6WIND