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 27771A04BA; Wed, 7 Oct 2020 08:28:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4E57C29AC; Wed, 7 Oct 2020 08:28:12 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id 8834D29AC for ; Wed, 7 Oct 2020 08:28:10 +0200 (CEST) Received: from HKMAIL103.nvidia.com (Not Verified[10.18.92.9]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 07 Oct 2020 14:28:08 +0800 Received: from HKMAIL103.nvidia.com (10.18.16.12) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 7 Oct 2020 06:27:57 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 7 Oct 2020 06:27:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=giHw77PIRdc0jIHwMncY7sww9md+BQ2Eq3L7gdGa39JNXMA4uweWxi7020Nd3YbhLGkY0Mw5HldjVgUaSP7yYcqXBdcXL6Jqr0C6thWkgMe3mCvndaWoN+c8EPtXV6jx8KQdlcjtoItPt/1tv/KOnWBQmpk8qtKygDLH+4VT9ls6OvWOZYmqvHtNukDrzROpQl9/J0bVGKpfUpGoE8QlhowJ2k/Zvy+k7wa96wYTLq1JIfuVIzcBCdA3QG9xS21/BPVLMGGnvdnh+HKLjN6raIjCXt/99D3u6I7Fka6QMqd+PdqLSBwbkbuG6VR2i9t1usNQGIvX77R+CYDWjldPkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5yRRdugW4Bq4Ep8oNjWPsCLqx+saQ5D4EOkz9ny55Xw=; b=g0/sTTiLnVR2PumVI5wAiis3zp91OOuFVc9N0srPKkzhiiTU5GTxAeOkXiuvgyxw1C/dw/OVscpqbqC5RpN4yBFY0urMyAFKL00EHJ1gYdAJY3HgYesWAcJEBOhBiNaGxidGYLpFHUsl1IFXmuJVIAzWfzGHkDiggvOrGIV7Eyj6jMFp9OjnaYGywoIswPXtupwbbxKto1OeCYWlLde1pz3sUOKRTdbRLG/UYy3nHhGPwdbxVDPMTHHg8Or2JHfSZfBwpHkiqDb2q03XrlkTrJ1CM62aiBZAVH/oKeLyqEmerZudSKgolFsxixkzNX5A4F+xyKFCYB8h1nzW+2sa3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MN2PR12MB4286.namprd12.prod.outlook.com (2603:10b6:208:199::22) by MN2PR12MB4256.namprd12.prod.outlook.com (2603:10b6:208:1d2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 06:27:55 +0000 Received: from MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f]) by MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f%8]) with mapi id 15.20.3433.046; Wed, 7 Oct 2020 06:27:55 +0000 From: Ori Kam To: Andrey Vesnovaty , "dev@dpdk.org" CC: "jer@marvell.com" , "jerinjacobk@gmail.com" , NBU-Contact-Thomas Monjalon , "ferruh.yigit@intel.com" , "stephen@networkplumber.org" , "bruce.richardson@intel.com" , Slava Ovsiienko , "andrey.vesnovaty@gmail.com" , "mdr@ashroe.eu" , "nhorman@tuxdriver.com" , "ajit.khaparde@broadcom.com" , "samik.gupta@broadcom.com" , John McNamara , "Marko Kovacevic" , Andrew Rybchenko , Ori Kam Thread-Topic: [PATCH v4 1/2] ethdev: add flow shared action API Thread-Index: AQHWnByYvRq9Tboaj0eUBpzeQ2OWoKmLqUVg Date: Wed, 7 Oct 2020 06:27:55 +0000 Message-ID: References: <20200702120511.16315-1-andreyv@mellanox.com> <20201006200835.30017-1-andreyv@nvidia.com> <20201006200835.30017-2-andreyv@nvidia.com> In-Reply-To: <20201006200835.30017-2-andreyv@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6709d737-52cf-452e-7510-08d86a8a2074 x-ms-traffictypediagnostic: MN2PR12MB4256: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:901; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WpCY8C+Lxw8pjWOkvv/fTURU3s2zvAyERpdMPSFmUNoiU25U3WE7yPyU/wcFIHWvaWleSKiUE0CRFfRLw5mJzeLK3gEtYUIqUwP6mbn9kBB5mMdqT7eDNaaqJsX6792y1BfGnedzt6DhiL89tQXrRTeJIgAkU9RX4gSfEhnTWIVq6b4Kn3iuuH/Xd2+UyykF4PeUWCKP7t+zDVHjwjCdleFQzo5iiEanQb/LexOKwXOP1NLWl7HCGQMUSjUwL4wdZyHi/kPq8bLd5EHiCpGNOeutgB1Z1XTyLi3j+JdGefcdSLYHJAop0ILLXRU0Zw8efhVZgO7kJTPGDdVHQ07ltw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4286.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(39860400002)(366004)(136003)(376002)(66476007)(9686003)(7416002)(52536014)(107886003)(8936002)(26005)(110136005)(316002)(54906003)(66556008)(66446008)(64756008)(478600001)(55016002)(83380400001)(7696005)(33656002)(186003)(71200400001)(8676002)(6506007)(53546011)(4326008)(66946007)(2906002)(76116006)(86362001)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: HFaU3fFw1h80k9l6O/xXT2a6AEgyBZ1J+RVbcmgJQrlzUd9jWaFyhDw5GNrcztnpzv9RC7MYlX9zAVI24IQ6JraFYzzMXLI3CkkwA7zAeUNfNcZYr+lS+ODyiDaBO+tHDU1YaowymdYG5poBrR2Pp7YqsAixKMdo2Z/3Z0PALY3wyIIjSt2PWOQ/KsztWHAcs4k136+okLsznn9BP3dwCAXRwt+gh2OyiVMOQoTpRRNeaQQ4Ge4VC+88NQI55R28mZ6K0ZalsMOo5DUKMaZ8RFTD7NMLZXtuzARD7aC4leFA3K2x3QTgax/OrRLJRZ6SGaGMIl1Uy/MUb4qOR95S/BgSzv3mHmxRN3Da2nT27yVudr6u+kWtTfuj21+C2muKnnC9r3T2iKvqlKdAIQDnHp1GmA76lQrhbmWYcUMRC5kXWUMYT7Ka+W3BCIGMWg4634PjZeq2zNkG1EKn6NxBBcHg2NCHrqP2LMNEYwFo5qhzu6afMosJEIcCUL8t76odWp2peRwUwx0AGGEuamCi2jSqZE9CaZJ0lG3csNIEb8dFF7ddx6WNeFxN4WPMF0Tl1uhcnkGSBukHHUtaZGn4uJpeCwHGTRbJAesbq+FtZYmup7gUlU0LSCv+u6F8Y6MNFIW05z1nlys+TwPDquFrHw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4286.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6709d737-52cf-452e-7510-08d86a8a2074 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2020 06:27:55.3517 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jpPGBS3n8jPGizinDh8S80PB/jn6iHvF79yazYrj6VHia+/JG5r3OsnWiGkfsYOlUDqY0WD2dKc71bDtUW4I4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4256 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602052088; bh=5yRRdugW4Bq4Ep8oNjWPsCLqx+saQ5D4EOkz9ny55Xw=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=qm0L8DXJd8pKVxSgL1NJgQg9/gsx2UrsPPaunmkikU+aDWqv1k/LriyXeelSRPKrH 9uzEWIwk6fEm/R/jLJk2CrsuwF2cG0qL2JZPWl32YqnAUUHV7K2k9TMwxL5QtdIwAq lZYu5BVdiKd/ac5nq+TnjB674+m+m53xGHm90xmAzo0WSDyQfcUWEmWGKJvJNRfqXr oSFWyy9zmgHcBQ5E4xMTsoSFdPkI3GgMeHWvgSXOuY0u2/Sray33X5F5oAcS8bOvtW DClFa8dVN44hdoXMxs2IddtdFikXUUmJmwwiRAGWFNXt6zvV8GI1Xvi74wC7Srbxuu WKKPLMzkQk6uA== Subject: Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add flow shared action 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Andrey, PSB, Best, Ori > -----Original Message----- > From: Andrey Vesnovaty > Sent: Tuesday, October 6, 2020 11:09 PM > Subject: [PATCH v4 1/2] ethdev: add flow shared action API >=20 > This commit introduces extension of DPDK flow action API enabling > sharing of single rte_flow_action in multiple flows. The API intended for > PMDs, where multiple HW offloaded flows can reuse the same HW > essence/object representing flow action and modification of such an > essence/object affects all the rules using it. >=20 > Motivation and example > =3D=3D=3D > Adding or removing one or more queues to RSS used by multiple flow rules > imposes per rule toll for current DPDK flow API; the scenario requires > for each flow sharing cloned RSS action: > - call `rte_flow_destroy()` > - call `rte_flow_create()` with modified RSS action >=20 > API for sharing action and its in-place update benefits: > - reduce the overhead of multiple RSS flow rules reconfiguration > - optimize resource utilization by sharing action across multiple > flows >=20 > Change description > =3D=3D=3D >=20 > Shared action > =3D=3D=3D > In order to represent flow action shared by multiple flows new action > type RTE_FLOW_ACTION_TYPE_SHARED is introduced (see `enum > rte_flow_action_type`). > Actually the introduced API decouples action from any specific flow and > enables sharing of single action by its handle across multiple flows. >=20 > Shared action create/use/destroy > =3D=3D=3D > Shared action may be reused by some or none flow rules at any given > moment, i.e. shared action reside outside of the context of any flow. > Shared action represent HW resources/objects used for action offloading > implementation. > API for shared action create (see `rte_flow_shared_action_create()`): > - should allocate HW resources and make related initializations required > for shared action implementation. > - make necessary preparations to maintain shared access to > the action resources, configuration and state. > API for shared action destroy (see `rte_flow_shared_action_destroy()`) > should release HW resources and make related cleanups required for shared > action implementation. >=20 > In order to share some flow action reuse the handle of type > `struct rte_flow_shared_action` returned by > rte_flow_shared_action_create() as a `conf` field of > `struct rte_flow_action` (see "example" section). >=20 > If some shared action not used by any flow rule all resources allocated > by the shared action can be released by rte_flow_shared_action_destroy() > (see "example" section). The shared action handle passed as argument to > destroy API should not be used any further i.e. result of the usage is > undefined. >=20 > Shared action re-configuration > =3D=3D=3D > Shared action behavior defined by its configuration can be updated via > rte_flow_shared_action_update() (see "example" section). The shared > action update operation modifies HW related resources/objects allocated > on the action creation. The number of operations performed by the update > operation should not depend on the number of flows sharing the related > action. On return of shared action update API action behavior should be > according to updated configuration for all flows sharing the action. >=20 > Shared action query > =3D=3D=3D > Provide separate API to query shared action state (see > rte_flow_shared_action_update()). Taking a counter as an example: query > returns value aggregating all counter increments across all flow rules > sharing the counter. This API doesn't query shared action configuration > since it is controlled by rte_flow_shared_action_create() and > rte_flow_shared_action_update() APIs and no supposed to change by other > means. >=20 > PMD support > =3D=3D=3D > The support of introduced API is pure PMD specific design and > responsibility for each action type (see struct rte_flow_ops). >=20 > testpmd > =3D=3D=3D > In order to utilize introduced API testpmd cli may implement following > extension > create/update/destroy/query shared action accordingly >=20 > flow shared_action (port) create {action_id (id)} (action) / end > flow shared_action (port) update (id) (action) / end > flow shared_action (port) destroy action_id (id) {action_id (id) [...]} > flow shared_action (port) query (id) >=20 > testpmd example > =3D=3D=3D >=20 > configure rss to queues 1 & 2 >=20 > > flow shared_action 0 create action_id 100 rss queues 1 2 end / end >=20 > create flow rule utilizing shared action >=20 > > flow create 0 ingress \ > pattern eth dst is 0c:42:a1:15:fd:ac / ipv6 / tcp / end \ > actions shared 100 / end >=20 > add 2 more queues >=20 > > flow shared_action 0 modify 100 rss queues 1 2 3 4 end / end >=20 > example > =3D=3D=3D >=20 > struct rte_flow_action actions[2]; > struct rte_flow_action action; > /* skipped: initialize action */ > struct rte_flow_shared_action *handle =3D rte_flow_shared_action_create( > port_id, &action, &error); > actions[0].type =3D RTE_FLOW_ACTION_TYPE_SHARED; > actions[0].conf =3D handle; > actions[1].type =3D RTE_FLOW_ACTION_TYPE_END; > /* skipped: init attr0 & pattern0 args */ > struct rte_flow *flow0 =3D rte_flow_create(port_id, &attr0, pattern0, > actions, error); > /* create more rules reusing shared action */ > struct rte_flow *flow1 =3D rte_flow_create(port_id, &attr1, pattern1, > actions, error); > /* skipped: for flows 2 till N */ > struct rte_flow *flowN =3D rte_flow_create(port_id, &attrN, patternN, > actions, error); > /* update shared action */ > struct rte_flow_action updated_action; > /* > * skipped: initialize updated_action according to desired action > * configuration change > */ > rte_flow_shared_action_update(port_id, handle, &updated_action, error); > /* > * from now on all flows 1 till N will act according to configuration of > * updated_action > */ > /* skipped: destroy all flows 1 till N */ > rte_flow_shared_action_destroy(port_id, handle, error); >=20 > Signed-off-by: Andrey Vesnovaty > --- > doc/guides/rel_notes/release_20_11.rst | 9 ++ > lib/librte_ethdev/rte_ethdev_version.map | 4 + > lib/librte_ethdev/rte_flow.c | 84 ++++++++++++ > lib/librte_ethdev/rte_flow.h | 161 ++++++++++++++++++++++- > lib/librte_ethdev/rte_flow_driver.h | 23 ++++ > 5 files changed, 280 insertions(+), 1 deletion(-) >=20 Missing rte_flow.rst update. [snip ...]