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 1B4DCA0C41; Tue, 5 Oct 2021 02:52:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DBFA41262; Tue, 5 Oct 2021 02:52:37 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id 532714125F for ; Tue, 5 Oct 2021 02:52:36 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) 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; Mon, 4 Oct 2021 17:52:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kZN0pmjqQlUJH8PIqab8awxCYA0BA2uAmML7w0rvQ5n6K1hKl8GTl6dOBmTDoXjOYrkosA0/Hf0dWAuLduBs9ubnMi7NwmaPkzFRwsmwuHetHdO2d6/vuwW3eNKPN6c9gYjl7LRfQBcvNcAOgzp9fpR4YTDyIXwdkvMp0+Pla3VyEdeVNggXI7X4URyaD8xOYevoATWlHZ+2PEW5Cup78Mdj7vlwRwpRw/Xo9t0H8VBzcKaYW6y3EG1qCvBQEFAN50yyopxiCZNguxaMyauv28XV9s+JGhorJhth+MLZV5Tqlb69WG6kNpIzCIPmgFuQgSj8VGdW+jZZvrnmhZK26g== 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=E28Nguhlpx7bDY3UYdcWB6LVtiWdXEIXBtpsrNs9ssM=; b=OTEWzaGm3LO5WPeG1+/ZMxGMvAUTtlnqg9/IhncKeg7t29G8umIK67AxqKeKDQGLA7ZCUKq5CWDptzyM2PJrrFYuz/Vuejela5FYMb6D6PmvTYQ6zUX27ShU5l3PJR0pFxJyXPc8bDWhewq1dIHLiCX6FHkJMmLPuykRMmCoPkCmfagc0oXpM06m90Q+MVmSKPLM37CX7UyuQWiTleE2VdMYFmLU87hV7X5O7Mh2aCOuDwGn2uQwze1hA2WYa0q6R53P+IT0uhYdxsMkqCPsDU0il+IO6ewqNKaKHsbXJfGTA6nq472A4LnA7aD7g93gNm2jiByRWkKxdiXAFmmR4w== 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=none 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=E28Nguhlpx7bDY3UYdcWB6LVtiWdXEIXBtpsrNs9ssM=; b=MVWR5CHdBrGw/lajT+ZV5kUouwNbJa94mOcF3NuZIQ3Iah9zsLhh0SoTxNbzN/pAx3LKHMr2jM+0jlQSzIwDbTJ4AGXRTNNEgkz2Qx9hDwbjDEbXXNb9z2HkrgyB7j4qBluwtn5vFIBmYrBLFWk5G1pwlzHTACD86SYrZyyLlGrz9CnAsPRutFU+xJl1xnQY42Q8cwgVdvAU/jEOfs8/D0i0wWd+o4jselqpdYaue9R42ROx+xmUlJVgRO7YkUZ6FJgzVQsFZIo3MuB3gQDOPmrqoNmiLKW+MTymcY7gbdC9Z/zqNKqSlQOiHuJBn5GP1HE9/KAOurEd1xS9HTuRkQ== Received: from BN0PR02CA0006.namprd02.prod.outlook.com (2603:10b6:408:e4::11) by MN2PR12MB3054.namprd12.prod.outlook.com (2603:10b6:208:d1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Tue, 5 Oct 2021 00:52:33 +0000 Received: from BN8NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::6a) by BN0PR02CA0006.outlook.office365.com (2603:10b6:408:e4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Tue, 5 Oct 2021 00:52:33 +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 BN8NAM11FT035.mail.protection.outlook.com (10.13.177.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Tue, 5 Oct 2021 00:52:33 +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; Tue, 5 Oct 2021 00:52:31 +0000 From: To: CC: Dmitry Kozlyuk , Ori Kam , "Thomas Monjalon" , Ferruh Yigit , Andrew Rybchenko Date: Tue, 5 Oct 2021 03:52:12 +0300 Message-ID: <20211005005216.2427489-2-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211005005216.2427489-1-dkozlyuk@nvidia.com> References: <20211005005216.2427489-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: eaa67729-edcc-4fab-ddf9-08d9879a6ab4 X-MS-TrafficTypeDiagnostic: MN2PR12MB3054: 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:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NNKWR3xNZtgkIl1Qv8uLJByX6BI/eNF8NBa9NPzvOGiwflV4bFhDtb0g5pe6bOBuqRuLvjp+gRLZGWabw4tWnRDoo/E6iHait0PqXPR11f5AEd2qeZT+6GmMlnCWOSyTSyMBWLN8dDWy/Gg3Grah5zMkFEzh+F6PCE61YZ/7xGowohH3A9YhqN1YiCtmMpm39/LxnwPDYkDVTgOP05bh677Wtn+iJrTf9bR6sh8F7Pz6OYEbPYeOUnIuo5XXBEGQDrGynZJa7BmADM+XhtlSkj3plJKDM4qgVg+Uz/AXmKGVw55QX2aKUcgXnWy7PPc9OrMeX/zuKyN57LdhfQJ1NjII2HTGEb7s4/IRzbv+t3+1tKbFRbKAHxgF6VOtk0Exp2B/kbnPwMk8IgrcGQBkjT6vmsNcrx91DUciNAU7bAT3UOfPE9X7GdjA7YA8/nfO5qyTsJDjAwg2d+kBLwbiPiE+7K64/0ILGS6Nxt6iGTbl1UL/tZVnIXGEbdbJGri0sspgbXnXPhjuB28QhQa5x1xycLRz78gAFeuN2ozOJjbymKXM93UlSDVRj5ap1VM6TugOaBJDtHHHGqOyknUQswR1bf3LU+nhcoJXg+hGDIDn04CGFGLTHHbU46nPH3T3UzhvmzvnwcYoCASXG7uovfvkhP5qts8m7Fv5jyoOQf1pwRI3lo1o7kfzWVH9OOD2GxugWJqTHhyeY3MqZe1zuA== 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)(36840700001)(46966006)(5660300002)(8676002)(70206006)(36906005)(54906003)(47076005)(7636003)(70586007)(16526019)(7696005)(36860700001)(508600001)(55016002)(36756003)(356005)(26005)(186003)(82310400003)(6916009)(83380400001)(8936002)(107886003)(316002)(4326008)(2616005)(2876002)(1076003)(86362001)(426003)(2906002)(6666004)(6286002)(336012); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2021 00:52:33.2718 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eaa67729-edcc-4fab-ddf9-08d9879a6ab4 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: BN8NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3054 Subject: [dpdk-dev] [PATCH 1/5] ethdev: add capability to keep flow rules 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 Currently, it is not specified what happens to the flow rules when the device is stopped, possibly reconfigured, then started. If flow rules were kept, it could be convenient for application developers, because they wouldn't need to save and restore them. However, due to the number of flows and possible creation rate it is impractical to save all flow rules in DPDK layer. This means that flow rules persistence really depends on whether PMD and HW can implement it efficiently. It is proposed for PMDs to advertise this capability if supported using a new flag. If the device is being reconfigured in a way that is incompatible with existing flow rules, 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 the action of a flow rule specifies queues that are going away, the user must update or remove the flow rule before removing the queues. Signed-off-by: Dmitry Kozlyuk --- doc/guides/prog_guide/rte_flow.rst | 9 +++++++++ lib/ethdev/rte_ethdev.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 2b42d5ec8c..0a03097a7c 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -87,6 +87,15 @@ To avoid resource leaks on the PMD side, handles must be explicitly destroyed by the application before releasing associated resources such as queues and ports. +By default flow rules are implicitly destroyed when the device is stopped. +If the device advertises ``RTE_DEV_CAPA_FLOW_RULE_KEEP``, flow rules persist +across device stop and start with possible reconfiguration in between. +Some configuration changes may be incompatible with existing flow rules, +in this case ``rte_eth_dev_configure()`` or ``rte_eth_rx/tx_queue_setup()`` +will fail. At this point PMD developers are encouraged to log errors identical +to the ones that would be emitted by ``rte_flow_create()`` if the new +configuration was active. + The following sections cover: - **Attributes** (represented by ``struct rte_flow_attr``): properties of a diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index afdc53b674..d24de5e8fa 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -1478,6 +1478,8 @@ struct rte_eth_conf { #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001 /** Device supports Tx queue setup after device started. */ #define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002 +/** Device keeps flow rules across restart and reconfiguration. */ +#define RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP 0x00000004 /**@}*/ /* -- 2.25.1