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 6ECD4A0487 for ; Wed, 3 Jul 2019 07:04:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D925F44C3; Wed, 3 Jul 2019 07:04:50 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70040.outbound.protection.outlook.com [40.107.7.40]) by dpdk.org (Postfix) with ESMTP id 2E5F723D for ; Wed, 3 Jul 2019 07:04:49 +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=MKSQnE/Jy5qai3avJ9yE0OZjvH6FUaN5BQo6auUFAhk=; b=XFxnTqPedyerdFfpyYNcw8UpUxyHPbBg1BrMlIXSVYstZ4mX0YaV/8UGjr49wxUTAo8ZIZi1qlwLlZ4YBQ8gxLkilDWgM7J5oxRxAQQ32Y8SHOCTfVTuZpyoJSBKM5cpIHNxGZWO8H/dWff/lmMxDS0ji0bnhblcE2tGXFHrnc4= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3186.eurprd05.prod.outlook.com (10.171.191.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Wed, 3 Jul 2019 05:04:47 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::1442:fc4d:41ad:29d2]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::1442:fc4d:41ad:29d2%5]) with mapi id 15.20.2032.019; Wed, 3 Jul 2019 05:04:47 +0000 From: Slava Ovsiienko To: Dekel Peled , Adrien Mazarguil , "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" , Yongseok Koh , Shahaf Shuler , "arybchenko@solarflare.com" , Raslan Darawsheh CC: "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH v10 1/3] ethdev: add actions to modify TCP header fields Thread-Index: AQHVMOTvGa4xhk7Zh0i6e+5IpPdq4qa4V2kQ Date: Wed, 3 Jul 2019 05:04:47 +0000 Message-ID: References: <1553177917-43297-1-git-send-email-dekelp@mellanox.com> In-Reply-To: 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=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f659694d-6ef5-42b4-6dbd-08d6ff73f883 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:AM4PR05MB3186; x-ms-traffictypediagnostic: AM4PR05MB3186: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 00872B689F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(376002)(136003)(39860400002)(366004)(199004)(189003)(13464003)(86362001)(305945005)(66066001)(446003)(486006)(476003)(256004)(76176011)(7736002)(186003)(74316002)(6506007)(53546011)(11346002)(26005)(8936002)(99286004)(8676002)(55016002)(2501003)(81166006)(33656002)(81156014)(7696005)(3846002)(2906002)(6116002)(102836004)(6636002)(107886003)(229853002)(71190400001)(68736007)(5660300002)(52536014)(25786009)(478600001)(966005)(6436002)(71200400001)(14454004)(76116006)(4326008)(66946007)(110136005)(53936002)(316002)(73956011)(6306002)(66446008)(6246003)(66476007)(2201001)(54906003)(64756008)(66556008)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3186; H:AM4PR05MB3265.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: FM6xPzbZHYZLEV0nDkNGLd9CetpyloPDhMi34E49yqzO+r2i215Ytl0W9536O+IHLPdwEcS35uqhslL9gbGjMLpAtPunlUYca5wBcz6Ff0Zsq27u1kbz8jNBCrvo4pa8CTpajdmE2RbUxKVfVtG/5YA+5T4pq3N0aXz7f68fq4rdlQn59HBMTt1M61GcSyn1FIlkhP5krDkHqW9/WfRbEeQwN6j5kpyN4DOKrsXcD2cn3pMtfXpymr8dqm0JqXYhF1ouEMTMSQG+ImNsrVHz/mhGAUHUvaz6eIi4spuoVR+VEgk+X2hZ5aUeAu2XxcXKPNl2iBlbYRNrA4UUFZWIcfk8U9bLwJLIVUpf4rH82HNOG7yWo8q/+8DNSYnyf+YSrctRzMAhIpsTjFkIgLCvR5DPHVVsKZxmYlwnr1d1Ow8= 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: f659694d-6ef5-42b4-6dbd-08d6ff73f883 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2019 05:04:47.4189 (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: viacheslavo@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3186 Subject: Re: [dpdk-dev] [PATCH v10 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" > -----Original Message----- > From: Dekel Peled > Sent: Tuesday, July 2, 2019 17:44 > To: 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: [PATCH v10 1/3] ethdev: add actions to modify TCP header fields >=20 > 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. >=20 > Original work by Xiaoyu Min. >=20 > This patch uses the new approach introduced by [1], using a simple intege= r > instead of using an action-specific structure for each of the new actions= . >=20 > [1] http://patches.dpdk.org/patch/55882/ >=20 > Signed-off-by: Dekel Peled > Acked-by: Andrew Rybchenko Acked-by: Viacheslav Ovsiienko > --- > doc/guides/prog_guide/rte_flow.rst | 32 ++++++++++++++++++++++ > lib/librte_ethdev/rte_flow.c | 4 +++ > lib/librte_ethdev/rte_flow.h | 56 > ++++++++++++++++++++++++++++++++++++++ > 3 files changed, 92 insertions(+) >=20 > 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 | > +--------------+---------------+ >=20 > +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 behav= ior. > + > +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 behav= ior. > + > +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 behav= ior. > + > +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 behav= ior. > + > Negative types > ~~~~~~~~~~~~~~ >=20 > 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)), > }; >=20 > static int > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h = index > 2232856..bc41023 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -1651,6 +1651,62 @@ 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. > + * > + * Action configuration specifies the value to increase > + * TCP sequence number as a big-endian 32 bit integer. > + * > + * @p conf type: > + * @code rte_be32_t * @endcode > + * > + * 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. > + * > + * Action configuration specifies the value to decrease > + * TCP sequence number as a big-endian 32 bit integer. > + * > + * @p conf type: > + * @code rte_be32_t * @endcode > + * > + * 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. > + * > + * Action configuration specifies the value to increase > + * TCP acknowledgment number as a big-endian 32 bit integer. > + * > + * @p conf type: > + * @code rte_be32_t * @endcode > + > + * 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. > + * > + * Action configuration specifies the value to decrease > + * TCP acknowledgment number as a big-endian 32 bit integer. > + * > + * @p conf type: > + * @code rte_be32_t * @endcode > + * > + * Using this action on non-matching traffic will result in > + * undefined behavior. > + */ > + RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK, > }; >=20 > /** > -- > 1.8.3.1