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 EABE9A0C4B; Thu, 21 Oct 2021 09:37:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D39BD410E2; Thu, 21 Oct 2021 09:37:28 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2048.outbound.protection.outlook.com [40.107.94.48]) by mails.dpdk.org (Postfix) with ESMTP id 10D8A40142 for ; Thu, 21 Oct 2021 09:37:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kfDkPv6+5+bR+UNEdjcqOFc/Rem+biAmw1SfKuR0Va6KfqRWH+bmn+kXEb52J9dE2PsECcjVUNGshLfe1IUH5BpnIf36OoDIW6ieaqAJ/Pt+54FRh8zza3hggftDRAKwcuz/UfHUt0ez6EL5PzwR243GFWhDMnT2owvd8kKmgxh9ZmY889ds619pWYPzAGKBQsAotwobZP0wpYTb91/qIo6rv5S4iCdfl4m3VQID3UwD5nTotfHl8tS6QdR4+LjSs4XFlc0FivYAIX2JL6RlTu4gzZk/X6MEcrFXjmds++ZQMngcbo5tJ03IceVOz4DIBzUW7TEAMC1hBb1EjrCF9Q== 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=OELWlZWJ3Xq7yqeCydtShdd83Xae0S5hLMIDRZW8tnM=; b=G9xSFdoxQPyKQICSUGivqcjILYePgGMY16hCUkO5PfOeFNZabjOqpvzrc/NBLMdX5IY62FhByzbU90KBaf+XjxfcuhrF3ogJlLKnZ3SdJ2I8YYnRXeImQ/h3V4agBCeDYlJT8RPl7q1RTZ10SBfEPI4CANizK8mgdm3Z8uHSMEZy73nr+6AN+5QGiE6/7+jYcxuIwRKAZb4MRrnUEVXAf7WNXNlsSrdAgf5EACv6nNjI6AJ4xmdqSYI14lfQ7NZ8H2o1S96FYBhMtix1nE940DL6hMKEa1xHqx4d1QhZ1YGpro2KNtr5MGTB36NEDNIwH22IrPjjfAlEypqfDnS80g== 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=OELWlZWJ3Xq7yqeCydtShdd83Xae0S5hLMIDRZW8tnM=; b=Re1ac1BSLU6/ufY9tdSkqmxBvirGRYCrljYIj3/oXYuYDhvxsABU7f9CxKCf7gcpOJXqlHuAqJCLw5nwujNfTkQ15yh4tK211o0DJ+rRP13ou7USXhzhTy5XW8inYu17X2nVcVzptFKqt8R1bJwpcgqECVhyhYHQ6j9lZV8ZAuu+0egs/+2EnV5yTxmmwaGeEMILWJqGHlDHpYkzUIngrtpvWwSo36dU6z9wu67ErlzH/lt5/OiQroZz09qPnVY3Ph5S7H1sjNw4RfQIE3j4O2Y2VoYR+vREenUWZJFWiOmlOYHTcQc3xl2aJ3kJpoFdNJxdAG/rgp8IEJ8jEk3Ptg== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5152.namprd12.prod.outlook.com (2603:10b6:5:393::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Thu, 21 Oct 2021 07:37:25 +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.018; Thu, 21 Oct 2021 07:37:25 +0000 From: Ori Kam To: Dmitry Kozlyuk , "dev@dpdk.org" CC: NBU-Contact-Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Thread-Topic: [PATCH v4 2/6] ethdev: add capability to keep shared objects on restart Thread-Index: AQHXxkXnMb2i80lGA0CoTxr9EPVcvavdEFGg Date: Thu, 21 Oct 2021 07:37:25 +0000 Message-ID: References: <20211019123722.3414694-1-dkozlyuk@nvidia.com> <20211021063503.3632732-1-dkozlyuk@nvidia.com> <20211021063503.3632732-3-dkozlyuk@nvidia.com> In-Reply-To: <20211021063503.3632732-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: c60d4d2e-e879-458c-f77b-08d99465a08a x-ms-traffictypediagnostic: DM4PR12MB5152: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: om5VcuL0MzV/BEqul2T02GU0C0RaIj0n6eB+2qR5qGZsoPsSsvUKrDlQ5q3tX9v3T66Zs5BP2P2MDKzOyqKM4Oe+1f8Gr6zn+IcmZBnM3n5EmynUSPYUpCNzr1mvJviNwjHXMtEHxHDXfV7PXwOMW0irry1Jo8dMyZfaI/TIMzpHYfJgrhAvGBwmNL+S4iCwJzKBOFRQ8hL9nmVVkORzGj93zw1GVmuse2blp5yJh2Ix9rCA+pa+bHWgF+BP45DsQP5pcbsmUAMN5/sHTOx+JmOAJJDhnZ3a8+wCHs4jWRTU6kWHHPj6CmS4n/B05Mod9E8goS0RBwaZEJjfEh0tFbTxmCYpdrirwXIs0GtvbW0L+p8nVq5KpJZb8H0z0dV6jFn5+sJO22ZUr5Nj4XRMPChc23F/PCdXUudS4gXEmHKvHhT2C4IXL4EWsHUuYGzO7y58MWxdVgcrWdvc4pJSXoR8TlIr0xNQhBI1sN5lemIo6JASqwUCWKVV97wY8V7+4NlKSbUQ9bfZAi0Z6DEycaSfuoK+u3/FJBFaGs3mspWptwpVma6iMa7pSMwBW7KLds8Y8YYGvl3dzVzipYK+VOGTSHZxEKhLCiGIqV5PBjrVzzSuhDKZdII+iZ/mQnQpXTdzfXTfq17CyQKECm5RvvQETITs+fmiMXOStybZkqmvrg2xGAey4DCp6RsGaLOddVSvL7w2MrisblHjgs4SMw== 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)(6506007)(33656002)(316002)(53546011)(122000001)(76116006)(8936002)(55016002)(54906003)(8676002)(38100700002)(9686003)(110136005)(186003)(7696005)(71200400001)(86362001)(5660300002)(66446008)(66946007)(508600001)(66476007)(52536014)(2906002)(83380400001)(38070700005)(4326008)(66556008)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?teByxgNuLt6wAsgR6w3jzUx+fgWS/4oRcnwheLbv8Tq84dnUPJRZ7tHG3UNs?= =?us-ascii?Q?cJy6PVySDwngf+AapKtbwMa25vkiWkAcWzlg4viuM3uDqtic/ZxbXoZpBBca?= =?us-ascii?Q?5yQAJ5foeSrlAqkAaiLuVlNnMU4GsMDiO2nyUlojRCeQ55dEeU3SUd7WGJ+V?= =?us-ascii?Q?iwd9aFGGpx+VHsaa9BsGr7q0r2Vxliljb8C7HLs0VvABi0+Vi4/yQsJfi4M1?= =?us-ascii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7nDz+0N5B?= =?us-ascii?Q?TKbi/Sifb+GUj6tITYRcqVaPe0LWRl/GQq9IxRGPEMKImxnCP6l0WgOKuyBW?= =?us-ascii?Q?GIlJAl/bNkDXp2md+yGZGKxzzatYbNn7gCmANMrzfQt5Vb8Y1d2saiQbkHvJ?= =?us-ascii?Q?2Bmr3n2EpF3N/2B/l09QxBF3AYrgmxx/18qCeHNOZ6obz+vFMOhEn8xXD+DV?= =?us-ascii?Q?h6iYLE2e1ijSNjAFr/7/QqDKeBICNK8yQFjJd92FaYGJtFRJgyxfz7dgDj2D?= =?us-ascii?Q?o0DVxF3i0NUK80ngY4xStoX+oYeH71HjIL/e2pV/V+tTIenuWEqxOz1ltehI?= =?us-ascii?Q?CSJCa4dStwWikDTAN1YkCw3fJfs0060nkTn3Jkb9rWpw096uvkkUeS7SA7T4?= =?us-ascii?Q?fIKZj8RuIZU543M=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: DM8PR12MB5400.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c60d4d2e-e879-458c-f77b-08d99465a08a X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2021 07:37:25.4540 (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: orika@nvidia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5152 Subject: Re: [dpdk-dev] [PATCH v4 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" Hi Dmitry, > -----Original Message----- > From: Dmitry Kozlyuk > Sent: Thursday, October 21, 2021 9:35 AM > Subject: [PATCH v4 2/6] ethdev: add capability to keep shared objects on = restart >=20 > rte_flow_action_handle_create() did not mention what happens > with an indirect 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 particular action kinds, that is, combinations 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, and application is required to destroy > the indirect actions before stopping the device. > In the future, indirect actions may not be the only type of objects > shared 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 stopped > 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 internal 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 | 26 ++++++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 3 +++ > 2 files changed, 29 insertions(+) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/r= te_flow.rst > index 9beaae3df3..bef143862b 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -2965,6 +2965,32 @@ 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 f= irst 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 re= main, > +so the application must destroy them before attempting a reconfiguration= . > +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. > +For example: an indirect counter with the transfer bit reset. > +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 not started (either before the first start of after a= stop). > +If it fails with an error of type ``RTE_FLOW_ERROR_TYPE_STATE``, > +application must destroy all indirect actions of this kind > +before stopping the device. > +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 stop= ped, > +including the ones created for the test, will be kept after the device s= tart. > + > .. _table_rte_flow_action_handle: >=20 > .. table:: INDIRECT > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 9cf23fecce..5375844484 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