From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21C5FA0487 for ; Tue, 2 Jul 2019 14:01:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE26B1B974; Tue, 2 Jul 2019 14:01:37 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130040.outbound.protection.outlook.com [40.107.13.40]) by dpdk.org (Postfix) with ESMTP id 593C77CBC for ; Tue, 2 Jul 2019 14:01:36 +0200 (CEST) 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=F2O3qkDFGKufE+mK766PAgj22gkloG64NkfU/0RGUMA=; b=Twtc/j7rJ8V5kcJTy6PaZJ4rAKpK2EkmLLayJH9U5vCGqL55VxEeUB1ykL8OnF0B3oB/cmXQDZTAyc9I90ga968Ql/1QeDh5qmYGMTKanVOJsECWKetksI6mzEMxGUhsLB2Hb962EYIX2S5w9dGzcGg2mXSD1hd+TXtF2w6cQm8= Received: from AM4PR05MB3460.eurprd05.prod.outlook.com (10.171.187.153) by AM4PR05MB3249.eurprd05.prod.outlook.com (10.171.188.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.18; Tue, 2 Jul 2019 12:01:34 +0000 Received: from AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::7de4:132c:8c9:438]) by AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::7de4:132c:8c9:438%4]) with mapi id 15.20.2032.019; Tue, 2 Jul 2019 12:01:34 +0000 From: Dekel Peled To: Adrien Mazarguil CC: Andrew Rybchenko , "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" , Yongseok Koh , Shahaf Shuler , Slava Ovsiienko , "dev@dpdk.org" , Ori Kam Thread-Topic: [dpdk-dev] [PATCH v9 1/3] ethdev: add actions to modify TCP header fields Thread-Index: AQHVMCP6KIq3HRtlY0izxf+inUwcM6a2+/MAgAAICvCAAB7egIAAGFGw Date: Tue, 2 Jul 2019 12:01:34 +0000 Message-ID: References: <1553177917-43297-1-git-send-email-dekelp@mellanox.com> <359385afd8826483cd8b7af2c8a5ea45d4d5a9b2.1561994563.git.dekelp@mellanox.com> <7ebe9e0c-cd76-28ef-0788-1b5a81177139@solarflare.com> <20190702103321.GB4512@6wind.com> In-Reply-To: <20190702103321.GB4512@6wind.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=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7764e766-6c3c-43d2-f46a-08d6fee5074f 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:AM4PR05MB3249; x-ms-traffictypediagnostic: AM4PR05MB3249: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 008663486A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(39860400002)(346002)(396003)(366004)(136003)(13464003)(189003)(199004)(66066001)(26005)(9686003)(6246003)(81166006)(71190400001)(6306002)(3846002)(476003)(76176011)(7696005)(8936002)(74316002)(446003)(11346002)(6116002)(81156014)(71200400001)(8676002)(7736002)(53936002)(4326008)(5660300002)(305945005)(6436002)(55016002)(186003)(86362001)(52536014)(107886003)(25786009)(2906002)(54906003)(14454004)(66446008)(102836004)(66476007)(53546011)(64756008)(66556008)(6506007)(256004)(229853002)(14444005)(33656002)(76116006)(486006)(316002)(73956011)(478600001)(966005)(66946007)(99286004)(68736007)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3249; H:AM4PR05MB3460.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: xgT+Yx0OPSywTOIo+rTLJfXed9hYcyQBkYEd/MFOrqQgyXO/By+1iPVk3haFonngrJ+6x7BgGfJBCH0WbEXJOMqX1ousH6pPaCxI2vBeESMWNKsDMrCFII8zBRCW0vZLJ96Hlq+1PIWpCkgHLTndiChA4S7Dm15wM2CJbhPRksRNzlNyX7AWDepKtpZY6heiYIIDjn7dibeHdE0o4dAte/xfDfL/hxuMmgsdD/xyhl/Me4krckN38doHbeVfzSLOPsykGF7g/n6p7yX83HPy5g1hHOPS6XVA1iSvrZJEcMPH7/0w23+Pz7QufIHGLO5gK4/uhC5IzmnXoGlk7L6WhNOhhlget8KFLqVcUenE4qu8VVbpIsx9PdNec79AvG/3f+k8oPhK8NsT9xIB+EuGcpArydYqigSlA2gCsuwy/wA= 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: 7764e766-6c3c-43d2-f46a-08d6fee5074f X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2019 12:01:34.1501 (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: dekelp@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3249 Subject: Re: [dpdk-dev] [PATCH v9 1/3] ethdev: add actions to modify TCP header fields 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" Thanks, PSB. > -----Original Message----- > From: Adrien Mazarguil > Sent: Tuesday, July 2, 2019 1:33 PM > To: Dekel Peled > Cc: Andrew Rybchenko ; > wenzhuo.lu@intel.com; jingjing.wu@intel.com; > bernard.iremonger@intel.com; Yongseok Koh ; > Shahaf Shuler ; Slava Ovsiienko > ; dev@dpdk.org; Ori Kam > > Subject: Re: [dpdk-dev] [PATCH v9 1/3] ethdev: add actions to modify TCP > header fields >=20 > On Tue, Jul 02, 2019 at 09:52:40AM +0000, Dekel Peled wrote: > > Thanks, PSB > > > > > -----Original Message----- > > > From: Andrew Rybchenko > > > Sent: Tuesday, July 2, 2019 11:14 AM > > > To: Dekel Peled ; Adrien Mazarguil > > > ; wenzhuo.lu@intel.com; > > > jingjing.wu@intel.com; bernard.iremonger@intel.com; Yongseok Koh > > > ; Shahaf Shuler ; Slava > > > Ovsiienko ; arybchenko@solarflare.com > > > Cc: dev@dpdk.org; Ori Kam > > > Subject: Re: [dpdk-dev] [PATCH v9 1/3] ethdev: add actions to modify > > > TCP header fields > > > > > > On 01.07.2019 18:43, Dekel Peled wrote: > > > > Add actions: > > > > - INC_TCP_SEQ - Increase sequence number in the outermost TCP > header. > > > > - DEC_TCP_SEQ - Decrease sequence number in the outermost TCP > > > header. > > > > - INC_TCP_ACK - Increase acknowledgment number in the outermost > TCP > > > > header. > > > > - DEC_TCP_ACK - Decrease acknowledgment number in the outermost > TCP > > > > header. > > > > > > > > Original work by Xiaoyu Min. > > > > > > > > This patch uses the new approach introduced by [1], using a simple > > > > integer instead of using an action-specific structure for each of > > > > the new actions. > > > > > > > > [1] > > > > > > > http://patch > > > > > > > > es.dpdk.org%2Fpatch%2F55773%2F&data=3D02%7C01%7Cdekelp%40mell > > > anox.co > > > > > > > > m%7Cae3a2667c3a243a9c1e508d6fec54a22%7Ca652971c7d2e4d9ba6a4d1492 > > > 56f461 > > > > > > > > b%7C0%7C0%7C636976520663069258&sdata=3D1z3uDQGnnyPZH9NAUuY5 > > > 0ZSg3smyZ > > > > nDmc3QZtuNTmyg%3D&reserved=3D0 > > > > > > > > Signed-off-by: Dekel Peled > > > > Acked-by: Andrew Rybchenko > > > > --- > > > > doc/guides/prog_guide/rte_flow.rst | 32 > > > ++++++++++++++++++++++++++++++++ > > > > lib/librte_ethdev/rte_flow.c | 4 ++++ > > > > lib/librte_ethdev/rte_flow.h | 32 > > > ++++++++++++++++++++++++++++++++ > > > > 3 files changed, 68 insertions(+) > > > > > > > > diff --git a/doc/guides/prog_guide/rte_flow.rst > > > > b/doc/guides/prog_guide/rte_flow.rst > > > > index 67deed7..bbe32db 100644 > > > > --- a/doc/guides/prog_guide/rte_flow.rst > > > > +++ b/doc/guides/prog_guide/rte_flow.rst > > > > @@ -2346,6 +2346,38 @@ Otherwise, > RTE_FLOW_ERROR_TYPE_ACTION > > > error will be returned. > > > > | ``mac_addr`` | MAC address | > > > > +--------------+---------------+ > > > > > > > > +Action: ``INC_TCP_SEQ`` > > > > +^^^^^^^^^^^^^^^^^^^^^^^ > > > > + > > > > +Increase sequence number in the outermost TCP header. > > > > +Value to increase TCP sequence number by is a big-endian 32 bit > integer. > > > > + > > > > +Using this action on non-matching traffic will result in undefined > behavior. > > > > + > > > > +Action: ``DEC_TCP_SEQ`` > > > > +^^^^^^^^^^^^^^^^^^^^^^^ > > > > + > > > > +Decrease sequence number in the outermost TCP header. > > > > +Value to decrease TCP sequence number by is a big-endian 32 bit > integer. > > > > + > > > > +Using this action on non-matching traffic will result in undefined > behavior. > > > > + > > > > +Action: ``INC_TCP_ACK`` > > > > +^^^^^^^^^^^^^^^^^^^^^^^ > > > > + > > > > +Increase acknowledgment number in the outermost TCP header. > > > > +Value to increase TCP acknowledgment number by is a big-endian 32 > > > > +bit > > > integer. > > > > + > > > > +Using this action on non-matching traffic will result in undefined > behavior. > > > > + > > > > +Action: ``DEC_TCP_ACK`` > > > > +^^^^^^^^^^^^^^^^^^^^^^^ > > > > + > > > > +Decrease acknowledgment number in the outermost TCP header. > > > > +Value to decrease TCP acknowledgment number by is a big-endian 32 > > > > +bit > > > integer. > > > > + > > > > +Using this action on non-matching traffic will result in undefined > behavior. > > > > + > > > > Negative types > > > > ~~~~~~~~~~~~~~ > > > > > > > > diff --git a/lib/librte_ethdev/rte_flow.c > > > > b/lib/librte_ethdev/rte_flow.c index 3277be1..0c9f6c6 100644 > > > > --- a/lib/librte_ethdev/rte_flow.c > > > > +++ b/lib/librte_ethdev/rte_flow.c > > > > @@ -143,6 +143,10 @@ struct rte_flow_desc_data { > > > > MK_FLOW_ACTION(SET_TTL, sizeof(struct rte_flow_action_set_ttl)), > > > > MK_FLOW_ACTION(SET_MAC_SRC, sizeof(struct > > > rte_flow_action_set_mac)), > > > > MK_FLOW_ACTION(SET_MAC_DST, sizeof(struct > > > > rte_flow_action_set_mac)), > > > > + MK_FLOW_ACTION(INC_TCP_SEQ, sizeof(rte_be32_t)), > > > > + MK_FLOW_ACTION(DEC_TCP_SEQ, sizeof(rte_be32_t)), > > > > + MK_FLOW_ACTION(INC_TCP_ACK, sizeof(rte_be32_t)), > > > > + MK_FLOW_ACTION(DEC_TCP_ACK, sizeof(rte_be32_t)), > > > > }; > > > > > > > > static int > > > > diff --git a/lib/librte_ethdev/rte_flow.h > > > > b/lib/librte_ethdev/rte_flow.h index 2232856..28445f4 100644 > > > > --- a/lib/librte_ethdev/rte_flow.h > > > > +++ b/lib/librte_ethdev/rte_flow.h > > > > @@ -1651,6 +1651,38 @@ enum rte_flow_action_type { > > > > * See struct rte_flow_action_set_mac. > > > > */ > > > > RTE_FLOW_ACTION_TYPE_SET_MAC_DST, > > > > + > > > > + /** > > > > + * Increase sequence number in the outermost TCP header. > > > > + * > > > > + * Using this action on non-matching traffic will result in > > > > + * undefined behavior. > > > > + */ > > > > + RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ, > > > > + > > > > + /** > > > > + * Decrease sequence number in the outermost TCP header. > > > > + * > > > > + * Using this action on non-matching traffic will result in > > > > + * undefined behavior. > > > > + */ > > > > + RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ, > > > > + > > > > + /** > > > > + * Increase acknowledgment number in the outermost TCP header. > > > > + * > > > > + * Using this action on non-matching traffic will result in > > > > + * undefined behavior. > > > > + */ > > > > + RTE_FLOW_ACTION_TYPE_INC_TCP_ACK, > > > > + > > > > + /** > > > > + * Decrease acknowledgment number in the outermost TCP header. > > > > + * > > > > + * Using this action on non-matching traffic will result in > > > > + * undefined behavior. > > > > + */ > > > > + RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK, > > > > }; > > > > > > > > /** > > > > > > Other actions have type of configuration data description in a > > > comment just before the action enum element. I'm not sure why it is > skipped here. > > > It is really vital information. > > > > > > > I had the relevant struct name here, and removed it when I changed it t= o > integer. > > In the documentation doc/guides/prog_guide/rte_flow.rst I added > description, please see above. >=20 > Yes, still Andrew is right, header documentation must be exhaustive. > Developers might use rte_flow.rst as reference and to understand the > underlying design but will definitely rely on rte_flow.h (and Doxygen) wh= en > writing code. >=20 > I suggest something which describes types and how they are used a bit lik= e > enum rte_flow_conv_op, e.g. for RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK: >=20 > [...] > * > * Action configuration specifies the value to decrease TCP acknowledgmen= t > * number as a big-endian 32 bit integer. > * > * @p conf type: > * @code const rte_be32_t * @endcode > */ >=20 > I know other actions do not have the same format but we'll update them > eventually. Agree, I'll add this documentation. >=20 > -- > Adrien Mazarguil > 6WIND