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 97184A0547; Sun, 17 Oct 2021 10:10:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2167D40041; Sun, 17 Oct 2021 10:10:53 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2063.outbound.protection.outlook.com [40.107.92.63]) by mails.dpdk.org (Postfix) with ESMTP id 72DA44003C for ; Sun, 17 Oct 2021 10:10:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VG2QDdBNjmxpN40aZQdoKZrF+n4M1llEI80LxNCUeJ6PMIj6UBx1Vf+x80VeEOwfR5lSHjsfrOPLJGQG9Zx2j8lqeb2ly5drxw87Erczwi/xuwueue77U0InYr2NAembqipJrbymDLd/S/nBL/3193G9TeErU/cqOE54IIF7fG9/ltdDJ6yfyP39niwYA+X3A7b7Py1+1M1mMRlOOdubYpR5jCqeH2I/ygmXFSJqxdzk012r7S8g/3+fPxQxh25yA5+71ObtxS/UV3FwRBMy3Jt68WhqnLUXC8fR8k6JujO4f19/C3fEo1+Awil0ifMN+7ZbYVLrco74qrPXxqh/JA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HSba29n8BloPFAYuVYMD3kY24MPuQ0OANnTmdG52lpc=; b=i2YwRUUJz0xy8PYj9stfmuyhdc1Hz6rrd74NJX8/N9jGPdKv3yDMHHKPI2Lo8QvknXzQ79YqzGOLSnTtBOdj9QRe80JCCLBcELMoBe+vbsIgcK1+b1Lb8fDmLDPWlwCFWKIFfKB6p0WJCllWbQmMH9hDEu42ZHLDtQsYWixg1AUJIE4gYFReIKuVr6P6kxUgdjwBUSOsS1lqegaRGsyktVGGf68DDzOczkutqUnOnUikHjKgyMexjCaNLLDs2xTYk9S0d4oALNzIfx5dIvGfsLSm8I58cvaqx5BBFTlxezL4o9dWSpnpG5TsKGb2WJPXgfnB+uBarurQ9XM8sNW/3w== 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=HSba29n8BloPFAYuVYMD3kY24MPuQ0OANnTmdG52lpc=; b=HXtBIVarZq+4VKIMpmgBy63fuPryy9sQ1QZyXroOBu/RaMuG1o6gfbnw+Qt3A+8R+7niQL45DyvIeOsT680mdhnud/20ud1V6flUT0QD1SyjCza/3T96U+MCJAwmaAl2yJvTRft0/rWgMCUMt6/YY1I3EifJa3Q83cSgWnbm1AJePRFhizwhpPKOrWvAq1p8odYEOQbGckLSNa8pr+VZzHX50UiqzmMTQ+JvIfooZ1dkgDaVk6ca5NUX305uYYmsK3nGZrfucbo0mB2P/f8OyXJ8dQZFwx8uzPOp5y+OdKtfQDfuTzD/xx+rWkbvLm5FuKUXmzna74RcsIev9LuRgg== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5310.namprd12.prod.outlook.com (2603:10b6:5:39e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Sun, 17 Oct 2021 08:10:49 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32%7]) with mapi id 15.20.4608.018; Sun, 17 Oct 2021 08:10:49 +0000 From: Ori Kam To: Dmitry Kozlyuk , "dev@dpdk.org" CC: NBU-Contact-Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Thread-Topic: [PATCH v2 2/5] ethdev: add capability to keep shared objects on restart Thread-Index: AQHXweBSEnuELz3mOkmY6XNTB/cjw6vW1trg Date: Sun, 17 Oct 2021 08:10:49 +0000 Message-ID: References: <20211005005216.2427489-1-dkozlyuk@nvidia.com> <20211015161822.3099818-1-dkozlyuk@nvidia.com> <20211015161822.3099818-3-dkozlyuk@nvidia.com> In-Reply-To: <20211015161822.3099818-3-dkozlyuk@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-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d0926abe-0000-46e1-0b56-08d99145a171 x-ms-traffictypediagnostic: DM4PR12MB5310: 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:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2SF8Cys/yuTTFlNszQ1+gDgPOx6/vzEQTg8FxLn2a0UvqgUkmiYSQ8tB87sCADmkMrgTvcl3MvC8gkIm0YtbHpfb5Eb2pZO+VUQevrUiQymGPO946d88sGtP+kIl+ZzCqXDQ9HdRRcU3f0rx5rDW6mrVzhpNlSizFkGE89A9wQItaQW3IImkjSfbvjnTBW2Q+LTZiuLgxUPzD+QjTuZy0oAmOMKpvM3o2PgAYSw40767BNmWi20INL5TwdvowcQXy4YoowDjjarEuPpbsd0Sc5w/Rg4rnj6TkF2u4MmMXkeal5EiOqBzbR2TKfkO0LMLlN+HIRaDoCazuAfAD22iFN8xiqviFqukvXS0AFgTl2wEnHkShwthk3vl11WXndawZzrMmglrBGz0tXOh8iJf1li6EK0UF0cPbaQIDSaD1JCr8uiYIU3epK3l0fttDVSwiDNyJeQF2+JpgZ4hPqZY4fG47SVHzALlqYtAQfWN4TicwwX2Vk9fuIzxm3ekI4xxPbrXGEU9JDdqs7JPYaQL7kwIF8XRcWeGOMDziResAIFhO1w5mxs7bnV3ADlO1nk3FoCwdF0mMZvpwUsIFrZnFbHbW5hyl8Ra8P71yDWfEFiGE7y+tGAnUYEKix2S7PrOzaEUF8NYOrH1vxvFWzcCZ5lQ5yJM0eDipRYOmHyNnTwjmLg+tAp0dY12M5tScOQ0tJbStnq6qiF37MZi9ayBbw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR12MB5400.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66556008)(64756008)(66446008)(76116006)(38070700005)(4326008)(66476007)(52536014)(66946007)(86362001)(38100700002)(8676002)(2906002)(8936002)(54906003)(110136005)(83380400001)(316002)(508600001)(71200400001)(9686003)(186003)(53546011)(6506007)(55016002)(122000001)(5660300002)(7696005)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qjiZeAXcztYg/Q3naMD7NjstWNFEuKqTk20vYJKxnlcAeIlliapfGdj7HISM?= =?us-ascii?Q?nI00KhI2MLMCLQbB4JAcOXmlBEgA+4hZ3TCVWajwhTz6/IXSwMg85BP9ptL0?= =?us-ascii?Q?BXjccC1bIVySL3EKxCaLJJWmr7/mPsTM1rrPa8dIU3blR3ubmuLBkMUqxCb3?= =?us-ascii?Q?nNG8ry0WxEIwIbpJVddLWulsiR5TkiylFcGtrIC0xz6756FN6g3QroOXEJSa?= =?us-ascii?Q?e0UY8enHsOJZHpAspdPH92mHmOt2VW7R+IRAiUK6QwFwzvvVAXyQ+EppnVzZ?= =?us-ascii?Q?Z1fukh7MYIENlXof7Tek7h1fARmoNiBZtG/U1rt7MvcSF9HakLWjT5iesfwO?= =?us-ascii?Q?JtzlqmcIJt4ZLIaC5UXdGos7349q47G0L01MDvTDR2ab1+qmeRbHaqYC4x30?= =?us-ascii?Q?Uzfv7aj11HsPzWHpaCSEowVoObqD6cJcGlDwh6NQNsQLqHmky71mjcy5F9db?= =?us-ascii?Q?btlshvvQ8RG42wxKzyBwGWvytXqeCfjAX1sHtAlxVgpquLGROoHPysG3L3Cz?= =?us-ascii?Q?MKCnDatNBP/weJ01YLf0oHEgS4om3vWo6sYzvQIWR96uR7rR/m9R03MwLY71?= =?us-ascii?Q?MnVegXKAAsQa1zl6yTyeQ+ZHJ4EV35RatOL1WojIhGSuJr5ivdDOCpZ9M1OY?= =?us-ascii?Q?MMPjE0uxz5CVahfnMlDdP/gSThwih52FXC/GMTtk3AxD3RxXTNDbaat6OIyL?= =?us-ascii?Q?yF+42AYNWdBOwdd26gnCavYFapmG686KD4fkk/ivw1goRXnwP4/lFrwPrBmI?= =?us-ascii?Q?AeiKzFRw1jkOFIJjAPmvIspfklN3i9ya2atlXnu/WxKAsE+MByh2XkjAr6nP?= =?us-ascii?Q?0fjLQG/Dqacl+ihUMiVHgU+mCNfiej7ywYivjbcG058wR+ENFgT0IKPwPtVH?= =?us-ascii?Q?g/GUOaJQocmUr+qsvPUuztuOFR/Cbe0y8Smdx3t7NKf9i3v14swtf41hgclY?= =?us-ascii?Q?Iek0OiXj30npqS4qg9cqGKNvJF3u0aNPv3NOzuo8sm6xNSEE2+8uP2dTZ+OL?= =?us-ascii?Q?GNq61j0LjOJwhRoFwjOt0t7g4ddAjNdt5YZKAM4knANHelmpaFndH1n7snoa?= =?us-ascii?Q?JUtLifOnSPW6CKbh4n7scEANhEdrQAHPeghrq2BB2xdXYkJbCrvWnaR3SrKm?= =?us-ascii?Q?APCVR7gnF8t6XH2vM+XpTVvmLMHdiYP3DBk+DT4y2yehNqbEDHn4E4Fu+mMA?= =?us-ascii?Q?30sBhtUE0/Q8xjmagBSKAYShELU+2pjl256OCVsEZNqAbD8nw37JsWlDVIdd?= =?us-ascii?Q?O1PmFrltNkBErQKxkHkKY5BO+G/0kskjvfWBrryzMevhT37/Zk+2qvQnsMzV?= =?us-ascii?Q?LmL1u3uQcAwRLbOpkSdHQWZA4VU76cxq5j40dIPJ/gYurCQfJOq19lYfP70K?= =?us-ascii?Q?s76E64eekUbIpTI13c+2a9wfpAIU?= 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: DM8PR12MB5400.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0926abe-0000-46e1-0b56-08d99145a171 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2021 08:10:49.5523 (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: vhFwWoFRywgruVR/Vf614t5j65NO5TgQAgws/6L85JMpP07Q2kxMpEd5ot5XgOoP7ISrTH0ZLjNB6PQToRJXuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5310 Subject: Re: [dpdk-dev] [PATCH v2 2/5] ethdev: add capability to keep shared objects on restart 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" Hi Dmitry > -----Original Message----- > From: Dmitry Kozlyuk > Sent: Friday, October 15, 2021 7:18 PM > To: dev@dpdk.org > Subject: [PATCH v2 2/5] ethdev: add capability to keep shared objects on = restart >=20 > rte_flow_action_handle_create() did not mention what happens with an indi= rect action when a > device is stopped, possibly reconfigured, and started again. It is natura= l for some indirect actions to be > persistent, like counters and meters; keeping others just saves applicati= on time and complexity. > However, not all PMDs can support it. > Also the support may be limited by particular action kinds, that is, comb= inations of action type and the > value of the transfer bit in its configuration. >=20 > Add a device capability to indicate if at least some indirect actions are= kept across the above sequence. > Without this capability the behavior is still unspecified, but now it is = stated explicitly. > In the future, indirect actions may not be the only type of objects share= d between flow rules. The > capability bit intends to cover all possible types of such objects, hence= its name. >=20 > Declare that the application can test for the persistence of a particular= indirect action kind by > attempting to create an indirect action of that kind when the device is s= topped and checking for the > specific error type. > This is logical because if the PMD can to create the flow rule when the d= evice is not started and use it > after the start happens, it is natural that it can move its internal flow= shared object to the same state > when the device is stopped and restore the state when the device is start= ed. >=20 > If the device is being reconfigured in a way that is incompatible with an= existing shared objects, PMD is > required to report an error. > This is mandatory, because flow API does not supply users with capabiliti= es, so this is the only way for > a user to learn that configuration is invalid. For example, if queue coun= t changes and RSS indirect > action specifies queues that are going away, the user must update the act= ion before removing the > queues or remove the action and all flow rules that were using it. >=20 > Signed-off-by: Dmitry Kozlyuk > --- > doc/guides/prog_guide/rte_flow.rst | 24 ++++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 3 +++ > 2 files changed, 27 insertions(+) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/r= te_flow.rst > index b0ced4209b..bf96ad830f 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -2812,6 +2812,30 @@ updated depend on the type of the ``action`` and d= ifferent for every type. > The indirect action specified data (e.g. counter) can be queried by > ``rte_flow_action_handle_query()``. >=20 > +By default it is unspecified if indirect actions persist after the devic= e stop. > +If ``RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP`` is not advertised, then > +indirect actions must be explicitly destroyed before stopping the > +device if the application needs to ensure they are removed. I don't understand the above line, if indirect actions must be explicitly d= estroyed what does it means "if the application needs to ensure?) I think it should say just like now, application should destroy all shared = objects before stopping. If application doesn't call the destroy the state of the action i= s undefined. > +If it is advertised, this means the PMD can keep at least some indirect > +actions across device stop and start with possible reconfiguration in be= tween. > +However, it may be only supported for certain kinds of indirect actions. > +The kind is a combination of the action type and the value of its transf= er bit. > +To test if a particular kind of indirect actions is kept, the > +application must try to create a valid indirect action of that kind > +when the device is stopped (after it has been configured or started prev= iously). > +If it succeeds, all indirect actions of the same kind are kept when the > +device is stopped. > +If it fails with an error of type ``RTE_FLOW_ERROR_TYPE_STATE``, > +indirect actions of this kind are flushed when the device is stopped. > +Indirect actions of a kept kind that are created when the device is > +stopped, including the ones created for the test, will be kept after the= device start. > +Some configuration changes may be incompatible with existing indirect ac= tions. > +In this case ``rte_eth_dev_configure()``, > +``rte_eth_rx/tx_queue_setup()``, and/or ``rte_eth_dev_start()`` will > +fail with a log message from the PMD that should be similar to the one > +that would be emitted by ``rte_flow_action_handle_create()`` if an > +attempt was made to create the offending rule with the new configuration= . > + > .. _table_rte_flow_action_handle: >=20 > .. table:: INDIRECT > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index a0b3= 88bb25..12fc7262eb 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -94,6 +94,7 @@ > * depending on the device capabilities: > * > * - flow rules > + * - flow-related shared objects, e.g. indirect actions > * > * Any other configuration will not be stored and will need to be re-ent= ered > * before a call to rte_eth_dev_start(). > @@ -1452,6 +1453,8 @@ struct rte_eth_conf { #define > RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002 > /** Device supports keeping flow rules across restart. */ #define > RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP 0x00000004 > +/** Device supports keeping shared flow objects across restart. */ > +#define RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP 0x00000008 > /**@}*/ >=20 > /* > -- > 2.25.1 Best, Ori