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 3E56BA04BA; Wed, 7 Oct 2020 15:01:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8CD941BACD; Wed, 7 Oct 2020 15:01:34 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id B348E1BA9E for ; Wed, 7 Oct 2020 15:01:32 +0200 (CEST) Received: from HKMAIL103.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 07 Oct 2020 21:01:30 +0800 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 7 Oct 2020 13:01:17 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 7 Oct 2020 13:01:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kFg2DLW02zU74yDIr4mFcKJQzLnmhUZXDW5GFiP3ym3WEvq6NpmgNyXk55yUBKL0MN20Oj2YpuMjkxLFFbtvT+5Tx4e9PIr50TfnPaHvlWKswzI9+HevCy/keg01+oePaPKd6eVlybym3Tx6WgpZR4gG37IpXCeXxz+AXCzZWIzvU8V+PyUahc7JHvBRp6XRJmRozE+hQzMYyKRr+mkKc9ZccQZ48yj5CGwcF5ESzASWFj7fdngvTgr/5u+8ilXJ5UchvYoNjAQ9lPS2kRU/qmogdLY4G484Z+Nw/PF7rrCdR+g1zAbwYJpdCNgZijJEebwtmLwmmSUueQSV0gMUKA== 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=fs9oK8Iwks4EHjmHKV/BxBZ+YXwpXmhYUFCILiFk/jI=; b=cn0xMq5vbXMSTLwvQPJt7wvotpJIG1/nrd61jb0oONDI/r4RTIRlq5BMukZuBrpDcDUCEI2e6Mm8Qt0XguIYCFcHdsuh1KO2Y3wIT0S5KZvQlT/lbTVNR6egrVvp5vm2DFrBL9OWrcD3DKFfINLLZxCKKXfY5ScN0/UKcgMWT5f8lFpQZhjx72JxKJ0D2p0IyxAf09qnNzUMlli5Y5NfD2ZfQlLQUZMDit1L3RvCjHULC/YEP9R1w+sVECbpbwXKFHuLQjx3/BeihyH2EbEB589sFMHJ+0aYwdf4HaIpBp24FWObtpo0CVzMyWdW9ItIzK2jmy7tEqQFLM9wL/psPg== 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 MN2PR12MB3744.namprd12.prod.outlook.com (2603:10b6:208:166::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34; Wed, 7 Oct 2020 13:01:11 +0000 Received: from MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f]) by MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f%9]) with mapi id 15.20.3455.023; Wed, 7 Oct 2020 13:01:11 +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" , Andrew Rybchenko Thread-Topic: [dpdk-dev] [PATCH v5 1/2] ethdev: add flow shared action API Thread-Index: AQHWnKlp1jkDABc1E0eLjGvg2jFXMamMGkIA Date: Wed, 7 Oct 2020 13:01:11 +0000 Message-ID: References: <20200702120511.16315-1-andreyv@mellanox.com> <20201007125612.20579-1-andreyv@nvidia.com> <20201007125612.20579-2-andreyv@nvidia.com> In-Reply-To: <20201007125612.20579-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: 2d661340-255e-4800-5fe9-08d86ac11096 x-ms-traffictypediagnostic: MN2PR12MB3744: 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:1122; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: a4aHbPqjaR+4VgChWNYOT/WDa0hO3bVAPLiQE8WCBUxQZr7Rr06K/4dP9jH09AeG2r7T0tPBghb7ST4o2HBN7ATyEIfrNQ6FvGulRhmbAOurgwR8eGMpt0yI3R44JiQhLfU29Lp/A5HWk+CMXzpIXik3Dsl3oN9GrOp6gN7mN4zs5SacMjM5fQxvGIk6dy+6ZzpRNW/8TWSRfqCtp3FsXsw+Pbb70pj2MPQrBNJ8xiYE3WqJCyLIA1BzS37CdPwumAECiiVl8ZxSW7DDZi3e7vzeQckqkh11/Zf4lx+RoQdTsRhLcFlF7TcguZeq78/VWETONwCw9eVN6JlTgI++TQ== 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)(366004)(346002)(396003)(376002)(136003)(39860400002)(66556008)(66476007)(66446008)(64756008)(66946007)(4326008)(76116006)(5660300002)(186003)(52536014)(8676002)(53546011)(33656002)(26005)(2906002)(7416002)(55016002)(316002)(7696005)(478600001)(71200400001)(8936002)(110136005)(54906003)(86362001)(83380400001)(9686003)(6506007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: e9nc8T7qIdlo0iqTW1lAGGz8JGpK0MRrd+g3t3377KNtOtzC3ReQXhs19e3dKPa+d9a9HpDPOKpj7Y3o0nv3KwAzYh7yx9cOGX4xG4rcNgDvDZynBSlvpV/h9xESgCtx3+aKpFZWo1TwMKuKetqeE/2vfhaMui3KP+uv4IWr/3TYJPbE0I2SOa6deS4MSUivYFO3+O4UOA14KfwquiGIjSn3JAKxr8j7m8ka//iw0Hg0oCfJvk1ptFF80hbBaDy+j/s1RZHDii3PPxd4B0C+CVSplLtvCZCuanpFr6Rl6wKOn0OTMAN6utxwRpa6WBvhjTXL9xkLduGEdNrLKhwVuMJpEAZv0/dDM90c6xZVYx6o0miY6ndsqMjcSrepKOr+3C6kJbY/WbidHDjNgHkzK5KkQpHxe1nkW9nhF/sAUftcgqrjwdYvoPHxcx9C+l6p0Ft+oolP/0y14z1S5lOpyGcDTxHWmQ2qn9ET9wOL0/13piX2R2ftHUpS3hfOrxMgC0j1cniI52+B0QTXt658Q+ppPTwB+5zyVJ2cLyxKtQqrpDAILkrqJvz7yVeq9Wwnflt9NdeLGEdfdDffsVGqHn9bsZva7zqdeFDK9rhHu9o0Q+6qBU5nzjTEwgvUm5D6K+HqoOSd+99PCckZuVG26g== 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: 2d661340-255e-4800-5fe9-08d86ac11096 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2020 13:01:11.0775 (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: vS59WHforVx+19J6Latu3nSOOPHG3lrch1etd979l0eCxCLK2A9Y7cObraU91wA48enhO4h4EXm0HGxVaet8MQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3744 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602075690; bh=fs9oK8Iwks4EHjmHKV/BxBZ+YXwpXmhYUFCILiFk/jI=; 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=m3QpAUlrRY5asmFeb4642pHG2PLBR8uQ/5uDvyfqqvaSX8GRZAFEQeYkDxxYmfOdq mw3O9U/+35M9OCKuZ7IAZhWdYPgA4wqZyY0wVO7BKz/He2jYZWlRqPTUxPL4/liPkG r59HSlkXNTp06MB2wt6Xt0R+gbSBvHCJY2h8L8NkCgMD5C15L22M+N5L+hMup37DH0 ZuMRCV5LZAKdpmLxBiECdgq8dBLWG9s22xSq9HT/1toIDffTYY3tzx/brurJCRru4T OPYAGeToxcw2UHyhABISa8m0xVyUB+PGZYmDvdq8drd8ihS7ysFEWGrtALEw6oN9au UuCJlKEWbpxVA== Subject: Re: [dpdk-dev] [PATCH v5 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, > -----Original Message----- > From: dev On Behalf Of Andrey Vesnovaty > Sent: Wednesday, October 7, 2020 3:56 PM > Subject: [dpdk-dev] [PATCH v5 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 > --- > 2.26.2 Acked-by: Ori Kam Thanks, Ori