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 C8519A034F; Wed, 28 Jul 2021 11:50:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE58040E64; Wed, 28 Jul 2021 11:50:08 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) by mails.dpdk.org (Postfix) with ESMTP id 1631740142; Wed, 28 Jul 2021 11:50:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fqKfjbrmWGOZakTKDMpNTFjWb9ViXbFNRbwk9IU0WkGir4nrRp4prNeGs/hnO1Z/lvaiTMTR+1knkuGWW5v+g4siy6HnUzxbzRbdbvSrEEMNm7Xonrb8BxR+o8mdG4YfSrmJIFhde2GUEOcmj1tPV27knHAIcaBePJHxtGyH8FE6j/Wgf0EYBLMDk0emLhVwwZkE1AHfNxg3dg2kkRmPFTKyegebgbDOW8STuWFDMpZCPYfhK5tr6/f7+F+DsHb6XlnPsTZ194Juwu+qG5YUGhgm8/r5vbM2mf3rM/TBc/KPg2pVNrlREpYPBNL/+5572hVqv2NN5s5DN8fenNhQmQ== 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=K/b02Tm8Ah9ZbjFNHDJmgv3QgQBU5zYKipm8xtogifM=; b=Crj1CQ/F7ckQWnOKc9gzWZPph4mnyYxEa8NeCcsMXu4EF7Hp0diCgjozF8fa8hgPwznHDVmGtLM590+Ph474H6NC6iSax+Uhg7A5G/cuqbu+72yF1xJLAxOML5WeUP198YhtIco+H0UciRhmqKl37PfSeEMR9loa/YKqk8o6J3LQBAgX7Da/VTowQBvT1A9Etmnvr8kxWRu3ljVfqAqPQXHg3zxQDIaXLKWU1M0cPM73J1i/EdNF2RAsNxGylKLBV6J2PFzjX4CG8bXetzMPgFdN1CXr1EtHn0IgDyDcSCM3jx3oAeBPa/2kwd5knuDRm49f+FHvmi4ELrIcNNTwnw== 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=K/b02Tm8Ah9ZbjFNHDJmgv3QgQBU5zYKipm8xtogifM=; b=C8fbMkg9doA7R3O4Xk/+O0Abm0LXEQ/40p+buaKOUKGvIJ/dxUR2piJLwRglvdqp8CjUdAYnt/Eft8dMd9CxsGia80i5jI1jPKnk0fnynAU48Q2+1UXt5IKtihE18qqSntvhYZhuMt7LgTayOFjAG6ScjH8fwKd5uwf2t12SlzFgqkv2mC4MmwG7lIH+YeXyIyv2yy7JB712/m5hYYY+T/e5XtkMBILqHZfVohGvLEU5ynSO+FQzOwQUyhSIjeROMiAr8/t2hLPRo9KfQHR03XJDijB2LzvoNR7of5xFtUZ2MBTE1/1fsGjGhSbeBe4b8LN5GpEDAoyZgjadaTzoiw== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5165.namprd12.prod.outlook.com (2603:10b6:5:394::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Wed, 28 Jul 2021 09:50:04 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::9cf5:169b:e9a5:5811]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::9cf5:169b:e9a5:5811%7]) with mapi id 15.20.4352.031; Wed, 28 Jul 2021 09:50:04 +0000 From: Ori Kam To: Dmitry Kozlyuk , "dev@dpdk.org" CC: David Marchand , Bing Zhao , "stable@dpdk.org" , Matan Azrad , NBU-Contact-Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Thread-Topic: [PATCH 4/4] ethdev: document indirect flow action life cycle Thread-Index: AQHXgrl5YM+NuUI9SkakWbZb/KmJLqtYEvCw Date: Wed, 28 Jul 2021 09:50:04 +0000 Message-ID: References: <20210727073121.895620-1-dkozlyuk@nvidia.com> <20210727073121.895620-5-dkozlyuk@nvidia.com> In-Reply-To: <20210727073121.895620-5-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: 78e29c1b-114b-4b2a-bb98-08d951ad1351 x-ms-traffictypediagnostic: DM4PR12MB5165: 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:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /v4ALU95b1RRpPF/bgsdNOR7eNWdqkfKjKg8NWyQNDFINieL/HR9GcAWR2IehpJz2o/rwLB9Nr8069r4So7/PaMwTfYdIHAKT3XZaniybNPnCkyB4HDWGSiWcqOTc876ZFO7j2tPLxCE/k+iclbRhANOay4VFLEjBa+ApdJCbN1JYzrbKjLuD9dv4jsX+VRVkpckgWpOH5tOPLA7T8omESTLEN1BtlWniAxoh3nGqF7b6LMhfu7/9ND517fivHr9UgkyDpN5U6gAC/XZnnclY9T3dVJokrxfOSwz+lnDO+aFctm0le8+y1vygHM37bLU0Y3K+haD5xNlHDQ8Lk/wam4CbRCSvGYTN4zMCdUKYnekf16oqoclakRsMCp9skGoDYJgQ1lsSP6mU5fHdaudVmg1EzH5MM8gbWbP4F2K7UG1ckPrAMZzAA7NV8/T3lIT7nJ4mg81QASMprpLq4JMfWbhtjk5Wk2izWhxgPKYtA7jThSgEeV0sSwtW/cYH7rJocMeW9FL2zKqS9H8UDTslNkgVkSmBKsO+nPbza/VcQLX/xVd/QCiUva/FD0zomePz1E5cRfH2Y7FtRe4i/ch06d0DEk4ubBrxUakAbnjW3r+StiSKMxnCtbKVLgYHifZJPjy+8xG7m0I6V68l33nDzpTH3EY1yJxA/Ev8D3nuWJjd5h9W8JI6vD8wGPgPtTRT2o/ZnQ38C1xn5Fh3D4FMg== 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)(346002)(396003)(376002)(136003)(39860400002)(366004)(316002)(86362001)(7696005)(54906003)(5660300002)(33656002)(55016002)(71200400001)(186003)(4326008)(83380400001)(122000001)(6506007)(53546011)(110136005)(66556008)(66476007)(64756008)(478600001)(8676002)(26005)(9686003)(66946007)(38100700002)(66446008)(2906002)(52536014)(8936002)(38070700005)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9mH2Lpgywq0ZXkzKywXNMiiXKkEO2UGTIq5XVRELIkApccKGRFGAO8s4IFuj?= =?us-ascii?Q?KpILC3bc/CR5xJ3g1+M3HOxwCVtzftL5DfVzCIbRsbfpnkQZlaYAtpuja3MW?= =?us-ascii?Q?qVOg6JuzKaegG+esBOIingZ3C+3Wxa6SWc9qLWM+BE1612iXkbiSP6N/Q4DU?= =?us-ascii?Q?cS2VOY1eogibu+WrxP/UqXmDtpXWtkXxgrerTd/EddcT9GkybD+xXsV9iH+L?= =?us-ascii?Q?HJuaRAmNstAR85yZoN2Cud+2LLSHSQRxdVPazW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ittHWMCu+2IpN0P+EAssAiXNxY6FVHRYDR1OQqQsnaNjE?= =?us-ascii?Q?MTX14CnnA6eeN6RK6QqVHK9qw3AET18hkEZwIDlF1jjju2mIdU7gp6SKc6m+?= =?us-ascii?Q?C8aBvx5aJtSenweVr90VKYtj1z/Bw9aG9C/WopeXzjXY3Rm2kowEUOEmIVgT?= =?us-ascii?Q?O4Hn8rin/TWGJa+RvZbsKYND?= 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: 78e29c1b-114b-4b2a-bb98-08d951ad1351 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2021 09:50:04.3408 (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: kOEXecolLPSnuNTB+xqJNgcXNv8f64I47/Ldoc7KTsSNehxeIzJd+FVkIBnTv1VQnyK0wIuCdaXSlqnu7d1OVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5165 Subject: Re: [dpdk-dev] [PATCH 4/4] ethdev: document indirect flow action life cycle 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: Tuesday, July 27, 2021 10:31 AM > > Subject: [PATCH 4/4] ethdev: document indirect flow action life cycle >=20 > rte_flow_action_handle_create() did not specify what happens with an > indirect action when device is stopped, possibly reconfigured, and starte= d > again. >=20 > It is proposed that indirect actions persisted across such a sequence. > This allows for easier API usage and better HW resources utilization by s= aving > indirect actions flush and re-creation with associated error handling and > rollback. >=20 > If between stop and start a device is reconfigured in a way that is > incompatible with an existing indirect action, PMD is required to report = an > error at the device start. This is mandatory, because flow API does not s= upply > users with capabilities, so this is the only way for a user to learn that > configuration is invalid. Errors are not reported at configuration stage = to give > the user a chance to remove or change offending actions. For example, if > number of queues changes and an RSS indirect action specifies queues that > went away, user must update the action before starting the device. PMD is > not allowed to silently adjust indirect actions (in the same example, to > remove queues from the RSS), so that all configuration is explicit. >=20 I think some of the errors can be checked during configuration. For example when app removes a queue the PMD can check if there is any reference on this queue and fail at this point. > Fixes: 4b61b8774be9 ("ethdev: introduce indirect flow action") > Cc: bingz@nvidia.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Dmitry Kozlyuk > Acked-by: Matan Azrad > --- > doc/guides/prog_guide/rte_flow.rst | 10 ++++++++++ > lib/ethdev/rte_flow.h | 4 ++++ > 2 files changed, 14 insertions(+) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 2b42d5ec8c..06dd06d9a6 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -2785,6 +2785,16 @@ updated depend on the type of the ``action`` and > different for every type. > The indirect action specified data (e.g. counter) can be queried by > ``rte_flow_action_handle_query()``. >=20 > +Indirect actions persist across device configure, stop, and start. +1 > +If a new configuration is incompatible with an existing indirect > +action, the start operation will fail. "Incompatible" means that if > +this action was destroyed and created again, creation would fail. I think this test should be done during the configuration. It is the application responsibility to use valid actions, it should be sta= ted that changing the values of configuration may result in in valid actions. > +It is a programmer's responsibility to remove or update offending action= s. > + > +PMD developers should use the same diagnostics for > +``rte_eth_dev_start()`` as for ``rte_flow_action_handle_create()``. PMD > +is not allowed to silently ignore or correct offending actions. > + > .. _table_rte_flow_action_handle: >=20 > .. table:: INDIRECT > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index > 70f455d47d..f571a27fe7 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -3969,6 +3969,10 @@ struct rte_flow_indir_action_conf { > * The created object handle has single state and configuration > * across all the flow rules using it. > * > + * Indirect actions persist across device configure, stop, and start. > + * If a new configuration is incompatible with an existing indirect > + * action, rte_eth_dev_start() will fail. > + * I don't think that dev start should check configuration it may slow down st= artup. > * @param[in] port_id > * The port identifier of the Ethernet device. > * @param[in] conf > -- > 2.25.1 Thanks, Ori