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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 CC114C76186 for ; Wed, 17 Jul 2019 08:20:24 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 6D0552077C for ; Wed, 17 Jul 2019 08:20:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D0552077C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.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 812961D9E; Wed, 17 Jul 2019 10:20:23 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4B2AC1B53 for ; Wed, 17 Jul 2019 10:20:22 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 01:20:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,273,1559545200"; d="scan'208";a="251424017" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.10]) ([10.237.221.10]) by orsmga001.jf.intel.com with ESMTP; 17 Jul 2019 01:20:17 -0700 To: Jack Min Cc: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , Adrien Mazarguil , John McNamara , Marko Kovacevic , "dev@dpdk.org" References: <20190624153736.127968-1-jackmin@mellanox.com> <89bad2e391ed6275fcfc89e43cc27106107bfbd9.1562754908.git.jackmin@mellanox.com> <7dfd0a52-40ca-0d3f-a991-49760c99d3e1@intel.com> <20190717012357.hiw5z3pgn2plgs7l@mellanox.com> From: Ferruh Yigit Openpgp: preference=signencrypt Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d3+bvy qbL9YnlbPyRvZfnP3pXiKwkRoR1RJwEo2BOf6hxdzTmLRtGtwWzI9MwrUPj6n/ldiD58VAGQ +iR1I/z9UBUN/ZMksElA2D7Jgg7vZ78iKwNnd+vLBD6I61kVrZ45Vjo3r+pPOByUBXOUlxp9 GWEKKIrJ4eogqkVNSixN16VYK7xR+5OUkBYUO+sE6etSxCr7BahMPKxH+XPlZZjKrxciaWQb +dElz3Ab4Opl+ZT/bK2huX+W+NJBEBVzjTkhjSTjcyRdxvS1gwWRuXqAml/sh+KQjPV1PPHF YK5LcqLkle+OKTCa82OvUb7cr+ALxATIZXQkgmn+zFT8UzSS3aiBBohg3BtbTIWy51jNlYdy ezUZ4UxKSsFuUTPt+JjHQBvF7WKbmNGS3fCid5Iag4tWOfZoqiCNzxApkVugltxoc6rG2TyX CmI2rP0mQ0GOsGXA3+3c1MCdQFzdIn/5tLBZyKy4F54UFo35eOX8/g7OaE+xrgY/4bZjpxC1 1pd66AAtKb3aNXpHvIfkVV6NYloo52H+FUE5ZDPNCGD0/btFGPWmWRmkPybzColTy7fmPaGz cBcEEqHK4T0aY4UJmE7Ylvg255Kz7s6wGZe6IR3N0cKNv++O7QARAQABtCVGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBpbnRlbC5jb20+iQJUBBMBCgA+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0a3Tr1g6OWJ6xK8cYbMcoR8NZ7L9ALMeJeuUDQR39+fEeHg/6sQN0P0mv 0sL+//BAJphCzDk8ztbrFw+JaPtgzZpRSM6JhxnY+YMAsatJRXA0WSpYP5zzl7yu/GZJIgsv VQ== Message-ID: <37338111-30bc-349e-e2ca-6eaa73899b68@intel.com> Date: Wed, 17 Jul 2019 09:20:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190717012357.hiw5z3pgn2plgs7l@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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 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=http%3A%2F%2Fmails.dpdk.org%2Farchives%2Fdev%2F2018-October%2F116092.html&data=02%7C01%7Cjackmin%40mellanox.com%7C70ecd953302c47ac8c6a08d70a14dd70%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636988957053156948&sdata=jbpk3oPLW8XQcS1aUxESwVkqaGzzumRObaFwh2%2BAxbA%3D&reserved=0 >>> >>> 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_result, >>> " eth-src (eth-src) eth-dst (eth-dst)\n" >>> " Configure the NVGRE encapsulation for flows.\n\n" >>> >>> + "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. > >> 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? +1 to align with "set vxlan"s (and "set nvgre"s), their logic is same, but I believe all belongs to "filter" J 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 config 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? And for consistency, "set vxlan"s and "set nvgre" are using "xxx_conf" data 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"? > >> >> Overall these dynamic commands nice from user perspective, thanks to Adrien, but >> the amount of code it brings and complexity a little worries me for long term... > +1 >>