From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F694A0524; Tue, 13 Apr 2021 14:36:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95893160F0A; Tue, 13 Apr 2021 14:36:06 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-eopbgr760049.outbound.protection.outlook.com [40.107.76.49]) by mails.dpdk.org (Postfix) with ESMTP id DA989160F09 for ; Tue, 13 Apr 2021 14:36:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jZA5v+yTzuJ34ZFPaSSzVFK70RfKHXO+aZZRVl5XSeJJSIbwC+mumPai8ZtJBHc06Kw3g17MqVjL1jkEn8Zv/7xJoagzAhzWc8yv9/7+TW2nZTg6If4G5n2v1dxW4shP5N29gALwQMKa/VafASG0pehU/nzcv4br2vEYfvpx4bi+2q39rdMBrln5y6S3upau2f00fyeZAytmABBCFA8ywRKu2wDtBlvdRxDa8yLMw3nahQTkmWj7VSqpUC5Anew7Gv7qJ5vEc7hP81ixJpmZdFhUAtvh/3TkBpn2/9LfyDolvR6bBgktp9Hz3/T/27KPnbb2qeWgNxepQkr35/ihww== 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=tP7KWB/yTuuoTV2/zifpZu4oBgI7QXJCvRa/AHdKlt8=; b=cPBy9pLI23v0AG3Oz3yIU6olQkIMTToKf6lzsjg7o5cFOgXbF9dqhmTN4iq3OdhRCnGGyz9l1i8Sp6oU2XQlItcb+yD7diVQTZbf/ZJBi6QsFZBJzTeduMDjDbvyjP8jZd9SMKowanQPZSSuGm/rV8ULFkqmYu8Zgri7YMOJ1JoqURXkCvCtEf9rJ8QpqdaQlCWJXzA7B1SH9hBolnc75vPPMpHrxnO4N8y/EomMkMr9rGP11RRaISGeIFjw1MzYYlB4YpPUgUCCM1si5KyvI5nVSGYMxL53cc5skF50+X2dNAtdRLQWoBjcd/NIXD1br0tRed7WuzKVjLcqzPVhEA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tP7KWB/yTuuoTV2/zifpZu4oBgI7QXJCvRa/AHdKlt8=; b=FAznoaua4RJbiZR7qFVJxq74bfed3rp2N0ZwekbHAIB8ldECqiHjEyNcmbOmqraOlFZNDDLiX7jEYknebLsSG/JZXqX935V7kFHrO5uva8IqD9mc6ZIIoWquc7pvi5AycFEcDur+FF7yF++B67UBNUnC6jtZYrzmw2v4pGr/r4Vt9Oq49h3HvgrEltlMJF4r8sDkiD43BZqEMILAW7y7K9T4HRaBY/hLm7eh8Dlvp8fomXiQ1f//r+XtB90wyZjQLmXLQKBXws81+AqXtFeenFwQ00yXhz7As8VUMOs8LAIpLtQiEk5lUwdUobuq50Pu/rleSeeAmArcdujFIxtWxw== Received: from DM6PR12MB2794.namprd12.prod.outlook.com (2603:10b6:5:48::22) by DM5PR12MB1641.namprd12.prod.outlook.com (2603:10b6:4:10::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Tue, 13 Apr 2021 12:36:02 +0000 Received: from DM6PR12MB2794.namprd12.prod.outlook.com ([fe80::d4c9:7c17:d87e:cc12]) by DM6PR12MB2794.namprd12.prod.outlook.com ([fe80::d4c9:7c17:d87e:cc12%3]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 12:36:02 +0000 From: Andrey Vesnovaty To: Bing Zhao , Ori Kam , NBU-Contact-Thomas Monjalon , "ferruh.yigit@intel.com" , "andrew.rybchenko@oktetlabs.ru" , Matan Azrad , Slava Ovsiienko CC: "dev@dpdk.org" , "ajit.khaparde@broadcom.com" , Gregory Etelson Thread-Topic: [PATCH v2 1/4] ethdev: introduce indirect action APIs Thread-Index: AQHXLhJdbgWOLUW0rEymRGpdG0fiW6qyZTzA Date: Tue, 13 Apr 2021 12:36:02 +0000 Message-ID: References: <1617940481-125528-1-git-send-email-bingz@nvidia.com> <1618063428-206842-1-git-send-email-bingz@nvidia.com> <1618063428-206842-2-git-send-email-bingz@nvidia.com> In-Reply-To: <1618063428-206842-2-git-send-email-bingz@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: [87.71.166.29] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f94126ca-b8e6-4566-9a7a-08d8fe78b31d x-ms-traffictypediagnostic: DM5PR12MB1641: 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:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Guyyt9W0NHGVBcqAQ8fK3GXG7WRcXIhl5ksD8JpmLVldROM8AVnO84WMK06w5OsJZhapZBMz20uVwW/ffO6FYDcDzbsEJOQV8XSCFr+IWMZfobxckGq+0z+NJAPNQL87F2J35YYx04GL3n5CFJmdJ7fpy6x8rR/2YNjhBnJdBvp+ipE/mSD3Lqk+Kskm+th7M0+BVwk19JyZjoetU0zQkTlUvXz7W+IwHKw7vjF5pWdfoEKsnpQcjKnNUe4JqUmnie3KUi0Ez7x9H2co2/q2pxK1YMO3VZbaW1nqM1URg0x15zN/fyNXCSoUf2cfCiVgIcLL3mdgyNxbQSZHHAutYct5CeXpLRzjgRoEOv/Txq5DkEiImcD9chbr/MofTfLbb3zx1eOrMTaEpEvTAysmfrNIX/xfpwcn4qLTc1JRsMo38639ilqtalFg3/8hnNv3cb8zATSBdSYPLPwS/RYarNFq0FhQV5nikSQ4t749NwZGelFS57V570S60YcYoqgR1GtxsEYPHYhnMM02E4MKutCt2EXVvlnE0n91h7VuroG+qUaKiqJMeo9bhxnhTJ06Lg3EjrZMvPJS6rtmXg90+jwmE8/iLJSYS5o3rk4cAXw= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2794.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39860400002)(396003)(366004)(136003)(346002)(54906003)(316002)(33656002)(26005)(7696005)(4326008)(9686003)(110136005)(83380400001)(8676002)(122000001)(6506007)(6636002)(52536014)(53546011)(66476007)(38100700002)(66946007)(107886003)(76116006)(8936002)(2906002)(71200400001)(186003)(66556008)(86362001)(66446008)(30864003)(478600001)(55016002)(5660300002)(64756008)(579004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?DItQq8m6W8VMY1VtgIEMgVlkX6lDXqNHi9BP6k7dPvI9GVg19j8gpnhUiD26?= =?us-ascii?Q?dVr2zWrbm7NocRuI94rlCm01/S9/buyYJKhqDZlk6NBKwmx0hgF4tHI90wJb?= =?us-ascii?Q?YPwoUGZh8n7HsHoUzxfRMcJ7S4rDsQJyYEphQOstyP49zCTpxoqddYN5huWX?= =?us-ascii?Q?SlApnLSOsEQC1PHpagUncKkutkTGjjDx/tzzxDfYHMVW9WK8ZfMiOOc4dvm3?= =?us-ascii?Q?2I/pV+9xjsUt1HP4mekprLsCda3CMK7wjMhAjTPIqK46A81inH3Ezj+mF9fR?= =?us-ascii?Q?36uHL2KOidq9bbwooJxPL5sLzKr2MdrdHJCu4gT5B75VPHaKdjGPCLLA2AgA?= =?us-ascii?Q?MdEpIH3Npig1Oujzh2SChaO8PZhmOh/pFEY7RRCZo58DU42rc0uM2mXe7dX6?= =?us-ascii?Q?9C8l4iQMvZr4ab8XmfVHWMPwgWmAf2zbKff3yz6hsMQItwT/hp09mPnL4QPK?= =?us-ascii?Q?/8F12un3qn5QEieOuEy2/lvZdk8NEPZu+kECZf0WHjXX3ag3a8kEc2wOIO2g?= =?us-ascii?Q?Czf25a6W4WDyeZyGC9vt6iwTqQ1abmlNwJerLF9ElrNYYfX1V7X8c1URcLy/?= =?us-ascii?Q?f8D2UsVFb8vbzoUVmBNJW1Y3WOqRee/0hpK3kP2YBiZynR5V+2Y1zod9XaHQ?= =?us-ascii?Q?MQ2+q6JIQ8ZXsGrzJ/PKnFPqZwhY4Hzn1S5gkUlAJv3S7sodY9gxSHjA7NOD?= =?us-ascii?Q?/q/IiW5z51Bs1kcVxncHiFcsd2OriRvJU2+m6hz5X43kKmyZq4IouRft3FsX?= =?us-ascii?Q?rpcBHXso0KT/01tGZ/AiW/EFu6jBTkvySBLgPMl3nJ8nFun/VfQx2dSISjE7?= =?us-ascii?Q?AA6PeCgCO18SgvcBEOuIHZCwlNjOnZ4YqGUf7zxKVJoPIyCd/TK4+w49BuuP?= =?us-ascii?Q?5kK4VNbpBp8zaIj7o4oOG/UaKBOZ71y7AjfpVcUJka+hBOYTq2KS+QIuwcvj?= =?us-ascii?Q?HObPrdRRFTE9wwgZLpkYZMfaDarhXzNWXfJmhugz6Tl5rP6YrCOPM2ZkGxft?= =?us-ascii?Q?87kj4+v8T5Sa7Q7F1Hd3opZ+esLoqnFUlJA7Rjch0hBdSN9CLb4/NyKtPMxJ?= =?us-ascii?Q?eEmsQBBswXu2CJA6AWanuZ4Ij5WeAZWGDcPMiYhdJGFB8GIwpy8PxO5TvGH1?= =?us-ascii?Q?2fi7M32Hezg6tauTuupqwfkXJsWzTLEd3tV2DTJlrKMAcDIQuUtbhJZRHES3?= =?us-ascii?Q?mmKPbHUGbAYwSkOXlap7SQG/aDtC4zygMduychRg7VBwz91wqa0YxzozU27Q?= =?us-ascii?Q?u+/e+4DRRSEpObs7o5PEkAokykE/iBIXndGvRyOlg0v81zV4Sk9QwEnuC2Zu?= =?us-ascii?Q?w+Y=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2794.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f94126ca-b8e6-4566-9a7a-08d8fe78b31d X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2021 12:36:02.6228 (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: FnecsADpl+a8diq3fLncb090BP4tM+fg903gZfKyfW+gvwv49ncVg2+AB7iANjVQCuVUn/A00qINCQplilDzBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1641 Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: introduce indirect action APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Bing Zhao > Sent: Saturday, April 10, 2021 5:04 PM > To: Ori Kam ; NBU-Contact-Thomas Monjalon > ; ferruh.yigit@intel.com; > andrew.rybchenko@oktetlabs.ru; Matan Azrad ; Slava > Ovsiienko > Cc: dev@dpdk.org; ajit.khaparde@broadcom.com; Gregory Etelson > ; Andrey Vesnovaty > Subject: [PATCH v2 1/4] ethdev: introduce indirect action APIs >=20 > Right now, rte_flow_shared_action_* APIs are used for some shared > actions, like RSS, count. The shared action should be created before > using it inside a flow. These shared actions sometimes are not > really shared but just some indirect actions decoupled from a flow. >=20 > The new functions rte_flow_action_handle_* are added to replace > the current shared functions rte_flow_shared_action_*. >=20 > There are two types of flow actions: > 1. the direct (normal) actions that could be created and stored > within a flow rule. Such action is tied to its flow rule and > cannot be reused. > 2. the indirect action, in the past, named shared_action. It is > created from a direct actioni, like count or rss, and then used > in the flow rules with an object handle. The PMD will take care > of the retrieve from indirect action to the direct action > when it is referenced. >=20 > The indirect action is accessed (update / query) w/o any flow rule, > just via the action object handle. For example, when querying or > resetting a counter, it could be done out of any flow using this > counter, but only the handle of the counter action object is > required. > The indirect action object could be shared by different flows or > used by a single flow, depending on the direct action type and > the real-life requirements. > The handle of an indirect action object is opaque and defined in > each driver and possibly different per direct action type. >=20 > The old name "shared" is improper in a sense and should be replaced. >=20 > All the command lines in testpmd application with "shared_action*" > are replaced with "indirect_action*". >=20 > The parameter of "update" interface is also changed. A general > pointer will replace the rte_flow_action struct pointer due to the > facts: > 1. Some action may not support fields updating. In the example of a > counter, the only "update" supported should be the reset. So > passing a rte_flow_action struct pointer is meaningless and > there is even no such corresponding action struct. What's more, > if more than one operations should be supported, for some other > action, such pointer parameter may not meet the need. > 2. Some action may need conditional or partial update, the current > parameter will not provide the ability to indicate which part(s) > to update. > For different types of indirect action objects, the pointer could > either be the same of rte_flow_action* struct - in order not to > break the current driver implementation, or some wrapper > structures with bits as masks to indicate which part to be > updated, depending on real needs of the corresponding direct > action. For different direct actions, the structures of indirect > action objects updating will be different. >=20 > All the underlayer PMD callbacks will be moved to these new APIs. >=20 > The RTE_FLOW_ACTION_TYPE_SHARED is kept for now in order not to > break the ABI. All the implementations are changed by using > RTE_FLOW_ACTION_TYPE_INDIRECT. >=20 > Signed-off-by: Bing Zhao > --- > doc/guides/rel_notes/release_21_05.rst | 3 + > lib/librte_ethdev/rte_flow.c | 56 ++++++++-------- > lib/librte_ethdev/rte_flow.h | 118 +++++++++++++++++++--------= ------ > lib/librte_ethdev/rte_flow_driver.h | 26 ++++---- > lib/librte_ethdev/version.map | 8 +-- > 5 files changed, 115 insertions(+), 96 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_21_05.rst > b/doc/guides/rel_notes/release_21_05.rst > index 374d6d9..6c0ac46 100644 > --- a/doc/guides/rel_notes/release_21_05.rst > +++ b/doc/guides/rel_notes/release_21_05.rst > @@ -164,6 +164,9 @@ API Changes > from ``rte_thread_tls_*`` to ``rte_thread_*`` to avoid naming redundan= cy > and confusion with the transport layer security term. >=20 > +* ethdev: The experimental shared action APIs in ``rte_flow.h`` has been > + replaced from ``rte_flow_shared_action_*`` to indirect action APIs nam= ed > + ``rte_flow_action_handle_*``. >=20 > ABI Changes > ----------- > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index e07e617..27a1615 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -180,12 +180,12 @@ struct rte_flow_desc_data { > MK_FLOW_ACTION(MODIFY_FIELD, > sizeof(struct rte_flow_action_modify_field)), > /** > - * Shared action represented as handle of type > - * (struct rte_flow_shared action *) stored in conf field (see > + * Indirect action represented as handle of type > + * (struct rte_flow_action_handle *) stored in conf field (see > * struct rte_flow_action); no need for additional structure to * store > - * shared action handle. > + * indirect action handle. > */ > - MK_FLOW_ACTION(SHARED, 0), > + MK_FLOW_ACTION(INDIRECT, 0), > }; >=20 > int > @@ -1067,53 +1067,53 @@ enum rte_flow_conv_item_spec_type { > NULL, rte_strerror(ENOTSUP)); > } >=20 > -struct rte_flow_shared_action * > -rte_flow_shared_action_create(uint16_t port_id, > - const struct rte_flow_shared_action_conf *conf, > +struct rte_flow_action_handle * > +rte_flow_action_handle_create(uint16_t port_id, > + const struct rte_flow_indir_action_conf *conf, > const struct rte_flow_action *action, > struct rte_flow_error *error) > { > - struct rte_flow_shared_action *shared_action; > + struct rte_flow_action_handle *handle; > const struct rte_flow_ops *ops =3D rte_flow_ops_get(port_id, error); >=20 > if (unlikely(!ops)) > return NULL; > - if (unlikely(!ops->shared_action_create)) { > + if (unlikely(!ops->action_handle_create)) { > rte_flow_error_set(error, ENOSYS, > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, > rte_strerror(ENOSYS)); > return NULL; > } > - shared_action =3D ops->shared_action_create(&rte_eth_devices[port_id], > - conf, action, error); > - if (shared_action =3D=3D NULL) > + handle =3D ops->action_handle_create(&rte_eth_devices[port_id], > + conf, action, error); > + if (handle =3D=3D NULL) > flow_err(port_id, -rte_errno, error); > - return shared_action; > + return handle; > } >=20 > int > -rte_flow_shared_action_destroy(uint16_t port_id, > - struct rte_flow_shared_action *action, > - struct rte_flow_error *error) > +rte_flow_action_handle_destroy(uint16_t port_id, > + struct rte_flow_action_handle *handle, > + struct rte_flow_error *error) > { > int ret; > const struct rte_flow_ops *ops =3D rte_flow_ops_get(port_id, error); >=20 > if (unlikely(!ops)) > return -rte_errno; > - if (unlikely(!ops->shared_action_destroy)) > + if (unlikely(!ops->action_handle_destroy)) > return rte_flow_error_set(error, ENOSYS, >=20 > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, rte_strerror(ENOSYS)); > - ret =3D ops->shared_action_destroy(&rte_eth_devices[port_id], action, > - error); > + ret =3D ops->action_handle_destroy(&rte_eth_devices[port_id], > + handle, error); > return flow_err(port_id, ret, error); > } >=20 > int > -rte_flow_shared_action_update(uint16_t port_id, > - struct rte_flow_shared_action *action, > - const struct rte_flow_action *update, > +rte_flow_action_handle_update(uint16_t port_id, > + struct rte_flow_action_handle *handle, > + const void *update, > struct rte_flow_error *error) > { > int ret; > @@ -1121,18 +1121,18 @@ struct rte_flow_shared_action * >=20 > if (unlikely(!ops)) > return -rte_errno; > - if (unlikely(!ops->shared_action_update)) > + if (unlikely(!ops->action_handle_update)) > return rte_flow_error_set(error, ENOSYS, >=20 > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, rte_strerror(ENOSYS)); > - ret =3D ops->shared_action_update(&rte_eth_devices[port_id], action, > + ret =3D ops->action_handle_update(&rte_eth_devices[port_id], handle, > update, error); > return flow_err(port_id, ret, error); > } >=20 > int > -rte_flow_shared_action_query(uint16_t port_id, > - const struct rte_flow_shared_action *action, > +rte_flow_action_handle_query(uint16_t port_id, > + const struct rte_flow_action_handle *handle, > void *data, > struct rte_flow_error *error) > { > @@ -1141,11 +1141,11 @@ struct rte_flow_shared_action * >=20 > if (unlikely(!ops)) > return -rte_errno; > - if (unlikely(!ops->shared_action_query)) > + if (unlikely(!ops->action_handle_query)) > return rte_flow_error_set(error, ENOSYS, >=20 > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, rte_strerror(ENOSYS)); > - ret =3D ops->shared_action_query(&rte_eth_devices[port_id], action, > + ret =3D ops->action_handle_query(&rte_eth_devices[port_id], handle, > data, error); > return flow_err(port_id, ret, error); > } > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index 6cc5713..91ae25b 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -1821,7 +1821,7 @@ enum rte_flow_action_type { > * Enables counters for this flow rule. > * > * These counters can be retrieved and reset through rte_flow_query() > or > - * rte_flow_shared_action_query() if the action provided via handle, > + * rte_flow_action_handle_query() if the action provided via handle, > * see struct rte_flow_query_count. > * > * See struct rte_flow_action_count. > @@ -2267,6 +2267,16 @@ enum rte_flow_action_type { > * See struct rte_flow_action_modify_field. > */ > RTE_FLOW_ACTION_TYPE_MODIFY_FIELD, > + > + /** > + * Describe indirect action that could be used by a single flow rule > + * or multiple flow rules. > + * > + * Allow flow rule(s) reference the same action by the indirect action > + * handle (see struct rte_flow_action_handle), rules could be on the > + * same port or across different ports. > + */ > + RTE_FLOW_ACTION_TYPE_INDIRECT, > }; >=20 > /** > @@ -2357,7 +2367,7 @@ struct rte_flow_query_age { > * ``struct rte_flow_query_count``. > * > * @deprecated Shared attribute is deprecated, use generic > - * RTE_FLOW_ACTION_TYPE_SHARED action. > + * RTE_FLOW_ACTION_TYPE_INDIRECT action. > * > * The shared flag indicates whether the counter is unique to the flow r= ule the > * action is specified with, or whether it is a shared counter. > @@ -2847,17 +2857,23 @@ struct rte_flow_action_set_dscp { > }; >=20 > /** > - * RTE_FLOW_ACTION_TYPE_SHARED > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ACTION_TYPE_INDIRECT > * > - * Opaque type returned after successfully creating a shared action. > + * Opaque type returned after successfully creating an indirect action o= bject. > + * The definition of the object handle will be different per driver or > + * per immediate action type. > * > - * This handle can be used to manage and query the related action: > - * - share it across multiple flow rules > - * - update action configuration > - * - query action data > - * - destroy action > + * This handle can be used to manage and query the related immediate act= ion: > + * - referenced in single flow rule or across multiple flow rules > + * over multiple ports > + * - update action object configuration > + * - query action object data > + * - destroy action object > */ > -struct rte_flow_shared_action; > +struct rte_flow_action_handle; >=20 > /** > * Field IDs for MODIFY_FIELD action. > @@ -3628,25 +3644,22 @@ struct rte_flow_desc { > uint32_t nb_contexts, struct rte_flow_error *error); >=20 > /** > - * Specify shared action configuration > + * Specify indirect action object configuration > */ > -struct rte_flow_shared_action_conf { > +struct rte_flow_indir_action_conf { > /** > - * Flow direction for shared action configuration. > + * Flow direction for the indirect action configuration. > * > - * Shared action should be valid at least for one flow direction, > + * Action should be valid at least for one flow direction, > * otherwise it is invalid for both ingress and egress rules. > */ > uint32_t ingress:1; > /**< Action valid for rules applied to ingress traffic. */ > uint32_t egress:1; > /**< Action valid for rules applied to egress traffic. */ > - > /** > * When set to 1, indicates that the action is valid for > * transfer traffic; otherwise, for non-transfer traffic. > - * > - * See struct rte_flow_attr. > */ > uint32_t transfer:1; > }; > @@ -3655,16 +3668,17 @@ struct rte_flow_shared_action_conf { > * @warning > * @b EXPERIMENTAL: this API may change without prior notice. > * > - * Create shared action for reuse in multiple flow rules. > - * The created shared action has single state and configuration > - * across all flow rules using it. > + * Create an indirect action object that can be used by flow create, and > + * could also be shared by different flows. > + * The created object handle has single state and configuration > + * across all the flow rules using it. > * > * @param[in] port_id > * The port identifier of the Ethernet device. > * @param[in] conf > - * Shared action configuration. > + * Action configuration for the indirect action object creation. > * @param[in] action > - * Action configuration for shared action creation. > + * Specific configuration of the indirect action object. > * @param[out] error > * Perform verbose error reporting if not NULL. PMDs initialize this > * structure in case of error only. > @@ -3678,9 +3692,9 @@ struct rte_flow_shared_action_conf { > * - (ENOTSUP) if *action* valid but unsupported. > */ > __rte_experimental > -struct rte_flow_shared_action * > -rte_flow_shared_action_create(uint16_t port_id, > - const struct rte_flow_shared_action_conf *conf, > +struct rte_flow_action_handle * > +rte_flow_action_handle_create(uint16_t port_id, > + const struct rte_flow_indir_action_conf *conf, > const struct rte_flow_action *action, > struct rte_flow_error *error); >=20 > @@ -3688,12 +3702,12 @@ struct rte_flow_shared_action * > * @warning > * @b EXPERIMENTAL: this API may change without prior notice. > * > - * Destroy the shared action by handle. > + * Destroy indirect action by handle. > * > * @param[in] port_id > * The port identifier of the Ethernet device. > - * @param[in] action > - * Handle for the shared action to be destroyed. > + * @param[in] handle > + * Handle for the indirect action object to be destroyed. > * @param[out] error > * Perform verbose error reporting if not NULL. PMDs initialize this > * structure in case of error only. > @@ -3708,27 +3722,30 @@ struct rte_flow_shared_action * > */ > __rte_experimental > int > -rte_flow_shared_action_destroy(uint16_t port_id, > - struct rte_flow_shared_action *action, > +rte_flow_action_handle_destroy(uint16_t port_id, > + struct rte_flow_action_handle *handle, > struct rte_flow_error *error); >=20 > /** > * @warning > * @b EXPERIMENTAL: this API may change without prior notice. > * > - * Update in-place the shared action configuration pointed by *action* h= andle > - * with the configuration provided as *update* argument. > - * The update of the shared action configuration effects all flow rules = reusing > - * the action via handle. > + * Update in-place the action configuration and / or state pointed > + * by action *handle* with the configuration provided as *update* argume= nt. > + * The update of the action configuration effects all flow rules reusing > + * the action via *handle*. > + * The update general pointer provides the ability of partial updating. > * > * @param[in] port_id > * The port identifier of the Ethernet device. > - * @param[in] action > - * Handle for the shared action to be updated. > + * @param[in] handle > + * Handle for the indirect action object to be updated. > * @param[in] update > - * Action specification used to modify the action pointed by handle. > - * *update* should be of same type with the action pointed by the *act= ion* > - * handle argument, otherwise considered as invalid. > + * Update profile specification used to modify the action pointed by h= andle. > + * *update* could be with the same type of the immediate action > corresponding > + * to the *handle* argument when creating, or a wrapper structure incl= udes > + * action configuration to be updated and bit fields to indicate the m= ember > + * of fields inside the action to update. > * @param[out] error > * Perform verbose error reporting if not NULL. PMDs initialize this > * structure in case of error only. > @@ -3739,32 +3756,32 @@ struct rte_flow_shared_action * > * - (-EIO) if underlying device is removed. > * - (-EINVAL) if *update* invalid. > * - (-ENOTSUP) if *update* valid but unsupported. > - * - (-ENOENT) if action pointed by *ctx* was not found. > + * - (-ENOENT) if indirect action object pointed by *handle* was not f= ound. > * rte_errno is also set. > */ > __rte_experimental > int > -rte_flow_shared_action_update(uint16_t port_id, > - struct rte_flow_shared_action *action, > - const struct rte_flow_action *update, > +rte_flow_action_handle_update(uint16_t port_id, > + struct rte_flow_action_handle *handle, > + const void *update, > struct rte_flow_error *error); >=20 > /** > * @warning > * @b EXPERIMENTAL: this API may change without prior notice. > * > - * Query the shared action by handle. > + * Query the direct action by corresponding indirect action object handl= e. > * > * Retrieve action-specific data such as counters. > * Data is gathered by special action which may be present/referenced in > * more than one flow rule definition. > * > - * \see RTE_FLOW_ACTION_TYPE_COUNT > + * @see RTE_FLOW_ACTION_TYPE_COUNT > * > * @param port_id > * Port identifier of Ethernet device. > - * @param[in] action > - * Handle for the shared action to query. > + * @param[in] handle > + * Handle for the action object to query. > * @param[in, out] data > * Pointer to storage for the associated query data type. > * @param[out] error > @@ -3776,10 +3793,9 @@ struct rte_flow_shared_action * > */ > __rte_experimental > int > -rte_flow_shared_action_query(uint16_t port_id, > - const struct rte_flow_shared_action *action, > - void *data, > - struct rte_flow_error *error); > +rte_flow_action_handle_query(uint16_t port_id, > + const struct rte_flow_action_handle *handle, > + void *data, struct rte_flow_error *error); >=20 > /* Tunnel has a type and the key information. */ > struct rte_flow_tunnel { > diff --git a/lib/librte_ethdev/rte_flow_driver.h > b/lib/librte_ethdev/rte_flow_driver.h > index da594d9..8d825eb 100644 > --- a/lib/librte_ethdev/rte_flow_driver.h > +++ b/lib/librte_ethdev/rte_flow_driver.h > @@ -83,27 +83,27 @@ struct rte_flow_ops { > void **context, > uint32_t nb_contexts, > struct rte_flow_error *err); > - /** See rte_flow_shared_action_create() */ > - struct rte_flow_shared_action *(*shared_action_create) > + /** See rte_flow_action_handle_create() */ > + struct rte_flow_action_handle *(*action_handle_create) > (struct rte_eth_dev *dev, > - const struct rte_flow_shared_action_conf *conf, > + const struct rte_flow_indir_action_conf *conf, > const struct rte_flow_action *action, > struct rte_flow_error *error); > - /** See rte_flow_shared_action_destroy() */ > - int (*shared_action_destroy) > + /** See rte_flow_action_handle_destroy() */ > + int (*action_handle_destroy) > (struct rte_eth_dev *dev, > - struct rte_flow_shared_action *shared_action, > + struct rte_flow_action_handle *handle, > struct rte_flow_error *error); > - /** See rte_flow_shared_action_update() */ > - int (*shared_action_update) > + /** See rte_flow_action_handle_update() */ > + int (*action_handle_update) > (struct rte_eth_dev *dev, > - struct rte_flow_shared_action *shared_action, > - const struct rte_flow_action *update, > + struct rte_flow_action_handle *handle, > + const void *update, > struct rte_flow_error *error); > - /** See rte_flow_shared_action_query() */ > - int (*shared_action_query) > + /** See rte_flow_action_handle_query() */ > + int (*action_handle_query) > (struct rte_eth_dev *dev, > - const struct rte_flow_shared_action *shared_action, > + const struct rte_flow_action_handle *handle, > void *data, > struct rte_flow_error *error); > /** See rte_flow_tunnel_decap_set() */ > diff --git a/lib/librte_ethdev/version.map b/lib/librte_ethdev/version.ma= p > index 93ad388..4eb561a 100644 > --- a/lib/librte_ethdev/version.map > +++ b/lib/librte_ethdev/version.map > @@ -231,10 +231,6 @@ EXPERIMENTAL { > rte_eth_fec_get_capability; > rte_eth_fec_get; > rte_eth_fec_set; > - rte_flow_shared_action_create; > - rte_flow_shared_action_destroy; > - rte_flow_shared_action_query; > - rte_flow_shared_action_update; > rte_flow_tunnel_decap_set; > rte_flow_tunnel_match; > rte_flow_get_restore_info; > @@ -246,6 +242,10 @@ EXPERIMENTAL { >=20 > # added in 21.05 > rte_eth_representor_info_get; > + rte_flow_action_handle_create; > + rte_flow_action_handle_destroy; > + rte_flow_action_handle_update; > + rte_flow_action_handle_query; > }; >=20 > INTERNAL { > -- > 1.8.3.1 Acked-by: Andrey Vesnovaty