From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50071.outbound.protection.outlook.com [40.107.5.71]) by dpdk.org (Postfix) with ESMTP id 87322DED for ; Thu, 23 Aug 2018 04:15:55 +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=CcaTJme4eRp7PaKGDUO3OAdmpM+B4RcOcrxdMx3Sojk=; b=cntFSnoSF70qis3T6e2mdk2RySrUOxa84f6ciaR/WRrjYb2Ttsk+i3vnr7sLxI5TBDUHQP2o77XHMw2bpmeSl86hseh/CC/aKUEJmKPh0lJbaj+7U+2+XVOEKu+4rZ5IrUqzZfQDMIGoj8/6CU9UYXIkWavJKWil50I8phkTy4I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; Received: from MTBC-JACKMIN.mtl.com (124.78.143.175) by VI1PR0501MB2031.eurprd05.prod.outlook.com (2603:10a6:800:36::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Thu, 23 Aug 2018 02:15:50 +0000 Date: Thu, 23 Aug 2018 10:15:27 +0800 From: Jack MIN To: Rahul Lakkireddy Cc: "dev@dpdk.org" , Shahaf Shuler , "Xueming(Steven) Li" , Thomas Monjalon , Adrien Mazarguil , Shagun Agarwal , Indranil Choudhury , Nirranjan Kirubaharan Message-ID: <20180823021527.mnmoxg6pug2ojdzv@MTBC-JACKMIN.mtl.com> Mail-Followup-To: Rahul Lakkireddy , "dev@dpdk.org" , Shahaf Shuler , "Xueming(Steven) Li" , Thomas Monjalon , Adrien Mazarguil , Shagun Agarwal , Indranil Choudhury , Nirranjan Kirubaharan References: <20180813100756.GA20111@chelsio.com> <20180814091545.mnkajravotqodpav@MTBC-JACKMIN.mtl.com> <20180821081426.GA4266@chelsio.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180821081426.GA4266@chelsio.com> User-Agent: NeoMutt/20180622 X-Originating-IP: [124.78.143.175] X-ClientProxiedBy: HK0PR03CA0021.apcprd03.prod.outlook.com (2603:1096:203:2e::33) To VI1PR0501MB2031.eurprd05.prod.outlook.com (2603:10a6:800:36::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 432aa30c-bc1d-4c88-6179-08d6089e5a22 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2031; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2031; 3:xHNBY6T/UmaNBax04mDWQ1g4OjpVghRu3PqXXIDz45RZTRALPQ/Jp25UkMUQw94SewnsfvfWHLc64jy1FNiaKziZDFqDp0GlhYslr+sX/XqzzsIf/n1IKlfUwmM/zIHcqip0PGl+/+25vIZQCmqUhbn21/NQ+ekkddLPMHiu+jio9ICAfnUZCO+pZIiXEZfQFqmzmDgxKv0uGsk2elTXa+mGKNsez2N1RSh8RqP5aIpT9Xj/avJVFrwbxNkwzCE1; 25:3S11UlBe4ul0QD6T1mQzE2RjYV4HcwDiyAkThP1K3hLh/T3/8X4Nmn4npsIBXBiNGDIWdsssf3jMDc9wVbZ1ex1Ends04mul9aX/2D1iVKomCgwRIcdwKaNGXJ5wYMa7iPHH9Bl7Oa9fPhR0bnD1BlmUkKEyXJKiyvKPFZ/KABJ6T+LtFJzbC89/TnNBETQxXw9fUtK5GD3QqedVLt35fo+pMf7qKwNjg+Qde+LK3Wh4pM8fLJ+nIFNBzeUQtMkHuV+C6KDXxHGpXhB2S9OPh0RW6sh4bgDPJ9OMh70Pf6CAQYQ/tLE23Jn8lvAMVOF1e35sCIK/LezlBpnkF88htA==; 31:u1lhBP1f9vU+F93d7qb8tCJl+G/H8Jg2qeWXiHacmSS79jwkSktsgfZoENqDQTIx3X7ozifj9jtyZZhG5yXTkIS0tQD51yGzj0EQagepntLCvvMTjanKs/UWfUbi+66fyXoE81flA1zh3p2jSaFVmw8nDwror85ElhI4Kj6ALk+VBVxS/S7ia8p0puXfHeoKIDC0xzPGquGSBTV4o9f1i9oIVei8ootFQm6ckKn3ZTE= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2031: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2031; 20:IjYRtW7do1Fl24dSZVlmBookgR9VBrgkG1SGVk8GZFL45ohVyPIQciSwAXo2D+cqfGVEqGt29CPwq69os01y7mlKZOukHIO9ZEnnkZe4Q+snE1Jopb3bSYjnf3W4/D0GgR70p199EZExFzpmwQgAn8LQgqu6glDJ6uWuMcDzukyLtd8xPkjtcl73CZe3fUjillj8miJBVdN91GXoSKYviNEEQiWqDx5b6oF+ul00N9tsw9CXTUa4tPNjWt293KuLNRNhmAdcZjSMuKUEPbYj+ML75VvL4472uDJ3IDK/6bUiZYHSpV6+iexPbXulANNpnoa5edJwFAJ91d2Xpq7Zc3Vk65BtMXgJKUz85Y3vCq0A4XCFGD1pw12gmmwPAITUsQ+TKlzcOFLE1z6Ksir4vO79qIwjBAY8YVF/dWLfc3s8ha8xwsrMzj/cVTGaQXhzLcGqorasaZfKxJZBdg93E3H+H97l6REsUT58HpxM7TlW7VCc9Pgy6pZShsjBWKwp; 4:+mRIse066OGNbU3s/bgUE0QUVHw0VUK3LAqx5Uy95Zwzj9ZdiVIcMraFzgXZlBq4/KTEQKrW9/YJ5iZQ0yuv/Q1aT3pGJ0LpSutxFj2ohBQiEUym4+rpllTv/pNDOFz4EThsjeiLD3qIcqtW9NOk8Md+o/h6T5PAFXX6j0LKOvuq1BSZgretDf3k1zDbw4ZSCLfzHJgtfJ22ulZPKTuqH7yygiXsfft1s/x/j6JCqmLqp+Z/N9C52S8TbyMQdMKdh9H3DxZFGhd+kvtNgkPNTQ== 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)(5005006)(8121501046)(823301075)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:VI1PR0501MB2031; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2031; X-Forefront-PRVS: 0773BB46AC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(199004)(189003)(9686003)(6506007)(386003)(55016002)(1076002)(23726003)(93886005)(486006)(478600001)(53936002)(11346002)(86362001)(68736007)(8936002)(26005)(14444005)(446003)(16526019)(476003)(186003)(956004)(229853002)(7736002)(305945005)(47776003)(97736004)(25786009)(81166006)(50466002)(81156014)(6116002)(58126008)(3846002)(2906002)(8676002)(66066001)(6666003)(53416004)(16586007)(316002)(6916009)(52116002)(6246003)(4326008)(7696005)(76176011)(5660300001)(105586002)(106356001)(54906003)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2031; H:MTBC-JACKMIN.mtl.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-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2031; 23:CK3QKlPm7DNtuD1wlwiDnrhACJl+OU0duclfPTt?= =?us-ascii?Q?GukORYAd9H050RDUEcvHqPaLipTMHF8dYG4NBPp3SEr9gJDhV7bflnlPdzC1?= =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mw++v9cBiSPyBCUlpmHWSa1rjpeG6tZn6yCufCK0V2bVZPSkdjAIokgWPj9SQ8Z072F8UFKEt9DSYFT0Ar9xwnWn3Lg2wDTAXvcV2g5867ieu2zUWMCnMdQn+5ZuM+j8SJMNoXAe+elIvCWFQZsEXZ1nMVC9YgMYa3Fykozm53F4jx1Ji2+Cp1SqUlLZ29Suiethp3PHPqBHQZRm4l29kTZ+ZlHAm+Nlum3XMONgZIXssAPA==; 5:ESpV4bTowsfiQKpfpCU9GWCRV2dk2ms+Zj/ot7KaB3BSYA8WA9RCtTvv5q1RHd0h8RTML2VYW0kmIIWclFn23236nWTgwhR2mFgRbYJ+85aaGj2y+cAXuIIYy6aD2jL9NzMGR4UiJmiinVQXJCZFO06AZz1C6sYTwAEky7yQcE8=; 7:CpFgTd3ljJ8NIPuhIVapOFtaZeoL6r8oK/VVOJj+CnfIqrwATXAeSkbBlIQTMJKfbyMimgHiY9x8Urn/f7H44uuFjvw9CutEz9n7XE5RwCPYbQNxXN8M+d0mGvSOWjgOurE91IT016iOvkhgaR+KjtNiqdxbt42AzU29dYhstaemAesyK9K2NijMMgJGERoRDEf3lOpCLx810k82aqtAjDpZQeFo+t88ofkBw8GoHOGv3u4OvV5uVg8mfW4KB9JX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2018 02:15:50.2009 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 432aa30c-bc1d-4c88-6179-08d6089e5a22 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2031 Subject: Re: [dpdk-dev] [RFC] ethdev: add generic MAC address rewrite 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: , X-List-Received-Date: Thu, 23 Aug 2018 02:15:55 -0000 On Tue, Aug 21, 2018 at 01:44:32PM +0530, Rahul Lakkireddy wrote: > On Tuesday, August 08/14/18, 2018 at 14:45:45 +0530, Jack MIN wrote: > > On Mon, Aug 13, 2018 at 03:38:18PM +0530, Rahul Lakkireddy wrote: > > > On Tuesday, August 08/07/18, 2018 at 14:20:10 +0000, Jack Min wrote: > > > > There is a need to offload rewrite MAC address for both destination and source > > > > from the matched flow > > > > > > > > The proposed actions could make above easily achieved > > > > > > > > > > +1. > > > > > > We're also looking to offload these actions. In addition, we also have > > > a requirement to offload an action to swap the source and destination > > > MAC addresses (i.e. source MAC address will get overwritten with the > > > destination MAC address and vice-versa). > > > > > Hey, > > > > Just want to know in which specific scenario we need to swap MAC address ? > > > > Sorry for the delay in response. > > This action is needed to offload loopback mode; where the hardware > will automatically swap the source and destination MAC before looping > back the packet. > > Also, MAC swap can be used in conjunction with the other rewrite actions > to achieve MAC Layer Transparent NAT. When used in this way, the MAC > addresses will be swapped before the source or destination MAC address > is rewritten and NAT is performed. > Thank you, Rahul. It sounds reasonable to have RTE_FLOW_ACTION_TYPE_MAC_SWAP action. Could you please make a new RFC for this ? At this moment we haven't enough resource to implement it so a separated RFC could be better to manage. What do you think? -Jack > Thanks, > Rahul > > > > Could you please add one more action RTE_FLOW_ACTION_TYPE_MAC_SWAP > > > to achieve this? This action will not take any arguments. Let us > > > know your thoughts. > > > > > > Thanks, > > > Rahul > > > > > > > > > > > Signed-off-by: Xiaoyu Min > > > > > --- > > > > lib/librte_ethdev/rte_flow.h | 32 ++++++++++++++++++++++++++++++++ > > > > 1 file changed, 32 insertions(+) > > > > > > > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > > > > index f8ba71cdb..4a51ab2a3 100644 > > > > --- a/lib/librte_ethdev/rte_flow.h > > > > +++ b/lib/librte_ethdev/rte_flow.h > > > > @@ -1505,6 +1505,26 @@ enum rte_flow_action_type { > > > > * error. > > > > */ > > > > RTE_FLOW_ACTION_TYPE_NVGRE_DECAP, > > > > + > > > > + /** > > > > + * Set source MAC address from matched flow. > > > > + * > > > > + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, > > > > + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. > > > > + * > > > > + * See struct rte_flow_action_set_mac. > > > > + */ > > > > + RTE_FLOW_ACTION_TYPE_SET_MAC_SRC, > > > > + > > > > + /** > > > > + * Set destination MAC address from matched flow. > > > > + * > > > > + * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH, > > > > + * the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. > > > > + * > > > > + * See struct rte_flow_action_set_mac. > > > > + */ > > > > + RTE_FLOW_ACTION_TYPE_SET_MAC_DST, > > > > }; > > > > > > > > /** > > > > @@ -1868,6 +1888,18 @@ struct rte_flow_action_nvgre_encap { > > > > struct rte_flow_item *definition; > > > > }; > > > > > > > > +/** > > > > + * @warning > > > > + * @b EXPERIMENTAL: this structure may change without prior notice > > > > + * > > > > + * RTE_FLOW_ACTION_TYPE_SET_MAC > > > > + * > > > > + * Set MAC address from the matched flow > > > > + */ > > > > +struct rte_flow_action_set_mac { > > > > + uint8_t mac_addr[ETHER_ADDR_LEN]; > > > > +}; > > > > + > > > > /* > > > > * Definition of a single action. > > > > * > > > > -- > > > > 2.17.1