From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70055.outbound.protection.outlook.com [40.107.7.55]) by dpdk.org (Postfix) with ESMTP id 9E5CD1B3A7 for ; Thu, 2 Aug 2018 01:35:37 +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=mk+x+haqm808T45fE3BjYO8lpB+3hgKUdp8xPLul+F4=; b=mIQx64uGDBnH+B0NWeJokYocAmzRNwQnL0WJFZmgJsYA8sg7gmlROhdnL1qu7YDY+3JhA/GfhsZotEM/RB4UC/vG7h2kpm/8D+KEi6XS+H8bNJpQCs6o7m9H0UPxnHya9Rtdnm/s4a3eagEB8mnF0O7iFZth5ECd0+KpAya4VS0= Received: from HE1PR05MB4617.eurprd05.prod.outlook.com (20.176.163.142) by HE1PR05MB1435.eurprd05.prod.outlook.com (10.162.253.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Wed, 1 Aug 2018 23:35:34 +0000 Received: from HE1PR05MB4617.eurprd05.prod.outlook.com ([fe80::d41c:1108:b991:1aa0]) by HE1PR05MB4617.eurprd05.prod.outlook.com ([fe80::d41c:1108:b991:1aa0%4]) with mapi id 15.20.0995.020; Wed, 1 Aug 2018 23:35:34 +0000 From: Jack Min To: Rahul Lakkireddy , Adrien Mazarguil 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+6MKR8wsoQgAC/uwCAA5OrAIAHZaOAgCM6AdA= Date: Wed, 1 Aug 2018 23:35:34 +0000 Message-ID: References: <20180702120421.GA28446@chelsio.com> <20180703133920.GA15447@chelsio.com> <20180705201640.GR4025@6wind.com> <20180710131413.GA9722@chelsio.com> In-Reply-To: <20180710131413.GA9722@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.96.19] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR05MB1435; 6:Ysfj1h8yhhV234nX2kDFl1vS2c2daBKk1GEMATv/m4DM9HEofysFr1T6hsEwE20OncLD/zhBKqUuvqNlA0PLSaVuo2VwqRodebNxYWIFq2Tm3vY+EyVRzU65P28Cbe7arI67fPE9m0umaK3Giq5Z9lkpdTjCptridiwCCZtwWbbMAtApBSk2jtMmqMO3egFSMs2Jpia469AyOKYnyD/1okuxlVaP9XQNE9A17ZdQyal3BNdJ9SHoCDjJMaS6Kfj2yeEgm0I3j3x6RlMnUjKi3M14IjQCcNnYRJD0mRf1CwX4+KD5mzfrZZ1hXLZ2CWfixlm8JHBPNYpqcSlsft1o1jYVaHdCJZ0439Eqt0bJWdf8DdlokaqaZFur9bZ8S2pVsDjEiduX8AoyJM4SPMdx0ljHKXizLHm9z9MJfiaH+ufSg/G6X9kJwSwQyyAZAZb11OzXWl6/qC6hMwlQs5AcUg==; 5:tHm74nJIRCqFuPdAqe9a8ZIuhbjFmeFW7XZ+R+/DI1F6+YipKjBFDx5RCj7mOCVWJEOswMB85UtcA5EEIj/l+IImxhMWvmQMsZC1nRg66REcLDwo1RCc951fql7FhhuTqG2HhslS8Wa687SdYuROhPFSpNp+u1wj1uLqib9akEE=; 7:kTPlywFYiuBdJuAkoIJI7kCUaOiCZNFyqI99h8Em5ymXO9Kysmgj4OmzPwK8n9/+5XqYFf4jnSGe3H37+05iN1OUlpWeUgh2oTAMAEO05Hm2BBt6hA/jc3x0lYNqnYNhE5fBDuuuv4NEq+LoFbKJ3wyNbPw4l51L5i4NBCFKQaczUC7HQgzd4bD7EPOxqxdX4GyIXFAvnkbvhYCLJZLE4RReZQ4rnxBIvpT3IRkRxg4bNwQlgWDKl/zEm6ELA6Or x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 5cb2d73f-3584-4668-d500-08d5f8077a30 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR05MB1435; x-ms-traffictypediagnostic: HE1PR05MB1435: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(8121501046)(5005006)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:HE1PR05MB1435; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1435; x-forefront-prvs: 0751474A44 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(39860400002)(366004)(376002)(396003)(189003)(199004)(13464003)(106356001)(3846002)(8936002)(33656002)(53546011)(6506007)(105586002)(26005)(81166006)(186003)(81156014)(8676002)(2906002)(7696005)(7736002)(6116002)(107886003)(561944003)(76176011)(53936002)(102836004)(4326008)(6246003)(45080400002)(68736007)(25786009)(97736004)(478600001)(5660300001)(99286004)(476003)(5250100002)(9686003)(14454004)(110136005)(54906003)(316002)(86362001)(305945005)(2900100001)(486006)(93886005)(966005)(229853002)(74316002)(446003)(11346002)(14444005)(6436002)(66066001)(55016002)(256004)(6306002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1435; H:HE1PR05MB4617.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-microsoft-antispam-message-info: ScoxFFuKsj76EO/hKmhYT/SdfPA2WqIPQbtKFqUsIdpA+P/ws6VHuIGwvc79P76XU2P4WLBGPaAH16Y7S3yKGVWeBz9La/fy6qQje8aoWKA0WKeI8bQG9NroTlQ4uqEvVW2BM0t94vuxZIlMOCcbtdLZ8QPdonrwmsWadqethvxXCCv8bHIrGKIY6vT9FhGjC7FsVF5IoXzAdp9U5GeG+tfrY2GzQp2kqkN1lOXg8IE13sNJ7oxeF6/zhxDcs9mmzomIhoKNatjzoxcFovDSZ+WPVGDjZ3i+TAYLXEBRXoZOB3Am/p3DJB7Bls7HZSE6/LWDWDpOyqdnhmzMZebRyt6UITiPCNO1EAW5RcGF21Q= 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: 5cb2d73f-3584-4668-d500-08d5f8077a30 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Aug 2018 23:35:34.0648 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1435 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: Wed, 01 Aug 2018 23:35:37 -0000 > -----Original Message----- > From: Rahul Lakkireddy > Sent: July 10, 2018 21:14 > To: Adrien Mazarguil > Cc: Jack Min ; dev@dpdk.org; Shagun Agarwal > ; Indranil Choudhury ; Nirranj= an > Kirubaharan ; Shahaf 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 > On Friday, July 07/06/18, 2018 at 01:46:40 +0530, Adrien Mazarguil wrote: > > On Tue, Jul 03, 2018 at 07:09:22PM +0530, Rahul Lakkireddy wrote: > > > On Tuesday, July 07/03/18, 2018 at 07:57:55 +0530, Jack Min wrote: > > > > Hey Rahul, > > > > > > > > Thank you, those two are the ways to achieve that. > > > > > > > > Personally I prefer the option 1 but with a little bit difference, = something 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 ? > > > > > > > > > > Looks good. I'll update the API and use the above approach in v2. > > Rahul, we have second thought about **level** parameter. We found there are no any *real* user case which really need to modify the inner layer. Do you= have any? If no, **level** could be removed in order to keep API clean and simple. > > I still haven't looked at the original proposal (will get there > > eventually), however keep in mind the presence of "OF" in action names > > stands for "OpenFlow". > > > > Since you chose this route, these actions must be implemented exactly > > as defined by the OpenFlow specification, which comprises their name, > > input parameters and behavior. > > > > For instance there is no support/distinction for IPv6. NW actions must > > be named OF_SET_NW_SRC and OF_SET_NW_DST, only support IPv4 (a > single > > be32) and not have the ability to tell inner from outer as it's > > unspecified (note a safe approach would be to interpret this as > > "outermost" given the tendency of OpenFlow actions to prepend empty hea= ders > and modify them afterward). > > > > In short you can't be creative if you want to keep the OF prefix. > > >=20 > Ok, will drop OF prefix for these actions in v2. How about drop the NW prefix as well? Since we don't want to stick on open= flow, NW prefix seems redundant. Names like RTE_FLOW_ACTION_SET_IPV4_SRC is clear enough, isn't it? What do you think? > > My suggestion would be to stick with OF if your target use case is OVS > > and implement these actions exactly as defined by OpenFlow, even if it > > means limitations due to API (not HW) constraints. Not having to spend > > time to figure how to map OF actions to rte_flow and handle quirks on > > both sides should be much more convenient to users, particularly so if > > these actions bear the same name. > > >=20 > We can translate OF_SET_NW_* actions to RTE_FLOW_ACTION_SET_NW_IPV4_* > actions in OVS stack itself before sending them via DPDK stack for offloa= d. >=20 > Thanks, > Rahul >=20 > > > > > -----Original Message----- > > > > > From: Rahul Lakkireddy > > > > > Sent: July 2, 2018 20:04 > > > > > To: Jack Min > > > > > Cc: dev@dpdk.org; Shagun Agarwal ; Indranil > > > > > Choudhury ; Nirranjan Kirubaharan > > > > > ; Shahaf Shuler ; > > > > > Xueming(Steven) Li > > > > > Subject: Re: [dpdk-dev] [RFC 0/3] ethdev: add IP address and > > > > > TCP/UDP port rewrite actions to flow API > > > > > > > > > > Hi Jack, > > > > > > > > > > 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? > > > > > > > > > > > > > > > > I'm afraid not. These API only modify outer IP addresses. > > > > > > > > > > I can think of two ways to achieve this: > > > > > > > > > > 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. > > > > > > > > > > struct rte_flow_action_of_set_nw_ipv4 { > > > > > uint32_t inner:1; /* 1 - Inner, 0 - Outer */ > > > > > uint32_t reserved:31; > > > > > uint32_t ipv4_addr; > > > > > }; > > > > > > > > > > 2. Add new actions to indicate inner IP addresses; i.e. > > > > > > > > > > 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 > > > > > > > > > > Thanks, > > > > > Rahul > > > > > > > > > > > In our scenarios, we need to specific that NAT action is on > > > > > > inner or outer 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 t= estpmd. > > > > > > > > > > > > > > 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%3= A > > > > > > > %2F%2Fww > > > > > > > w.open > > > > > > > networking.org%2Fimages%2Fopenflow-switch- > > > > > > > > > > > > > v1.5.1.pdf&data=3D02%7C01%7Cxuemingl%40mellanox.com%7C74c8ce3b7995 > > > > > 4b2f > > > > > > > > > > > > > 123208d5d8268617%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C1%7C63 > > > > > 6 > > > > > > > > > > > > > 652582334142929&sdata=3DuoFc1KjVTkGI9fdaPNXvXYRmh%2F6HLMKT79IwgvDS > > > > > H > > > > > > > 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 > > > > > > > > > > -- > > Adrien Mazarguil > > 6WIND