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 38894A034F; Fri, 15 Oct 2021 18:18:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7ADF1410F8; Fri, 15 Oct 2021 18:18:45 +0200 (CEST) Received: from AZHDRRW-EX01.nvidia.com (azhdrrw-ex01.nvidia.com [20.51.104.162]) by mails.dpdk.org (Postfix) with ESMTP id 8BC26410F8 for ; Fri, 15 Oct 2021 18:18:43 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by mxs.oss.nvidia.com (10.13.234.36) 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 09:18:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Le1G93TBhTZh6eItdp5EQImHKOHaL+WQOWaNC5/R/Hil1f6XRNe8VklrQJVAjrvN5Wne9PGU9y0oBOmk+nK03bflx/WtTXBvcuZfixOyVtVXmSbKwxUGjc0+bpa7EQHCS3C92Z7UOa9oOTVZxEpAo12O5BXtZVVY1bCr9x94eTMFHClcyUh0shBJoI51oByu2i5BWYxbvT3v8OcYtDuFAOofqRZ9fOVzW1bWC3tpH6CnjfTZ1HsYYTRFNKdxuaFu8YDO26bf35i5zMAY9NJVPck2K0MaG6b29Pso7P5riGGEt75dBDWjVC+7lTqtnocq4+YG/svJA4DNVyuVVrSbrw== 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=bfKxNwqSe6gIGzZ0VF2Bxm98PRreFos1Boa2JIFmpoo=; b=EIKmP2l/Q9O2xIx6qB4V9VYkRbn/BnwWbxgw4rCVXVvQK6rfsU1oQD3gpr+qbhD17PzIr5GMDh0Zf7fmWEobSg1Ww7vewV9t+QZ1w0AK4m8L6Ip1QYS0Uh2gAarzW+myrPdUlS+m8Tbiiq9wboD9UanXmVLTcGGHXbFCLnCBA1MFTyGrWTVHNGxWwyJqbLDPt8vcWK1OkxfUvN3Xba1ox/h67kVNHj+bQR+vWhUcrZO09TYBcPxPsEMI8Vtdn56TUWqP6Fx65m/rtgwNBBgtMU3mZvgKNT6X4kNVR5lN0h/N1wgX0iT+mTBTZ6qdrhXvSKNn3e2uqkUB4bQs+3qVkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=bfKxNwqSe6gIGzZ0VF2Bxm98PRreFos1Boa2JIFmpoo=; b=tNwkqDCItEcbitQrm99n5JzA0eSDCZNye1nhYP6rvyH7Ufz9NObHAEstjm1aC89W73dmy2OurcCnVZq98GlAscrafbkDp4GkV+2JKr7ja49IN8IfkLvYW2nBb9Xu8NH60PLXTCVB4RIYb9ZmDqkbBLuIvqhK1iFI6cj7BmAucGLNdvmjsVSiqRZh+zJWywF9dgygFkDQ+cHIp2Cnl084oyYGOOr4Qq9/MDyw2WMH12neKr3GqTwk1ynZCA0wOeX1XAXZkzD9du8K0sTCa9CZwgbe4W0zPQKJeiLZq5iJH6c8KrYuM4sZIEcc7/C8yhdL4E7Qjlbj+wCPEzIsxUZEyg== Received: from DM5PR1101CA0021.namprd11.prod.outlook.com (2603:10b6:4:4c::31) by MN2PR12MB3280.namprd12.prod.outlook.com (2603:10b6:208:ad::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Fri, 15 Oct 2021 16:18:40 +0000 Received: from DM6NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:4:4c:cafe::c0) by DM5PR1101CA0021.outlook.office365.com (2603:10b6:4:4c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Fri, 15 Oct 2021 16:18:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT032.mail.protection.outlook.com (10.13.173.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Fri, 15 Oct 2021 16:18:40 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 15 Oct 2021 16:18:38 +0000 From: Dmitry Kozlyuk To: CC: Ori Kam , Thomas Monjalon , "Ferruh Yigit" , Andrew Rybchenko Date: Fri, 15 Oct 2021 19:18:19 +0300 Message-ID: <20211015161822.3099818-3-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015161822.3099818-1-dkozlyuk@nvidia.com> References: <20211005005216.2427489-1-dkozlyuk@nvidia.com> <20211015161822.3099818-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15560f3d-33fe-4717-6678-08d98ff77358 X-MS-TrafficTypeDiagnostic: MN2PR12MB3280: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-Transport-Forked: True X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CWqnym1qWpEYcl9MkklvxAW+nyfWT7jSqT4vpwT4GFLgE3jk1N4sIKm0Tdrp1jTvT4k1ohJjZ3jVodQX+++ss8agMDQfHiexSnAnyzmGZEHO9xpoUA263jcJ0OEXhIqpxJgl4u4DkzR0fBbVuaQMPLVW4/t6tCeS9Lxe1goV0PqVaFOKJSUhlERsIuddhtGcHCopBz8x9Oq7tAApA0gkCRAy0baY86y72fLAjAlMB+RnowxTGCt9dohIgKzZP/aWP8kzccEGuJ+pU/RC526AxtwVLWtGPQO1F8MUNW/qcZecyItSxD9rSNNAY7hW5P8v/Y0vG+GYGlvquKW1Qk9y6UJSh54W/d1oyyZJyTu864updx2Lgagn9jLDKnxNg94U6gvGoAC7FkJsPGcwKwJ7uvZ6Luy64XApT/qMWd8xFT7VvEu0IPOwRfbNFxTcT1nXHKC4j6LgOdKHB0HkjulnSliXe7ffNGu4YolY8oSsfWo+ILMFIshpjPrK4Wfcyblr0ZNJrdShHryVp/OCZDnk0FhZQThS2lZ/uVvF4ZFFFh/AXxkKZkTC8e9mTshQCSHHxIMHq0MXrbmTfuGksH6Ji2kBAeLqOn4So043VIlLG8DJLFvZ3dAd1EPnM59+hSZGTDgkGzPjxX4SyxuB13VL0uYkJMdEhm1cyaNjJAKOu6FwCgmeoGcLILdC4YYCTYfDSgr+IaVxV75ZD1VaZQiCKg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(54906003)(16526019)(8676002)(83380400001)(36860700001)(70586007)(2616005)(426003)(36756003)(86362001)(70206006)(82310400003)(55016002)(4326008)(316002)(336012)(6286002)(1076003)(7696005)(2906002)(7636003)(186003)(5660300002)(356005)(47076005)(6666004)(508600001)(107886003)(26005)(6916009)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2021 16:18:40.3463 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15560f3d-33fe-4717-6678-08d98ff77358 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3280 Subject: [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" 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. Also 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. 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 shared between flow rules. The capability bit intends to cover all possible types of such objects, hence its name. 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 the flow rule 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. 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 --- doc/guides/prog_guide/rte_flow.rst | 24 ++++++++++++++++++++++++ lib/ethdev/rte_ethdev.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_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 different for every type. The indirect action specified data (e.g. counter) can be queried by ``rte_flow_action_handle_query()``. +By default it is unspecified if indirect actions persist after the device 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. +If it is advertised, this means the PMD can keep at least some indirect actions +across device stop and start with possible reconfiguration in between. +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 transfer 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 previously). +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 actions. +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: .. table:: INDIRECT diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index a0b388bb25..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-entered * 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 /**@}*/ /* -- 2.25.1