From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EFD2C76186 for ; Wed, 17 Jul 2019 09:18:24 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id E37F420818 for ; Wed, 17 Jul 2019 09:18:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="MCp4tw42" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E37F420818 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD06E1C01; Wed, 17 Jul 2019 11:18:22 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140082.outbound.protection.outlook.com [40.107.14.82]) by dpdk.org (Postfix) with ESMTP id 33B6114E8 for ; Wed, 17 Jul 2019 11:18:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QkbND0Kf379k+hDF8A9i665ztxGMUqOSOlxwPYeLAHTyd4nDVIlOsqFq7YaESMQuki2NWdcW4t4Ebb9YExxs8UiiDL2Shw23cbVtDTiH8/hJ45ICug3rP2NLg2jnPGiqRyrB4xBqaSbr4Jt168vF8IEqN+Lr5CvtR+RhovEmUlSFPZ/+F1jX+2fkVZxK9799notmq3AXMTb45g/Uhu4mWlpW2ee79iW27sT1pcI3xClPGHEgKTgEqISs2p4cbmB2dwiLAZRxUjEyJIinsPRLGHk70WSww5h7t2UxkTUzJOLJurmzbUfRQNd5QgXuLiQEFqMCLfOW5bkVA+PjvuZEhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bpTIy7eHDF5R/k0nxG6UOFoBf2JckrfEW1AAUu90trM=; b=AU9+1/J9F6gHEvYXV/py0xX45I5Jjyu/1NkHdTkglKIn4HwkFGASdHBhtu0mVkF27J3SkOjHbmalxEktT9wCZSMfE1oe4k4bafGgfz/PCo26KgwKA3n7NiK72jgdmu++xd73WWmu0VqrDxhBFhnRUeTS+hd2+12dO+6/X/+N2gjd7P/URPNNieX0alLm78nwmC1uwhwtgzQww1yLgjnvgEjMwjD7BErBukQln2n0pf7HSRksYHax5FIg2LrvT+ydzUyqkBkrNfSswk1cqv7R+WF2ohivi3+1WrjHawkf6wRPBG5ty0UqLdz3HFuXEHf9cXG3z1KwGCl4fQI1LIygLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=mellanox.com;dmarc=pass action=none header.from=mellanox.com;dkim=pass header.d=mellanox.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bpTIy7eHDF5R/k0nxG6UOFoBf2JckrfEW1AAUu90trM=; b=MCp4tw42SvPscB+O9NfiGUhb+M4F4jYeVAWUo31zSIpi7FCoozcsz2cawSjA1G0Ou3YatorX6i/jM/iTZg4mICX4V4k35Fzp38fJU9JIDkObUR35AREkX3dUZuvTGzHxjQD4q1JCU58yP6ABXEDTLV5qgokn1jqwB2LLsu1JDW8= Received: from AM6PR05MB6567.eurprd05.prod.outlook.com (20.179.6.215) by AM6PR05MB5784.eurprd05.prod.outlook.com (20.178.93.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Wed, 17 Jul 2019 09:18:20 +0000 Received: from AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::496b:bd1c:863a:ed47]) by AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::496b:bd1c:863a:ed47%3]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 09:18:20 +0000 From: Jack Min To: Ferruh Yigit CC: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , Adrien Mazarguil , John McNamara , Marko Kovacevic , "dev@dpdk.org" Thread-Topic: [PATCH v3 1/3] app/testpmd: support raw encap/decap actions Thread-Index: AQHVO/28YMBP+/HUFkC47/o7DNH+AabOBKCAgAB0VACAABAqAA== Date: Wed, 17 Jul 2019 09:18:19 +0000 Message-ID: <20190717091810.yoiv76zp2uorewcy@mellanox.com> References: <20190624153736.127968-1-jackmin@mellanox.com> <89bad2e391ed6275fcfc89e43cc27106107bfbd9.1562754908.git.jackmin@mellanox.com> <7dfd0a52-40ca-0d3f-a991-49760c99d3e1@intel.com> <20190717012357.hiw5z3pgn2plgs7l@mellanox.com> <37338111-30bc-349e-e2ca-6eaa73899b68@intel.com> In-Reply-To: <37338111-30bc-349e-e2ca-6eaa73899b68@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0P153CA0037.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::25) To AM6PR05MB6567.eurprd05.prod.outlook.com (2603:10a6:20b:bc::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [139.227.41.236] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 45b7abbb-c861-4ac3-d51f-08d70a97b556 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM6PR05MB5784; x-ms-traffictypediagnostic: AM6PR05MB5784: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2733; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(376002)(346002)(366004)(136003)(396003)(189003)(199004)(66556008)(66476007)(66946007)(53936002)(64756008)(66446008)(186003)(305945005)(6916009)(2906002)(14454004)(26005)(52116002)(386003)(53546011)(6506007)(102836004)(76176011)(6306002)(4326008)(6246003)(71200400001)(71190400001)(6512007)(446003)(14444005)(256004)(7736002)(5660300002)(1076003)(229853002)(8676002)(11346002)(54906003)(6436002)(81156014)(6116002)(3846002)(8936002)(66066001)(86362001)(81166006)(486006)(68736007)(6486002)(99286004)(25786009)(36756003)(2616005)(476003)(45080400002)(478600001)(966005)(316002)(21314003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB5784; H:AM6PR05MB6567.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9fw2Qu3R0EX8mScH8aAUceE9j2Bfx8CzQcHmQG+gVat9zdfP94r1H4mf6O2SWuNhT7PmoP1PEUv2IRnw59gQyD7migT+kGsFnO1fFZJ3mfco+V0CruhKo/C97KtnNhwL6qMTWN+POIQZ8tJOSumdWzNe014znrD4CEYuAwVG0hkrI+ztIskCxUumDImCEvjTN2/lp1lHvykN7jf3Sir8hBacNFNmJlvTacvfkHE90P0/kV0Gpq3etSo8EwzPe8rWmJdZ3/LJfEr9epyTNdm9Jqy5WHexqNxxQnCCoRE0tTUiZ7+nc02U65GfHjxt9uW03bqIU+cDLusbdDAoSzxY5xPx5claWrDTzZ4UAAcmcqZ4pEYNx+QiALF0eddli+t8YSLI6pXkQiiztyUpae0r4HlQtDSO14obP/31hZiIsTc= Content-Type: text/plain; charset="us-ascii" Content-ID: <6D52BF309F5FD5458DCB812365B6C566@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45b7abbb-c861-4ac3-d51f-08d70a97b556 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 09:18:19.9318 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jackmin@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5784 Subject: Re: [dpdk-dev] [PATCH v3 1/3] app/testpmd: support raw encap/decap actions 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 19-07-17, 09:20, Ferruh Yigit wrote: > On 7/17/2019 2:24 AM, Jack Min wrote: > > On Tue, 19-07-16, 18:41, Ferruh Yigit wrote: > >> On 7/10/2019 11:43 AM, Xiaoyu Min wrote: > >>> This patch intend to support > >>> action_raw_encap/decap [1] in a generic and convenient way. > >>> > >>> Two new commands - set raw_encap, set raw_decap are introduced just > >>> like the other commands for encap/decap, i.e. set vxlan. > >>> > >>> These two commands have corresponding global buffers > >>> which can be used by PMD as the input buffer for raw encap/decap. > >>> > >>> The commands use the rte_flow pattern syntax to help user build the > >>> raw buffer in a convenient way. > >>> > >>> A common way to use it: > >>> > >>> - encap matched egress packet with VxLAN tunnel: > >>> testpmd> set raw_encap eth src is 10:11:22:33:44:55 / vlan tci is 1 > >>> inner_type is 0x0800 / ipv4 / udp dst is 4789 / vxlan vni > >>> is 2 / end_set > >>> testpmd> flow create 0 egress pattern eth / ipv4 / end actions > >>> raw_encap / end > >>> > >>> - decap l2 header and encap GRE tunnel on matched egress packet: > >>> testpmd> set raw_decap eth / end_set > >>> testpmd> set raw_encap eth dst is 10:22:33:44:55:66 / ipv4 / gre > >>> protocol is 0x0800 / end_set > >>> testpmd> flow create 0 egress pattern eth / ipv4 / end actions > >>> raw_decap / raw_encap / end > >>> > >>> - decap VxLAN tunnel and encap l2 header on matched ingress packet: > >>> testpmd> set raw_encap eth src is 10:11:22:33:44:55 type is 0x0800 / > >>> end_set > >>> testpmd> set raw_decap eth / ipv4 / udp / vxlan / end_set > >>> testpmd> flow create 0 ingress pattern eth / ipv4 / udp dst is 250 / > >>> vxlan vni is 0x1234 / ipv4 / end actions raw_decap / > >>> raw_encap / queue index 1 / mark id 0x1234 / end > >>> > >>> [1] https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%= 2Fmails.dpdk.org%2Farchives%2Fdev%2F2018-October%2F116092.html&data=3D0= 2%7C01%7Cjackmin%40mellanox.com%7Ccb867ef4cba547d520df08d70a8f9d5a%7Ca65297= 1c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636989484261316617&sdata=3DZcoz%2B= zRbjQdOTZCpBKpjsME7Kzd3onG%2BTwG%2BgskmDC0%3D&reserved=3D0 > >>> > >>> Signed-off-by: Xiaoyu Min > >>> --- > >>> app/test-pmd/cmdline.c | 7 + > >>> app/test-pmd/cmdline_flow.c | 535 ++++++++++++++++++= +- > >>> app/test-pmd/testpmd.h | 2 + > >>> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 48 ++ > >>> 4 files changed, 591 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > >>> index 01dd45f27c..69c5d9e8f6 100644 > >>> --- a/app/test-pmd/cmdline.c > >>> +++ b/app/test-pmd/cmdline.c > >>> @@ -760,6 +760,12 @@ static void cmd_help_long_parsed(void *parsed_re= sult, > >>> " eth-src (eth-src) eth-dst (eth-dst)\n" > >>> " Configure the NVGRE encapsulation for flows.\n\n" > >>> =20 > >>> + "raw_encap {flow items}" > >>> + " Configure the encapsulation with raw data.\n\n" > >>> + > >>> + "raw_decap {flow items}" > >>> + " Configure the decapsulation with raw data.\n\n" > >>> + > >>> , list_pkt_forwarding_modes() > >>> ); > >>> } > >> > >> I think the exact command is "set raw_encap {flow items}" && "set raw_= decap > >> {flow items}", > > Yes, this is the exact one. I'll update it. > >=20 > >> also can you please move them "filters" section, from current > >> "config" section? > > Sorry, I don't understand. Why "set raw_encap/ set raw_decap" should > > belong to the "filter" setion? > > I think these commands are as same as "set vxlan"s which are listed in > > "config" section. Should we, at least, align with them? Or I miss > > something? >=20 > +1 to align with "set vxlan"s (and "set nvgre"s), their logic is same, bu= t I > believe all belongs to "filter" J OK~ > As far as I can see what these commands do is store some input from user = to use > later by 'flow' command. So it doesn't really alters any NIC or testpmd c= onfig > via these set commands. > Would you mind adding a patch to your patchset to move existing ones into > "filter" section first, also they are missing the "set " prefix, can you = add > that too? No, I don't mind.=20 I'll add a patch to move the existing one to "filter" and add "set" prefix. >=20 > And for consistency, "set vxlan"s and "set nvgre" are using "xxx_conf" da= ta > structure to store the input, "set raw_encap" has "struct raw_decap_data"= , does > it make sense to change it to "struct raw_decap_conf"? Make sense. I'll do it. > >=20 > >> > >> Overall these dynamic commands nice from user perspective, thanks to A= drien, but > >> the amount of code it brings and complexity a little worries me for lo= ng term... > > +1 > >> >=20