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 D33D3A050B; Thu, 7 Apr 2022 07:31:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5399410FB; Thu, 7 Apr 2022 07:31:39 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2052.outbound.protection.outlook.com [40.107.94.52]) by mails.dpdk.org (Postfix) with ESMTP id 1513C410EF for ; Thu, 7 Apr 2022 07:31:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bKshkUS74TzobuzcYmBapQ74iFApiK2yaTp7Qg5EKhFiA1QiXqnKW6J7k7VIpVuyOgb0vZ70ZB7IhrDxlXCptB62EBWDixxA6un3Rd6nG93So2GiehM4tZJzS8QTicDIQEygjr6GjLHttu8AgtJp7nMhvnQ3alu1yIyvonMN5GmmizXiya6tuEVg3Dt2q5LoQkNdzDp6bnQy9QUI6B+RNnyA+4wu9eqYv/CWhn1eSQ4MfH0g67CGJK1p7FZ3EdaDbd409/QXhwK3p75h3e2Gjli9sLU8rijtUGd1H2VRF0wMRq1gWpCyg4wtvqKm1uqFaWy1J9G5n/7t1tzNLifgZA== 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=o7+VT6d6mvaPQw+R/oNXyVXoZqIcirHyQm5RNcULaw8=; b=dY2qCEwnMkSBdLt3/Q9cUqgwVsFCsNnqtk1DiHHwY2szwobkQ1fOXOyBZqrTKCNHJV/1DrPY/zaBxSWiYQ3+X8dGXQl0uSmWWE2rKnZ/BtSo/VH//okMfjJ7j931Q8bVh273p5lETtqT3M+E7UjD9e+tAY+vgfGzYnJawyNcd4wlRa3OhNOAyc1shZtvNJlAZYKuvZyhmEkjdLEJsxUFcrpc/wqhLBEoy/cj8UGwufRYhLBuAWpFxwGA3udR0T8mOKMSDqhBhpG7CGz0XqNDA2Acd7JfX+VkYGD5QwfAMrzAN9LoFhBII248SbNym2nYo4TcQiwJzREqGiPUrcGYbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=oktetlabs.ru smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=o7+VT6d6mvaPQw+R/oNXyVXoZqIcirHyQm5RNcULaw8=; b=Yx/3CPJFN8WJaqauBPECc55BW/FhwGkc86a7XQmLQvE9g2R/T5s7O1ss6WeiY2csBXjvqiY5ZI88pBqWdYYerzOKYuDqNorPhmhSX3nF+SzXisWoDw/6rKmtrOmzJTBZzGEYkFxfxcr30jzvjDvXa1kSlNuxpTMK87tNE8LqQGMA6hERWT41OcjCldKeXD44Jd5gc1yxATlv6OPQz7C5/XqX35k0hsRHFN3MX61ggjGDDi0d0/HtbwI5pVg6YrUoThEDPvQE5TSfAeMjMUIIgJ7KGi1jjJSMVts9xUStdHqw4eQuj1736bKwG8rCUF38jeMrmY7iVtDFKJpPoprsVg== Received: from MW4PR04CA0201.namprd04.prod.outlook.com (2603:10b6:303:86::26) by CH2PR12MB4152.namprd12.prod.outlook.com (2603:10b6:610:a7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Thu, 7 Apr 2022 05:31:30 +0000 Received: from CO1NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:303:86:cafe::95) by MW4PR04CA0201.outlook.office365.com (2603:10b6:303:86::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.21 via Frontend Transport; Thu, 7 Apr 2022 05:31:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT027.mail.protection.outlook.com (10.13.174.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5144.20 via Frontend Transport; Thu, 7 Apr 2022 05:31:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 7 Apr 2022 05:31:28 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 6 Apr 2022 22:31:23 -0700 From: Xiaoyu Min To: Ori Kam , Thomas Monjalon , "Ferruh Yigit" , Andrew Rybchenko CC: Subject: [RFC 2/2] ethdev: queue-based flow aged report Date: Thu, 7 Apr 2022 13:30:47 +0800 Message-ID: <9b673505092754dca22df7939cc009930864b45c.1649308627.git.jackmin@nvidia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5796b0dc-9148-40c5-56a0-08da1857ddc7 X-MS-TrafficTypeDiagnostic: CH2PR12MB4152:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dx6KFEM5MtZgpObsr+bCSQFpDiFb7ARHTFo2Bea7hjL0CuuGW/oBqri9kmHI9CzGa3+nU7zISGTEdJLQwx7wY3dE9D5HspeCi+FFIMTtUIBMwURcdmWr5p+Sqnqaehq8UwO4ZBiKlM6irRCIZLQJt0FJrIj6zEqgkO6C05IRxAphz9acPq2b7XzTIYXfqfDDMT8O3TcIMwFr8WSSXy5WpIMPeByeXCZZUXswKGcRGxm7+HF44Ic20MgiS92sMqdAsnSkd3Ss+DeXcy5WPyovbo5+3AsgNTM0vbbGMREv1TebNo6zgtuiCEKgB2wel3RuCsgvCpq6k0iqYaCvRbJtN8nh/cY021d+F1RVdMFl++r5CS4zMgh9B8WfRrtY7ah6GHAGlnd0rgPaB+XVuGt8pGXgdgBhAZkVPCSRhD6SHM/Tk+Gg6qSirujcaBDRPylULZlVFCC5lm3KmmwpT6rv4ChKyxLeXtugHJFkAIVVyp3HJ5OaPswlZ/pnHdRIKsLwjh8w9f1qeo1+3FF5nqD2MTE/EfqsqnVjLpNkDbhybnVkLjqWUXAkbQ3bbP9rZ4mznyXlVrc5Qu1UhFAt3ihtIX0TRvPrhwipWIbmRGHjgXVezURItTCMWAZV/MTgy4xqtxerCWZXxv28sYWRBr8h8mxEp2uvd96JldBmwXfe9IINDUJildM/uvh9yih4vX1QJZD8Cw9dzmff9muwk4Rbbg== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(7696005)(6666004)(2616005)(36756003)(82310400005)(8936002)(2906002)(5660300002)(55016003)(356005)(316002)(86362001)(70206006)(81166007)(70586007)(4326008)(8676002)(26005)(83380400001)(336012)(186003)(426003)(16526019)(47076005)(508600001)(6286002)(40460700003)(110136005)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2022 05:31:28.7146 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5796b0dc-9148-40c5-56a0-08da1857ddc7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4152 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 When application use queue-based flow management and operate the same flow on the same queue, e.g create/destroy/query, API for querying aged flows should also with queue id parameter just like other queue-based flow APIs. By this way, PMD can work in more optimized way since resources are isolated by queue and needn't synchronize. If application do use queue-based flow management but configure port without RTE_FLOW_PORT_FLAG_STRICT_QUEUE, which means application operate the same flow on different queues, the queue id parameter will be ignored. Signed-off-by: Xiaoyu Min --- doc/guides/prog_guide/rte_flow.rst | 4 +++ lib/ethdev/rte_flow.h | 44 ++++++++++++++++++++++++++++++ lib/ethdev/rte_flow_driver.h | 7 +++++ 3 files changed, 55 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 588914b231..d540152d74 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2963,6 +2963,10 @@ Set ageing timeout configuration to a flow. Event RTE_ETH_EVENT_FLOW_AGED will be reported if timeout passed without any matching on the flow. +If queue-based flow rule management is used, when this +even is triggered, the ret_param is set to corresponding +flow queue. + .. _table_rte_flow_action_age: .. table:: AGE diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 578dd837f5..9394fb6965 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -2810,6 +2810,7 @@ enum rte_flow_action_type { * See function rte_flow_get_aged_flows * see enum RTE_ETH_EVENT_FLOW_AGED * See struct rte_flow_query_age + * See function rte_flow_get_q_aged_flows */ RTE_FLOW_ACTION_TYPE_AGE, @@ -2935,6 +2936,11 @@ struct rte_flow_action_queue { * * The flow context and the flow handle will be reported by the * rte_flow_get_aged_flows API. + * + * If queue-based flow rule management is used and port configured with + * flag RTE_FLOW_PORT_FLAG_STRICT_QUEUE, RTE_ETH_EVENT_FLOW_AGED event + * is triggered with ret_param set to the corresponding flow queue when + * a flow queue detects new aged-out flows. */ struct rte_flow_action_age { uint32_t timeout:24; /**< Time in seconds. */ @@ -5629,6 +5635,44 @@ rte_flow_async_action_handle_update(uint16_t port_id, const void *update, void *user_data, struct rte_flow_error *error); + +/** + * Get aged-out flows of a given port on the given flow queue. + * + * RTE_ETH_EVENT_FLOW_AGED event will be triggered with ret_param set to + * corresponding flow queue when at least one new aged out flow was detected + * after the last call to rte_flow_get_q_aged_flows to this flow queue. + * If application configure port attribute without RTE_FLOW_PORT_FLAG_STRICT_QUEUE + * the @p queue_id will be ignored. + * This function can be called to get the aged flows asynchronously from the + * event callback or synchronously regardless the event. + * + * @param port_id + * Port identifier of Ethernet device. + * @param queue_id + * Flow queue to query. Ignored when RTE_FLOW_PORT_FLAG_STRICT_QUEUE not set. + * @param[in, out] contexts + * The address of an array of pointers to the aged-out flows contexts. + * @param[in] nb_contexts + * The length of context array pointers. + * @param[out] error + * Perform verbose error reporting if not NULL. Initialized in case of + * error only. + * + * @return + * if nb_contexts is 0, return the amount of all aged contexts. + * if nb_contexts is not 0 , return the amount of aged flows reported + * in the context array, otherwise negative errno value. + * + * @see rte_flow_action_age + * @see RTE_ETH_EVENT_FLOW_AGED + * @see rte_flow_port_flag + */ + +__rte_experimental +int +rte_flow_get_q_aged_flows(uint16_t port_id, uint32_t queue_id, void **contexts, + uint32_t nb_contexts, struct rte_flow_error *error); #ifdef __cplusplus } #endif diff --git a/lib/ethdev/rte_flow_driver.h b/lib/ethdev/rte_flow_driver.h index 2bff732d6a..f617af13f6 100644 --- a/lib/ethdev/rte_flow_driver.h +++ b/lib/ethdev/rte_flow_driver.h @@ -260,6 +260,13 @@ struct rte_flow_ops { const void *update, void *user_data, struct rte_flow_error *error); + /** See rte_flow_get_q_aged_flows() */ + int (*get_q_aged_flows) + (uint16_t port_id, + uint32_t queue_id, + void **contexts, + uint32_t nb_contexts, + struct rte_flow_error *error); }; /** -- 2.35.1