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 941E1A0C41; Tue, 19 Oct 2021 17:22:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EA1D41216; Tue, 19 Oct 2021 17:22:06 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2084.outbound.protection.outlook.com [40.107.94.84]) by mails.dpdk.org (Postfix) with ESMTP id F15A94117E for ; Tue, 19 Oct 2021 17:22:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B5hnelmI+HhcoQK/HGYczjHvfI68AVu/x70SYEl7gfeQ4HeiJYCEaY7tXA/psltU6H5hzchlK5y4bgYTVJsPL4WiWNhbAcwJ2bOCjxcmcpJTFLa8LcLqUqosAerBLBmchZqxTCOeNQ0Eg5Yw8SoR2rEiFvIe9EmkmBQs+Rg/SpUw0mMSCI2xI94BvE9HX7xFblEM47RSIeGzPMAz7/EhHnYJ4QHUzFEDvDZnwa7sCtWbUceXQA0yJv10aJLsWK21EckDYwrVBx1QJ3r3VIT5iGUYkgwm1OOJRaPVkCEeBTdZnERARicFmpE4ojslY0hh7760/GUq2gfH0ocbpqs6ZA== 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=FsorY3GrD6zuSgwLzvjmH8RGTZsk6xiukiDj70c8gI8=; b=VK0Dn/P68jGwfDko2F5zaZ088lGJGuQGfd8rcVYYNcpplwsgECWWKlkXpEUhfxa/Uj8ZbjQCpDjYVY0Aia7wg8UqpGLfkHO8qaYOKbsDMBFRGqxzeaYju81N3B897VT2E0FaY9VAXfhANwRMwHATDJD4TepgZeRbrFxL4iAMlTkUgCiNoos/PMjRe/2TnMidrhg4qGE6YdOKuJTpnsglHZJzOD8xl7iIdNu4SYC1VePGpxD5BAqhtste7aSQw1SNObdQC9Ub7QdyuDYMs84nVDcW//3qG84TnexvYawQHxJwWReTLo4aHrpZKprYcE65VoC7lsPWaVeJT0abTzy5Ew== 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=FsorY3GrD6zuSgwLzvjmH8RGTZsk6xiukiDj70c8gI8=; b=N8iG6JXWDRk5tRBu3X/M/8ytIPiRtgBXrSmqEi8Zo2X3ap5NnVZkj64loRn6t7MGLCmvoarJ1oyqys5CHA+Yj5lIxCs+uwqAisCq8Qu3qLBR724ExltWKsVtvVW5i+mw4TVDlN8ZKf5W28e8a4/DUqwCdCs81ux8xPS75vNbarsZqD1y43DjrBIMMlIV7uFbbiNg2lpsUwfxUdm3byvrqYhAnZpjL9UtfGtdWaUKrIwIYBZGFKMz0JuZBpQYtPplP5VwRSg4PfuMkwU5nzI1GPUnqbRYZOp/65Dui1nePjnasuHwr7P7p559K1n5A17xvPh+FNMF7Mbn/4SP6qgJ8A== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5120.namprd12.prod.outlook.com (2603:10b6:5:393::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Tue, 19 Oct 2021 15:22:03 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32%6]) with mapi id 15.20.4628.015; Tue, 19 Oct 2021 15:22:03 +0000 From: Ori Kam To: Dmitry Kozlyuk , "dev@dpdk.org" CC: NBU-Contact-Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Thread-Topic: [PATCH v3 2/6] ethdev: add capability to keep shared objects on restart Thread-Index: AQHXxOYnyqqaH7nIPEWs71k/oHxbFKvabGRQ Date: Tue, 19 Oct 2021 15:22:03 +0000 Message-ID: References: <20211015161822.3099818-1-dkozlyuk@nvidia.com> <20211019123722.3414694-1-dkozlyuk@nvidia.com> <20211019123722.3414694-3-dkozlyuk@nvidia.com> In-Reply-To: <20211019123722.3414694-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: 2615e98c-5168-4a90-13dc-08d993143435 x-ms-traffictypediagnostic: DM4PR12MB5120: 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:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fdz8UwSeuL6jXqsra2YkXJafBHmWNdYirrNHJdYRq5sFCiu9M0aEYl5XY9roabyccXdEDK7fK76pMr8dHB9dcYm2bCwwXBWv8trHFtGpZrl7Pt3tgbRG9OSy1T4deqX4Ty5jpi4rFz1ODFw2mz9BRriPziTPFS1q9VW7Bl95Vb3uex0J2e74oaMymLbqgsHwXtmyjlwHuEcQLO/wNHdsnzgLQ4QQ2IEeCh6HpAcOxhPmGBIZX+5GLplrdnwdHyxfrXzP2YV/Tg3x7e1hgFbewmGW9cqnfL6o8q9wxGckskCD5IlgDLG9yBeZIiwrAcQT6KByRGjM1gpCbT4g+jA/dRWb8rkxuPPB5huMvSGIsnIly6GNd4grtk/4SErYUAXkmsTsM/W0PJRfmXja6kpTMTEdDTgXjX77zlr5ipL995H9NnQJ1O8ydlMDnzLiXR3GD5uWRA4Ouzea8uWcMDC/9diSmyGjXG0FoN6Jr6rhU8MrriHV6BjgSOFyxG5/jzul0hQ5puyOL2PGEiVy5Akc1qEv9GS16cJCT70/wzV/iOqmMs/oHXmfS+vI+UXov98FDTBodnCTmuZr4JTDZlpgSomFNrCT/WOAdkdsod/ODHfHIkn0mxJDwcNJHdvzfGKVarB3bhK+fwv8FcojDdb9jwJq0xdrRKTDp/bi0Hfmt7tLV9OXKg/w+2xbxVdfQCwwMMscBCYhp/6X+XbNLabfUg== 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)(4326008)(316002)(52536014)(53546011)(38100700002)(186003)(38070700005)(55016002)(66446008)(71200400001)(110136005)(7696005)(508600001)(76116006)(33656002)(8936002)(122000001)(54906003)(86362001)(66556008)(83380400001)(64756008)(2906002)(66476007)(66946007)(5660300002)(6506007)(8676002)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?umIUAC4JD9jWCyyhJrymjHrluodefbp8sMyV2GCUcaWBu8zVtiupIwpJ4P2M?= =?us-ascii?Q?cNXapsxZRvg/33Kb/yqxnaN1UzW/IVgp2juU17Lg6zAdSfSl+zHn0AT3TXJ+?= =?us-ascii?Q?clLFhVeHhRJ8GYQGqgKk0+iCC7xhMIpNF5H+yjas6wRJ3GXU8gjRI4+wIjUB?= =?us-ascii?Q?4z/KL9c9hFIjF3aXLuDbX23JCDldhnCqiubwQJno3yhmmqm9wNBUktZg2ele?= =?us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EmxV7T67xsTi?= =?us-ascii?Q?s8bGJHvKHINSlOm01r31jHihIlA8MIFlmYJU+NjZo3wF1t2LeRZEpEafMFCs?= =?us-ascii?Q?wgf8k+QgFHLzEhvtPWQ0A0Al6qIch7AgCIT8JUkZ2ARf0N4H+lkvcb+vaabx?= =?us-ascii?Q?oOR5uYqoLsHcJhlmt25FLHkOCkyX2HmsxMUApaLetO9oTyMfDQjvEteXviQc?= =?us-ascii?Q?/LGGaVHQECZVa+4/8wtxheXG/ia+uI4LT+TgqYYTSY8tP61vY52rzzxAW3bw?= =?us-ascii?Q?V7W0r4wJgbr3exJQh42NirC6Ky88?= 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: 2615e98c-5168-4a90-13dc-08d993143435 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2021 15:22:03.2864 (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: UkqlMeuadv4UKKT9AfkOAw9eqAJhGh0uRFyTo3cQgDOeQr79+p+bMjKWZGUSBehnWbjGj4s5yTDxuDHSPnlIFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5120 Subject: Re: [dpdk-dev] [PATCH v3 2/6] 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" > -----Original Message----- > From: Dmitry Kozlyuk > Sent: Tuesday, October 19, 2021 3:37 PM > To: dev@dpdk.org > Cc: Ori Kam ; NBU-Contact-Thomas Monjalon ; Ferruh > Yigit ; Andrew Rybchenko > Subject: [PATCH v3 2/6] 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 and started again. > It is natural for some indirect actions, like counter, to be persistent. > Keeping others at least saves application time and complexity. > However, not all PMDs can support it, or the support may be limited by pa= rticular action kinds, that is, > combinations of action type and the value of the transfer bit in its conf= iguration. >=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, and applicatio= n is required to destroy the > indirect actions before stopping the device. > 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 an indirect action when = the device is not started and > use it after the start happens, it is natural that it can move its intern= al flow shared object to the same > state when the device is stopped and restore the state when the device is= started. >=20 > Indirect action persistence across a reconfigurations is not required. > In case a PMD cannot keep the indirect actions across reconfiguration, it= is allowed just to report an > error. > Application must then flush the indirect actions before attempting 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 ff67b211e3..19e17f453d 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -2810,6 +2810,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 > +If ``RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP`` is not advertised, > +indirect actions cannot be created until the device is started for the > +first time and cannot be kept when the device is stopped. > +However, PMD also does not flush them automatically on stop, so the > +application must call ``rte_flow_action_handle_destroy()`` > +before stopping the device to ensure no indirect actions remain. > + > +If ``RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP`` is advertised, this > +means that the PMD can keep at least some indirect actions across > +device stop and start. > +However, ``rte_eth_dev_configure()`` may fail if any indirect actions > +remain, so the application must destroy them before attempting a reconfi= guration. > +Keeping may be only supported for certain kinds of indirect actions. > +A kind is a combination of an action type and a value of its transfer bi= t. > +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 fails with an error of type ``RTE_FLOW_ERROR_TYPE_STATE``, > +indirect actions of this kind are flushed when the device is stopped. > +If it succeeds, all indirect actions of the same kind are kept 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. > + > .. _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 Acked-by: Ori Kam Best, Ori