From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0051.outbound.protection.outlook.com [104.47.1.51]) by dpdk.org (Postfix) with ESMTP id 68B2414E8 for ; Tue, 19 Jun 2018 09:08:12 +0200 (CEST) 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=vGd9U8WG6uFsOl8ddvg8Fb/Hk8EdRQtDDFQFN+/mz0Q=; b=NFNAKLu8VX/XhG/vH1Vb6IJY9AcDey+RfwA0InsK3FudF52/9bw5ZncbBdYkABzM5xyN+CfgQ33HONQeDD/TBQ4s5JW15wH0da2PtjYNbwfeKfIwkRWM4oZXObuI0tuEMeyBHjzoy8wX8cucSYPCCJUrabUhQoPd5AuIKKwYiwE= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB1908.eurprd05.prod.outlook.com (10.167.91.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.14; Tue, 19 Jun 2018 07:08:10 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::691e:e228:13d0:1714]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::691e:e228:13d0:1714%4]) with mapi id 15.20.0863.016; Tue, 19 Jun 2018 07:08:10 +0000 From: Ori Kam To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= , "dev@dpdk.org" , Adrien Mazarguil , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , Mohammad Abdul Awal Thread-Topic: [dpdk-dev] [PATCH v3 2/2] app/testpmd: add NVGRE encap/decap support Thread-Index: AQHUBxHXOLM3CE2Bz0Oj4N0cm5HwhqRnKSgA Date: Tue, 19 Jun 2018 07:08:10 +0000 Message-ID: References: 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; AM4PR05MB1908; 7:wpH2m164W50VX3xrgTpXDblZLl44Gumlka9x5Q9ltUR3WfYRw9BsDEceLHTbp51jN+s4Y52BRAxWt0vhYr+fmIQzOe8fMIFBCgJJuHVmdwSP7Ro/T+Dm0e0uOUclayVLGIMovc6bCMNinISilPGTDzH9dP4Tp0cFtKPDOi6WKp7xVuw6KeA/NqArXK1G3F+ZSw14Or2/Nfd2rPFZ7aSV31N1W66ngDKS2B1aoy1GK6uDgwoXsiDMEu2sa1CqCtZO x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 4bcbfa15-1719-4f60-70c2-08d5d5b36aa3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB1908; x-ms-traffictypediagnostic: AM4PR05MB1908: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM4PR05MB1908; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1908; x-forefront-prvs: 07083FF734 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(39380400002)(366004)(376002)(13464003)(189003)(199004)(2501003)(68736007)(5250100002)(53936002)(55016002)(316002)(486006)(5660300001)(478600001)(7736002)(305945005)(33656002)(2906002)(6436002)(66066001)(3280700002)(110136005)(3660700001)(86362001)(102836004)(8676002)(6116002)(186003)(6506007)(106356001)(26005)(2900100001)(105586002)(74316002)(3846002)(99286004)(97736004)(76176011)(476003)(8936002)(81166006)(25786009)(6246003)(14454004)(9686003)(229853002)(446003)(11346002)(7696005)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1908; H:AM4PR05MB3425.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: p98HM5cu+A265lWO+7pg64dS5Mu4IJfHHNn9eS1jDkRep4n+MtZR5mykHJjCBZnAJg3ql2XQ6zh5xdtnZesiSS5G4lqCfQzB4H8yzXlZbCPCgxgq0yEnu11BRpkwGonFyO0yFNJT9mDNWXCv0jxPOWgbgEhkgbV2zCQq+J7cy0oZOj0Grde3fm1W0g+8ltkq3noUQmFoQEopRKJz2qrC4Nj/0TBKjeGuFo2Qp+dZg2dLqgb8IrsUky0B+rA/ePf9y5rIh+uEWLXgWQlGk6/c/x3RUu4tCeZR5ie2V2uEwvko5+vEGvpfdO555LLBNwfBqAMZzeuQPZ9dN2nCccKS5w== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bcbfa15-1719-4f60-70c2-08d5d5b36aa3 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jun 2018 07:08:10.6050 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1908 Subject: Re: [dpdk-dev] [PATCH v3 2/2] app/testpmd: add NVGRE encap/decap support 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, 19 Jun 2018 07:08:12 -0000 Small comment, > -----Original Message----- > Signed-off-by: Nelio Laranjeiro > --- > app/test-pmd/cmdline.c | 113 +++++++++++++++++ > app/test-pmd/cmdline_flow.c | 129 ++++++++++++++++++++ > app/test-pmd/testpmd.c | 15 +++ > app/test-pmd/testpmd.h | 15 +++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 14 +++ > 5 files changed, 286 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 93573606f..711914e53 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > + > +static void cmd_set_nvgre_parsed(void *parsed_result, > + __attribute__((unused)) struct cmdline *cl, > + __attribute__((unused)) void *data) > +{ > + struct cmd_set_nvgre_result *res =3D parsed_result; > + uint32_t tni =3D rte_cpu_to_be_32(res->tni) >> 8; Is this also correct in case of big endian system?=20 I think it will remove part of the tni. > + > + if (strcmp(res->nvgre, "nvgre") =3D=3D 0) > + nvgre_encap_conf.select_vlan =3D 0; > + else if (strcmp(res->nvgre, "nvgre-with-vlan") =3D=3D 0) > + nvgre_encap_conf.select_vlan =3D 1; > + if (strcmp(res->ip_version, "ipv4") =3D=3D 0) > + nvgre_encap_conf.select_ipv4 =3D 1; > + else if (strcmp(res->ip_version, "ipv6") =3D=3D 0) > + nvgre_encap_conf.select_ipv4 =3D 0; > + else > + return; > + memcpy(nvgre_encap_conf.tni, &tni, 3); I don't think this will work as expected in big endian system. > + if (nvgre_encap_conf.select_ipv4) { > + IPV4_ADDR_TO_UINT(res->ip_src, > nvgre_encap_conf.ipv4_src); > + IPV4_ADDR_TO_UINT(res->ip_dst, > nvgre_encap_conf.ipv4_dst); > + } else { > + IPV6_ADDR_TO_ARRAY(res->ip_src, > nvgre_encap_conf.ipv6_src); > + IPV6_ADDR_TO_ARRAY(res->ip_dst, > nvgre_encap_conf.ipv6_dst); > + } > + if (nvgre_encap_conf.select_vlan) > + nvgre_encap_conf.vlan_tci =3D rte_cpu_to_be_16(res->tci); > + memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, > + ETHER_ADDR_LEN); > + memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, > + ETHER_ADDR_LEN); > +} > + > -- > 2.17.1 Best, Ori