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 A3FECA0C4B; Fri, 15 Oct 2021 11:04:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CD6540692; Fri, 15 Oct 2021 11:04:24 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id E09C140041 for ; Fri, 15 Oct 2021 11:04:21 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by mxs.oss.nvidia.com (10.13.234.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Fri, 15 Oct 2021 02:04:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DhT4v7WJFd74UZDXW8kizB2Vb2an+wmKvWXMiO2UbAdL7c9fVqMe/BVCS+V1JwMZywS7lVtWJXmmgfMO2lxdpRLZpztB0rQMJQhIElYsAmresSkA9j1FciTuwYBT+4xHlYbb/IUyOjaSVxnHTkvzo5faxiHJXgZisIL64ZXecFa8ZZrBBZECZ3Ohjo4dYBsuewI1ZMXeNQSPbN3LZBcXHKgJuLmIQA0EAtHjuBdO7R2BJgWuc2gZaJZqaMPOxQLQvZ8gUYNe5NIsofRQZhOT6Clq189fDL1aseQGDH3sE56ohEcCWge8s8NgwD91vXWlhvhFXXVgeyX6SUmfqNhSJA== 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=1aZVThGykjmKSaacjPtvkrNvPi6Az2u8o9jsm7JtRn8=; b=TA9AFsub6bKK6lGioJLDaRRExTXuLlpO3tCLQVY+7PLosAiBKV0GIIlR9qitbKWjFuMP2iPdkPAgi4P5RSgWILefaZ3lCzc9HuSWcKlvWILoaMsJpyJWoTtA4WHRYzezDVL5Am36TREECy4NfLWgJjgvqKelUr2RO7Rjp/lEpbdVjaRcZuEmXYSuzNx5NmVDhl39okzxIdFCy8266hnivRF2Uc4M0uwDp03Dd9L8gjxOqlCJB9xwTdqP370BXgzMGD2lnXpM432pzciRiDFRNXvuDQF3yEei4tiNhbSi+cILTIzojNtqKHMfNcIaFOEGe1VokeQExZ2BMqHhEVJD1Q== 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=1aZVThGykjmKSaacjPtvkrNvPi6Az2u8o9jsm7JtRn8=; b=fZUxLOwoGNcJkzQ5T5sJjLqYt65I4iJmfnfhkY+nFHZhdQgqNlCJ8UyTsO5VNRWGN5dWEjJjx+AXgLcWM6jRFX/RR02QqbPn9f4F1fwOdsdX2f8/QSPY7PXc3dLGx4xr7ukZjDRbN3ecXeAGWJIQU5sBQWaDdYoTkODwY4ww0V+I2HE/MAZ5n4eU124WAVqJT3GRnz2DMCGxfQACBDBDJlqHUJFkQXNhod70sTA1qlFHjEcMlXLMoVdH4p+qCvyvDQk10M/VywD/HmH/J30jM2MlP3zs60CAgcIJ/3ai4dDkYnu+9EWX6/rdl0h1PXhQE67NiRzEP4nSGQ2/O39GtQ== Received: from CH0PR12MB5091.namprd12.prod.outlook.com (2603:10b6:610:be::10) by CH0PR12MB5172.namprd12.prod.outlook.com (2603:10b6:610:bb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Fri, 15 Oct 2021 09:04:19 +0000 Received: from CH0PR12MB5091.namprd12.prod.outlook.com ([fe80::59bf:640f:7140:ab97]) by CH0PR12MB5091.namprd12.prod.outlook.com ([fe80::59bf:640f:7140:ab97%9]) with mapi id 15.20.4587.032; Fri, 15 Oct 2021 09:04:19 +0000 From: Dmitry Kozlyuk To: Andrew Rybchenko , "dev@dpdk.org" , Ori Kam , Raslan Darawsheh CC: NBU-Contact-Thomas Monjalon , Ferruh Yigit Thread-Topic: [PATCH 2/5] ethdev: add capability to keep shared objects on restart Thread-Index: AQHXuYNQK50xrto6MEmDHPXWdlMdYavQnioAgAH1bHCAATYogIAAAEsQ Date: Fri, 15 Oct 2021 09:04:18 +0000 Message-ID: References: <20211005005216.2427489-1-dkozlyuk@nvidia.com> <20211005005216.2427489-3-dkozlyuk@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 197c5084-f720-4935-e9fb-08d98fbac588 x-ms-traffictypediagnostic: CH0PR12MB5172: 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: IpQwSxMCsJDLKUFquEC4NG+PiCShBRYrL/v4Mb0QBrNCMmmZ22irdrxw6hfNH3+UZgKMGNbsV0LY+JohRy4ltdZuXtZPo4HH33J0Wvy3ZKLb4Efqt/SYy44xDKj1RAOtD0i9guwKEnXtw8h/qwhMT9k40fIUY6NI4CmZOxjnYmkQaAwE/w99ByUk9uFEUBlutUv++mKzF3xFXIncCw1Ub7cjWAd8UB33Bg3qaVj4pSIt/FLf6n7iJztnirsQAYldx3WYNJ9Ag5pUPjIKC7Jrtw8guEeeQVfPV/4HZDdp4MXqojI0XtQqLAkLzHU5Kl/9oqJEumuL6YlDyjIrrMeCi01RXZUTBzdo5S3Kknr6JWmlsPJBVN6t6xmrtJGSxXW+i4PDq2syJX5pkoEhMuAxWQcy4hD2CPOLhFlk+9W3PrlqBIqWiffz7WIV3T6XZXjXbF/8OSuPeoLuUMAVwDP5qgZ1WInBV5iDWNjJMGYG0HQb0Lu6m5c0ZWbsFoHeEHEV5D6mVl/oIserRUINPh9LuOMg0Bw7Vfh8zBYdVaWboOzpzyXnXqBdG1+2PeBmVMZA8TTBFZpbYB7QZxPzpnuRrsoTwChWSsz5ScK/v3huiAi8vTUjxxjdmP/1uKypRYKL5uGVOqtFWfVGM4/nPKKgZGEGzAw9fUtYR+NqEUWZvCgwwo2+B/ZMEeulU6YvPsupHOiqhYP4Lc9epjln60XkZg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR12MB5091.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(76116006)(6506007)(6636002)(316002)(2906002)(83380400001)(8936002)(107886003)(4326008)(8676002)(110136005)(54906003)(33656002)(5660300002)(71200400001)(55016002)(38070700005)(122000001)(7696005)(9686003)(26005)(186003)(52536014)(38100700002)(86362001)(508600001)(66946007)(64756008)(66556008)(66446008)(66476007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nXXRe6HvX5ONc/OsEfmeZ/F1JbNIome3bGl3S+wwfOwLX3UuVRwVz99/nkgG?= =?us-ascii?Q?Cz1shwgNZsKaJpL9IDsNFvtrcLignIORKCcktMSX5oqzOL8qj0yOMno+KfBt?= =?us-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Mz7D65p5ZAJ0P2wJcMPMP?= =?us-ascii?Q?JerLfeffjO+e8cTT+6pxbXfNcn4zz9zfNFEUkawiwlcF0UFAO2SA/7f+r71u?= =?us-ascii?Q?LhE6dbkNEWOs/q7kL4NbrgCGvnpTd31AmZjKfISdW8EArX4d1ds3U4lj9kQk?= =?us-ascii?Q?3H6Mw8iby9YtRtnysMRTzOCMT51NoTk0TNITzWkrzIeqNDkLp88r9jiEeWkv?= =?us-ascii?Q?aRbmrLRG3b7VOPjc1wCqaEWIVbc3xYKET+R38IS9XJbA/EUYIpwG5qnQavMT?= =?us-ascii?Q?r+IsmJOnm9JksnddwdHTJRt7hDJ0lhB8kNy2cMp+IFt8HV185KxS9/rhqctj?= =?us-ascii?Q?lpg=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR12MB5091.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 197c5084-f720-4935-e9fb-08d98fbac588 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2021 09:04:18.9413 (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: rmeuioxW0vG0iMj/yYsG2t4FIQkchSFCYFIQFb9ina//cmUsZkn/IJoXR8PN9170GhpsyLQvRKc3oAvHtEnmpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5172 Subject: Re: [dpdk-dev] [PATCH 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" > [...] > >>> From: Dmitry Kozlyuk > >>> > >>> rte_flow_action_handle_create() did not mention what happens with an > >>> indirect action when a device is stopped, possibly reconfigured, and > >>> started again. It is natural for some indirect actions to be > >>> persistent, like counters and meters; keeping others just saves > >>> application time and complexity. However, not all PMDs can support it= . > >>> It is proposed to add a device capability to indicate if indirect > >>> actions are kept across the above sequence or implicitly destroyed. > >>> > >>> 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. > >>> > >>> It may happen that in the future a PMD acquires support for a type > >>> of shared objects that it cannot keep across a restart. It is > >>> undesirable to stop advertising the capability so that applications > >>> that don't use objects of the problematic type can still take > advantage of it. > >>> This is why PMDs are allowed to keep only a subset of shared objects > >>> provided that the vendor mandatorily documents it. > >>> > >>> 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 > >>> capabilities, so this is the only way for a user to learn that > >>> configuration is invalid. For example, if queue count changes and > >>> RSS indirect action specifies queues that are going away, the user > >>> must update the action before removing the queues or remove the > >>> action and all flow rules that were using it. > >>> > >>> Signed-off-by: Dmitry Kozlyuk > >>> --- > >>> [...] > >> > >> Current pain point is that capability bits may be insufficient and a > >> programmatic way is desired to check which types of objects can be > >> kept across restart, instead of documenting the limitations. > >> > >> I support one of previous Ori's suggestions and want to clarify it [1]= : > >> > >> Ori: "Another way is to assume that if the action was created before > >> port start it will be kept after port stop." > >> Andrew: "It does not sound like a solution. May be I simply don't > >> know target usecase." > >> > >> What Ori suggests (offline discussion summary): Suppose an > >> application wants to check whether a shared object (indirect action) > >> or a flow rule of a particular kind. It calls > >> rte_flow_action_handle_create() or > >> rte_flow_create() before rte_eth_dev_start(). If it succeeds, 1) it > >> means objects of this type can be kept across restart, 2) it's a > >> normal object created that will work after the port is started. This > >> is logical, because if the PMD can keep some kind of objects when the > >> port is stopped, it is likely to be able to create them when the port > >> is not started. It is subject to discussion if "object kind" means > >> only "type" or "type + transfer bit" combination; for mlx5 PMD it > >> doesn't matter. One minor drawback is that applications can only do > >> the test when the port is stopped, but it seems likely that the test > >> really needs to be done at startup anyway. > >> > >> If this is acceptable: > >> 1. Capability bits are not needed anymore. > >> 2. ethdev patches can be accepted in RC1, present behavior is > >> undefined anyway. > >> 3. PMD patches will need update that can be done by RC2. > > > > Andrew, what do you think? > > If you agree, do we need to include transfer bit into "kind"? > > I'd like to conclude before RC1 and can update the docs quickly. > > > > I've seen the proposition to advertise capability to create flow rules > > before device start as a flag. > > I don't think it conflicts with Ori's suggestion because the flag > > doesn't imply that _any_ rule can be created, neither does it say > > about indirect actions. > > On the other hand, if PMD can create a flow object (rule, etc.) when > > the device is not started, it is logical to assume that after the > > device is stopped it can move existing flow objects to the same state > > as when the device was not started, then restore when it is started > > again. > > Dmitry, thanks for the explanations. Ori's idea makes sense to me now. Th= e > problem is to document it properly. We must define rules to check it. > Which bits in the check request matter and how application should make a > choice of rule to try. This is a generalization of the last question about the transfer bit. I call the bits that matter a "kind". As I see it: rule kind =3D seq. of item types + seq. of action types indirect action kind =3D action type As Ori mentioned, for mlx5 PMD transfer bit doesn't affect object persisten= ce. If you or other PMD maintainers think it may be relevant, no problem, because PMDs like mlx5 will just ignore it when checking. Then it will be: rule kind =3D seq. of item types + seq. of action types + attr. transfer bi= t indirect action kind =3D action type + indirect action conf. transfer bit Including the transfer bit seems to be a safe choice from DPDK point of vie= w, but obviously it can force applications to do up to twice as many checks. The application needs to construct a valid flow configuration that is (1) valid and (2) has the kind the application is interested in. It is worth noting that these checks are not about resource consumption, i.e. it is sufficient to test an indirect RSS with one queue to be confident that indirect RSS with any number of queues are preserved. > Which status code should be returned by the PMD to > clearly say that addition in started state is not supported and, > therefore, preserving across restart is not supported. I suggest a new DPDK-specific value in rte_errno.h. > Must the device be configured before an attempt to check it? Yes, because flow objects created by these checks are as good as any others and AFAIK no PMD supports rte_flow calls before configuration is done. > Should transfer and non-transfer rules/indirect actions be checked separa= tely? See above.