From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40070.outbound.protection.outlook.com [40.107.4.70]) by dpdk.org (Postfix) with ESMTP id A329E235 for ; Tue, 19 Jun 2018 09:09:30 +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=FhsPE1uBbYDFYPiYTy/qmE1xKSSBfSV/L0v5sd892Ig=; b=xHP4iKPkYX/NbsxUWE8WYudXnqHQePkX/v9sCI3SfhjaxpsgaQcTUaYxXR0zqbWP3rlRAvDEydjGwne0h8eYbWzgb3dZOC4yK2MatgLe0+wMVzonzgPH+40U6uU9z2pCNZjFwz9EqyIQz/+nqT543k066RE3rFwdRCRAG7n28WM= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB3364.eurprd05.prod.outlook.com (10.171.187.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.17; Tue, 19 Jun 2018 07:09:28 +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:09:28 +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 1/2] app/testpmd: add VXLAN encap/decap support Thread-Index: AQHUBxHPGpadYKwJI0eq76y6X3vDsqRnKF2w Date: Tue, 19 Jun 2018 07:09:28 +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; AM4PR05MB3364; 7:Tb6R6m1sxMryYCWKAWpK5n/9wABhQ1pbAxT73rmOBvN5eyBECvvOIfV/d73BeGdniOneZLObrEjev5VN63Qc4lYJ+ZSuYjH08hwyXwKH7ADRRXYidlaqDagkHYlDcF2bzQyIbT/M3o1xkCapHdOEXsNLFUZQPIwivgQHROApG8++6mzbirLMuQnr6mr0kAIz11N6eYieZD7vQSecyOc22lfY9vCE5lASPoQXAlZZh+Jn370UmNgt8WTZFnuGuPMd x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 3e959a2c-ba6f-46af-1d33-08d5d5b3990b 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:AM4PR05MB3364; x-ms-traffictypediagnostic: AM4PR05MB3364: 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)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM4PR05MB3364; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3364; x-forefront-prvs: 07083FF734 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(376002)(346002)(366004)(199004)(189003)(13464003)(3846002)(6116002)(229853002)(55016002)(486006)(6436002)(102836004)(7696005)(9686003)(316002)(26005)(186003)(25786009)(99286004)(2900100001)(478600001)(2906002)(3280700002)(97736004)(33656002)(446003)(11346002)(476003)(3660700001)(66066001)(68736007)(6246003)(86362001)(6506007)(305945005)(2501003)(14454004)(5250100002)(53936002)(110136005)(74316002)(8936002)(105586002)(106356001)(76176011)(5660300001)(81166006)(7736002)(81156014)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3364; 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: 8LjCY6KB9VbmPWaH15V4ncwnMGdOwaEeWTKp5iNm+OWlqqLEMsW0Ypnyf0aaoZ+Ez3trPCc1I1+gLpPpyDjuunDW0MAZs1UIWD8cUUZaxOSWg327XeSZOKo8dE+yiYj325WgZFFGTrxaKmxD7U6f/X4Sv5VN1gzANixqyMaWLdXuvK65aHkALwzB08QfG03fcJMDmp4sWHM3I8tvSN+LOCqo5DreFWlxhXxGxFspjSM0K8DAvvD2vEeiJJmwFfhZpyn5eMUr8J+arV+eSO66xMOeVqPOlgiwb8GsskquXv/RQPeNFPAxefaLIR9o8J+RUZ4PK/lDx9urz/0tdN0PzA== 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: 3e959a2c-ba6f-46af-1d33-08d5d5b3990b X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jun 2018 07:09:28.5047 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3364 Subject: Re: [dpdk-dev] [PATCH v3 1/2] app/testpmd: add VXLAN 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:09:30 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro > Signed-off-by: Nelio Laranjeiro > --- > app/test-pmd/cmdline.c | 129 ++++++++++++++++++ > app/test-pmd/cmdline_flow.c | 139 ++++++++++++++++++++ > app/test-pmd/testpmd.c | 17 +++ > app/test-pmd/testpmd.h | 17 +++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 ++ > 5 files changed, 315 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 27e2aa8c8..93573606f 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > +static void cmd_set_vxlan_parsed(void *parsed_result, > + __attribute__((unused)) struct cmdline *cl, > + __attribute__((unused)) void *data) > +{ > + struct cmd_set_vxlan_result *res =3D parsed_result; > + uint32_t vni =3D rte_cpu_to_be_32(res->vni) >> 8; Is this also correct in case of big endian system?=20 I think it will remove part of the vni.=20 > + > + if (strcmp(res->vxlan, "vxlan") =3D=3D 0) > + vxlan_encap_conf.select_vlan =3D 0; > + else if (strcmp(res->vxlan, "vxlan-with-vlan") =3D=3D 0) > + vxlan_encap_conf.select_vlan =3D 1; > + if (strcmp(res->ip_version, "ipv4") =3D=3D 0) > + vxlan_encap_conf.select_ipv4 =3D 1; > + else if (strcmp(res->ip_version, "ipv6") =3D=3D 0) > + vxlan_encap_conf.select_ipv4 =3D 0; > + else > + return; > + memcpy(vxlan_encap_conf.vni, &vni, 3); I don't think this line is correct when running on big endian system. > + vxlan_encap_conf.udp_src =3D rte_cpu_to_be_16(res->udp_src); > + vxlan_encap_conf.udp_dst =3D rte_cpu_to_be_16(res->udp_dst); > + if (vxlan_encap_conf.select_ipv4) { > + IPV4_ADDR_TO_UINT(res->ip_src, > vxlan_encap_conf.ipv4_src); > + IPV4_ADDR_TO_UINT(res->ip_dst, > vxlan_encap_conf.ipv4_dst); > + } else { > + IPV6_ADDR_TO_ARRAY(res->ip_src, > vxlan_encap_conf.ipv6_src); > + IPV6_ADDR_TO_ARRAY(res->ip_dst, > vxlan_encap_conf.ipv6_dst); > + } > + if (vxlan_encap_conf.select_vlan) > + vxlan_encap_conf.vlan_tci =3D rte_cpu_to_be_16(res->tci); > + memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, > + ETHER_ADDR_LEN); > + memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, > + ETHER_ADDR_LEN); > +} >=20 > -- > 2.17.1 Best, Ori