From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00060.outbound.protection.outlook.com [40.107.0.60]) by dpdk.org (Postfix) with ESMTP id F1C8E1BE4E for ; Tue, 3 Jul 2018 04:28:02 +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=ruG8qkK4AAa+kIRe0JbN/0bkeepfkoS/o2/TyWv9nG8=; b=Ta1i4YRx+HB+EfVjl2k+6WY3+3lMEVLMPifGy1FWOlrb3bOyQcmVg8NL/QhLPxM5UXHBJTJ1Fuv9pzSNUHRH140AzMNZcryxM2j78y1MLAjzGB2vCsVETKIU+TBv7HEd69TQTsvvMa3VPMBvnVMogvio8kSB+lR12dFO0lA7oWw= Received: from HE1PR05MB4617.eurprd05.prod.outlook.com (20.176.163.142) by HE1PR05MB3291.eurprd05.prod.outlook.com (10.170.243.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.26; Tue, 3 Jul 2018 02:28:01 +0000 Received: from HE1PR05MB4617.eurprd05.prod.outlook.com ([fe80::8056:160a:6cc2:e7c0]) by HE1PR05MB4617.eurprd05.prod.outlook.com ([fe80::8056:160a:6cc2:e7c0%2]) with mapi id 15.20.0906.026; Tue, 3 Jul 2018 02:27:55 +0000 From: Jack Min To: Rahul Lakkireddy CC: "dev@dpdk.org" , Shagun Agarwal , Indranil Choudhury , Nirranjan Kirubaharan , Shahaf Shuler , "Xueming(Steven) Li" Thread-Topic: [dpdk-dev] [RFC 0/3] ethdev: add IP address and TCP/UDP port rewrite actions to flow API Thread-Index: AQHUEfz8avEwNjsRdU+lfRVu3r+6MKR8wsoQ Date: Tue, 3 Jul 2018 02:27:55 +0000 Message-ID: References: <20180702120421.GA28446@chelsio.com> In-Reply-To: <20180702120421.GA28446@chelsio.com> 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=jackmin@mellanox.com; x-originating-ip: [61.173.99.150] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR05MB3291; 7:5auxzMKevLP/BWwj4K45ZHg0IRXPw9e4b7+lS1OyowzM2yr4WkjQUfYpdwlaosFy/XMH2b+UEO+B0c50Qp8zf1eg59280w4J9DGsfsIcn+5mgJ8B0Dlx9w1kRnCm1hhXlsqo5m5/GqcC4aRDWEZ4Aehz1Uu3JIr+PlQ1yAg+Nh6tMyLHVLh2qZBmn9YtyNJQVWnnWxB+7ng9kZclH827TXeV2WYSYZNf6HSSokgbAPba32jrq+urnzSZrq+OWXrk x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: ed6281a5-a5ec-4c0e-24b0-08d5e08c95a2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:HE1PR05MB3291; x-ms-traffictypediagnostic: HE1PR05MB3291: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(45079756050767); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:HE1PR05MB3291; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB3291; x-forefront-prvs: 0722981D2A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(396003)(366004)(346002)(376002)(13464003)(199004)(189003)(14454004)(966005)(45080400002)(256004)(478600001)(9686003)(81156014)(8676002)(5250100002)(6116002)(3846002)(54906003)(316002)(68736007)(99286004)(6916009)(97736004)(66066001)(5660300001)(8936002)(81166006)(6436002)(7736002)(305945005)(86362001)(74316002)(2900100001)(186003)(2906002)(26005)(229853002)(107886003)(486006)(102836004)(11346002)(476003)(446003)(53936002)(6246003)(4326008)(25786009)(53546011)(106356001)(33656002)(76176011)(105586002)(6506007)(7696005)(6306002)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3291; H:HE1PR05MB4617.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: Vq49toS2d6QZVqfk4k9026n0NOy7yrUYSS2OGGiPfKGJ1LzMbjNq+xSZ0R1HXVKwsA7UgDBqMTkWIwsCuuwYOpCCVnHzaTrQtPq2djAGFh02/rAvhpf6T71KQoP/c/DiPBxePJuftGvhRJKXh57yxuq/vv7xD2LdOLsm2XvURhu2p+B3wuTMxRkVUkZeHUL/5xcKNRITTAEWRzAHQJDHuKTBZY0qbs22VbwdsYurnYdLfvb7Sg+zKcbrPuJJF068B3GFy7sL9DT3oC3m7rIzc9cQbMEQJ7+tgqhV6+H3TCT0keenWlWKVhTZezK8jqq36gJaffdJxfShfVZmpM8MTjVsBT9SELi9+7bA9agcG7Q= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed6281a5-a5ec-4c0e-24b0-08d5e08c95a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2018 02:27:55.1861 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3291 Subject: Re: [dpdk-dev] [RFC 0/3] ethdev: add IP address and TCP/UDP port rewrite actions to flow API 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, 03 Jul 2018 02:28:03 -0000 Hey Rahul, Thank you, those two are the ways to achieve that. Personally I prefer the option 1 but with a little bit difference, somethin= g like: struct rte_flow_action_of_set_nw_ipv4 { uint32_t ipv4_addr; uint8_t level; /* 0 - outer (default), 1 - inner, 2 -255= deeper if available */ }; What do you think ? -Jack > -----Original Message----- > From: Rahul Lakkireddy > Sent: July 2, 2018 20:04 > To: Jack Min > Cc: dev@dpdk.org; Shagun Agarwal ; Indranil Choudhur= y > ; Nirranjan Kirubaharan ; Sh= ahaf > Shuler ; Xueming(Steven) Li > Subject: Re: [dpdk-dev] [RFC 0/3] ethdev: add IP address and TCP/UDP port > rewrite actions to flow API >=20 > Hi Jack, >=20 > On Monday, July 07/02/18, 2018 at 14:39:06 +0530, Jack Min wrote: > > Hey, > > > > I've one question: > > > > Do those APIs support modify inner IP headers? > > >=20 > I'm afraid not. These API only modify outer IP addresses. >=20 > I can think of two ways to achieve this: >=20 > 1. Enhance these API to accept an additional flag to indicate > inner or outer. For example, to set inner IPv4 address, we can > set inner to 1 in following structure. >=20 > struct rte_flow_action_of_set_nw_ipv4 { > uint32_t inner:1; /* 1 - Inner, 0 - Outer */ > uint32_t reserved:31; > uint32_t ipv4_addr; > }; >=20 > 2. Add new actions to indicate inner IP addresses; i.e. >=20 > RTE_FLOW_ACTION_TYPE_OF_SET_INNER_NW_IPV4_SRC > RTE_FLOW_ACTION_TYPE_OF_SET_INNER_NW_IPV4_DST > RTE_FLOW_ACTION_TYPE_OF_SET_INNER_NW_IPV6_SRC > RTE_FLOW_ACTION_TYPE_OF_SET_INNER_NW_IPV6_DST >=20 > Thanks, > Rahul >=20 > > In our scenarios, we need to specific that NAT action is on inner or o= uter IP > header. > > > > Thanks, > > -Jack > > > > > -----Original Message----- > > > From: dev On Behalf Of Rahul Lakkireddy > > > Sent: June 22, 2018 17:56 > > > To: dev@dpdk.org > > > Cc: shaguna@chelsio.com; indranil@chelsio.com; nirranjan@chelsio.com > > > Subject: [dpdk-dev] [RFC 0/3] ethdev: add IP address and TCP/UDP > > > port rewrite actions to flow API > > > > > > This series of patches add support for actions: > > > - OF_SET_NW_IPV4_SRC - set a new IPv4 source address. > > > - OF_SET_NW_IPV4_DST - set a new IPv4 destination address. > > > - OF_SET_NW_IPV6_SRC - set a new IPv6 source address. > > > - OF_SET_NW_IPV6_DST - set a new IPv6 destination address. > > > - OF_SET_TP_SRC - set a new TCP/UDP source port number. > > > - OF_SET_TP_DST - set a new TCP/UDP destination port number. > > > > > > These actions are useful in Network Address Translation use case to > > > edit IP address and TCP/UDP port numbers before switching the > > > packets out to the destination device port. > > > > > > The IP address and TCP/UDP port rewrite actions are based on > > > OFPAT_SET_NW_SRC, OFPAT_SET_NW_DST, OFPAT_SET_TP_SRC, and > > > OFPAT_SET_TP_DST actions from OpenFlow Specification [1]. > > > > > > Patch 1 adds support for IP address rewrite to rte_flow and testpmd. > > > > > > Patch 2 adds support for TCP/UDP port rewrite to rte_flow and testpmd= . > > > > > > Patch 3 shows CXGBE PMD example to offload these actions to hardware. > > > > > > Feedback and suggestions will be much appreciated. > > > > > > Thanks, > > > Rahul > > > > > > [1] > > > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fw= w > > > w.open > > > networking.org%2Fimages%2Fopenflow-switch- > > > > v1.5.1.pdf&data=3D02%7C01%7Cxuemingl%40mellanox.com%7C74c8ce3b79954b2f > > > > 123208d5d8268617%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C1%7C636 > > > > 652582334142929&sdata=3DuoFc1KjVTkGI9fdaPNXvXYRmh%2F6HLMKT79IwgvDSH > > > 0k%3D&reserved=3D0 > > > > > > Shagun Agrawal (3): > > > ethdev: add flow api actions to modify IP addresses > > > ethdev: add flow api actions to modify TCP/UDP port numbers > > > net/cxgbe: add flow actions to modify IP and TCP/UDP port address > > > > > > app/test-pmd/cmdline_flow.c | 150 > > > ++++++++++++++++++++++++++++ > > > app/test-pmd/config.c | 12 +++ > > > doc/guides/prog_guide/rte_flow.rst | 102 ++++++++++++++++++= + > > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 24 +++++ > > > drivers/net/cxgbe/base/common.h | 1 + > > > drivers/net/cxgbe/base/t4fw_interface.h | 50 ++++++++++ > > > drivers/net/cxgbe/cxgbe_filter.c | 23 ++++- > > > drivers/net/cxgbe/cxgbe_filter.h | 26 ++++- > > > drivers/net/cxgbe/cxgbe_flow.c | 127 ++++++++++++++++++= +++++ > > > drivers/net/cxgbe/cxgbe_main.c | 10 ++ > > > lib/librte_ethdev/rte_flow.c | 12 +++ > > > lib/librte_ethdev/rte_flow.h | 92 +++++++++++++++++ > > > 12 files changed, 625 insertions(+), 4 deletions(-) > > > > > > -- > > > 2.14.1 > >