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 2A935A0C58; Wed, 1 Sep 2021 10:56:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1138840698; Wed, 1 Sep 2021 10:56:17 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060.outbound.protection.outlook.com [40.107.223.60]) by mails.dpdk.org (Postfix) with ESMTP id EB1024013F for ; Wed, 1 Sep 2021 10:56:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eWudJJHmTm4rTHk4Q8diOA6wudAsXxYXhjmDasxr9jSIXkl2kQS1RdaG2YzKQFcA2LtK1S+pIga6Enx8OrdFziOmCwBFEPMys1NfZYu9Q0tE77Iof0c3rSxDgwRBu8TB/WiM67bxIFAgxcFfWQhr35gfC+y9EURJ+FBuh1XaGoXuJYdEz2H0ZR7aqbNzU8pxJRHuvaPeBcJsytSPZxcjL4HHp+rBWkk1eunBykDWrC0KbqkcDx89TLySGiWbLe6qLMmCMEaqoh84bbtD/ibvIFVqkkDPCgbYVhr9Wy6M5N8m5fAqmyOgmL3ClfYEUwbYaQYOT1YNQDie5vZxFV1/6w== 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=GYOQAEt0FMHBv3MJjxhW8wDiWassvuKEcLU0JplQves=; b=nizDTuAYZ1cMkhhY5kYkJiXsA0Lkf8zlMW6QPXIbINkxyACAMQsaU9mYYhhORKxZ+gZtjPfD+AmQffFC+rjWnx5NOrXHwcT5MtuDeCjFCb1M9f8+t9aI3SlLAuIYCTfUTRWO+uipAuNpf/wX2w/S8hvYsPnz2v1kts5ZkG8baM5WsUUfqbkFGbN6NJyiaoYsL9nuMJmHxi9/+p1BurWsv56uEZ4sQaoSd9J0ysbn0NvegzEOt56Si4J8uinjy6y8wu1YD15BoQR8Eu4qZ+9KDwzi/XxI2rxIDzq3f9JQ6IMZUu3d2c+B54noby+LETGBlwUBqBDDwxwRs0vXlcA9PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=oktetlabs.ru 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=GYOQAEt0FMHBv3MJjxhW8wDiWassvuKEcLU0JplQves=; b=pEJsKFocSoEjloX1D8MFuJVrvwsBZ5irQoVPoSgNJVlZhkBAy4A44+1oaLIUlHSdtyNd8a2NICCFh/iBJs3/ZadjbPkOIqtWTsAGTaXsjqRDKyTdYLYQ/fxEyeDP580WwyKjBmsSU4OJfyDBPQjewC6epLMnfa/SmKHNbX2T5/CW/bv4SM4LRHagdOf9hrO101natSaKyZQNMa/CGqR4YwEHP0ZzFU5QtXrzJDxDFtiw0VcfR39P5syQi6RkCuj+/ZvvEcAFXjTphgbZIiWG2mpVEtckhLcyJOTzUZyvFX2THRtONGClSt4vE9QVWFoKcduyZmoFTr73sIcUTmWMqA== Received: from BN6PR1701CA0022.namprd17.prod.outlook.com (2603:10b6:405:15::32) by BYAPR12MB3045.namprd12.prod.outlook.com (2603:10b6:a03:ac::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.24; Wed, 1 Sep 2021 08:56:14 +0000 Received: from BN8NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:405:15:cafe::94) by BN6PR1701CA0022.outlook.office365.com (2603:10b6:405:15::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 1 Sep 2021 08:56:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; 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 BN8NAM11FT014.mail.protection.outlook.com (10.13.177.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 1 Sep 2021 08:56:13 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 08:55:35 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 08:55:33 +0000 From: Dmitry Kozlyuk To: CC: Matan Azrad , Ori Kam , "Thomas Monjalon" , Ferruh Yigit , Andrew Rybchenko Date: Wed, 1 Sep 2021 11:55:15 +0300 Message-ID: <20210901085516.3647814-2-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210901085516.3647814-1-dkozlyuk@nvidia.com> References: <20210901085516.3647814-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 DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58532def-36b3-44bc-f8d5-08d96d2659e1 X-MS-TrafficTypeDiagnostic: BYAPR12MB3045: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: TuKnVtLEMDRxGQOjm2IUJ1gnjcpCnvRaNI9BpHj9J1mMhrTDfsNc4DRgwF3BEdCKchhqfi3c/Q795PkbfUkTKPzhLKSiDHNNTzZ/OoVQAsYnXaCRxyV6zOWd1MA40jZs55fOFhpXKz17+2P/GLl/RlslV0thKnT/hYV7uRYCXN/tLKt6U8PGHirJE00yvXdu6T2zmIGoQ7DGrEGZCDQoXVRDQR69rSwg77rv0gwu1Brli3jv0PhKJ3+yNBU1D/+leJgikltJQH2pJyIvI1bAEWioKhXbyR/hK0eNEoJmSyGw3yW+C/UyMwZ+Kv8V6ZhmlqBUpxj80yWp33ms1Gu4hq/eQZdxUfYNpNlSmx36yW94yiX51nbhDCBr1U19NCWE1bzOU9WcEV9mL764LXcYvR+H4e3glh9pEP+c27lhVK6cmEGbXYaFvjl0M6WXJn6+EYUv92i1JwB69HYiqPwa/R+Nr05stohiVOOJ4mCB8hGyxBiG+gs2F87yZ4XfoEmqxc22wq3Stbab1KnZV9tqcOJ3uyW4yV/mChVxAMhjm9g/+N8qjSgYScY9xcStI/EAQ1prgnY+91v9Nuh+kpSkdGfFFuLkbPYTK5Yt5RQTGSWWheCk9kqvPqJomNJsBglSmzzh/XeQOLSpLJCioZX7fpT8HhNhnhTPlM4kXHu80DQcJuejsaDzDYJvWG4BpXJVp293VQSHSAceD5IEbKpuTw== 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)(136003)(396003)(346002)(39860400002)(376002)(46966006)(36840700001)(86362001)(82310400003)(36756003)(426003)(1076003)(8936002)(2616005)(336012)(36906005)(55016002)(83380400001)(186003)(2906002)(316002)(8676002)(6916009)(47076005)(36860700001)(356005)(54906003)(4326008)(82740400003)(5660300002)(6666004)(16526019)(70586007)(70206006)(7636003)(26005)(6286002)(7696005)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2021 08:56:13.2183 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58532def-36b3-44bc-f8d5-08d96d2659e1 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: BN8NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3045 Subject: [dpdk-dev] [RFC PATCH 1/2] 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" 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 can 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 Acked-by: Matan Azrad Acked-by: Ori Kam --- 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 d2b27c351f..1616bdf2dd 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -1448,6 +1448,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