From patchwork Thu Apr 7 05:30:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Min X-Patchwork-Id: 109395 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B35C1A050B; Thu, 7 Apr 2022 07:31:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7533410DC; Thu, 7 Apr 2022 07:31:26 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2068.outbound.protection.outlook.com [40.107.94.68]) by mails.dpdk.org (Postfix) with ESMTP id F20D24014F for ; Thu, 7 Apr 2022 07:31:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W1fllkkvDo7tnfZMYAbZHg3pRIyLEoEygF9kJJkE/6tkhXd46uOezq3Vv8beSIopT7Z9UweJh5LNOCACMg+xef+ePYM6XETgwNukyVRh0hErQhX0A43n2ZchEdYxJMsY0DwWXwQ4gMHYwQ/+e+RdudJ0ZNkxtUa4EGPOZR/qoeVrSxo7z9ZbX5qAcb5txiHpUjUUJGf0SSVbgsRuaM2JSXfuTAInDuLIB32es4/sTrNKpw01ABtNXJVJtqQ+wFn+bR6svC5MI6XaTCYASQoxqp4Cuu8Ptmim+r2SrUeArsepQKjYlqKxZoRUdaR7BpsB2X0Ca5Yi1QRVON04E/MJCQ== 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=jvy9N190YISZZ4GG/MSj/5LL4FBzP/fxsGRJsNhcdyw=; b=F/RNckPJQ0b2y6FV7qBhUbZRylHvO3zE+H5fI6uRHXo95PAYqNFm6Qm+zqEFTzjPYew+tAMjUzPvYi//XHxDdf7GTKRYJmxKeMoEBiCzeLeWJ/qimRO5LVu0MhGlnOtWydiDZ3+AYbFjQM0UM5RoBDN0hLsqKNjDBEg4D6dbILFgukFbu04SVkCMTkYsR3ZZt0xzimXzHefr7hhrc6gf0MB3zvs0e2OQE/PZh0wXYWrFF+7B/8lPKh7EoDXTfg33tskU9SH0T0PNc06TRouZuIwyWsqAy4EIV4SDiraaYpu5gDhxhWq9Byn/7iR5j9i8zCklcrAACyWa6GXNH1FGMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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=jvy9N190YISZZ4GG/MSj/5LL4FBzP/fxsGRJsNhcdyw=; b=ABP3Q1Q+I2b61lTM8QBzEsbO+zpmahxebm5Ssz6g/LkW7HkSaqDSZlu186RqP4nsNoVUV3K28leYCoYdX1r42cyNxEHE54rxlg4sok5GScxUE+/Zc5Nteg8Z1XOhWrIQMxjaF6c34Dzoo4Sbh2r3bW4+ZPsIOcb/SRim3IdrSaD7k3m+02Ob/iD4NOtyy6aKcxOe2j0fHAuD8VF52cCumGNztxR5F1ioSQPQSd0IQj1hHecRhtJ4IgFlTGuWjBuwsv6b7viXOFU9nIRi+rac3vHdz7ZNuBCPPdSDFHJG1ve2K7etzrShzzqdI/Q++MnDt2/0ZNBJxYm8liwT3RKDMg== Received: from BN6PR2001CA0009.namprd20.prod.outlook.com (2603:10b6:404:b4::19) by BN8PR12MB3363.namprd12.prod.outlook.com (2603:10b6:408:48::21) 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:18 +0000 Received: from BN8NAM11FT062.eop-nam11.prod.protection.outlook.com (2603:10b6:404:b4:cafe::6) by BN6PR2001CA0009.outlook.office365.com (2603:10b6:404:b4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22 via Frontend Transport; Thu, 7 Apr 2022 05:31:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT062.mail.protection.outlook.com (10.13.177.34) 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:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 7 Apr 2022 05:31:16 +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:12 -0700 From: Xiaoyu Min To: Ori Kam , Thomas Monjalon , "Ferruh Yigit" , Andrew Rybchenko CC: Subject: [RFC 1/2] ethdev: port flags for pre-configuration flow hints Date: Thu, 7 Apr 2022 13:30:46 +0800 Message-ID: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 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: 380d1f06-bceb-4f48-3564-08da1857d6ef X-MS-TrafficTypeDiagnostic: BN8PR12MB3363: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: REHLjqQsFHRUwk8Mr8iJmPvZNeyEine81GlcZmN/X6TP53dYct6mOcLLzlooufJDjemNRlul6JMfSfORElrgUkibUy9C2oe4vUUHUk6KhU3inILytPzd4UzOIv84O5RzOs2gTHCRfQM3Dm0hFgUoU99gfeYDGMU/DjQrNiMEJz/eJjKF1Bm05mOhcgWI2vy7mF6RG+onUVqdVgXH0sCY593pTB+37u+bGBNe+/T39TwzYIx/422SIe1lvU6VJIUCbTuTp49Dv30ADfmlXKr7sE9gNzVDwyzJc1QorDtRraY37qR1YXpDXGGgmFVOYJm/bx9NUpRtznsbxBYqL1c+STwuVNLXRLlUM7wlMOt+DYIGtSRg/oEDUZDY6Q77qv3TNfBPv+ZUTL9o8+V2geUvmvKmxmcYwoS0ISJl0oROXviTJ44rWWlBoKM3h6pIqP95hHVPdcKHM2Mq0Wp/wpaiaov3VQws9duE2JcGBrLCipKrmKJ/nUTJRoVVTh0Oj1797esFXHcvERLRZyVomiJOJ5L2li1DdSWZrttmtqsLGJA1CCNnMxqCBoffzhBkly1GgZ6fK3FbJVOrjxGMLzKIVxuP1oW4tq4yYa7D2iMtdJcHzEDtAYAzqZr/l5bLTqI2fRNvu1FKAzR5D9MJJjA184JRdki9IDY0vMNGdJhygJTorRXpJxZT1YBW92UecTWX9lL6jUroLZASf1z3I6zJhQ== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(36756003)(186003)(55016003)(508600001)(82310400005)(6666004)(8936002)(5660300002)(26005)(2616005)(2906002)(16526019)(81166007)(70586007)(47076005)(4326008)(8676002)(70206006)(426003)(336012)(7696005)(316002)(356005)(40460700003)(6286002)(86362001)(36860700001)(110136005)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2022 05:31:17.1694 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 380d1f06-bceb-4f48-3564-08da1857d6ef 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.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT062.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3363 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 The data-path focused flow rule management can manage flow rules in more optimized way then tranditional one by using hits provided by application in initialization phase. In addition to the current hints we have in port attr, more hints could be proivded by application about it's behaviour. One example is how the application do with the same flow: A. create/destroy flow on same queue but query flow on different queue or queue-less way (i.e, counter query) B. All flow operations will be exactly on the same queue, by which PMD could be in more optimized way then A because resource could be isolated and access based on queue, without lock for example. This patch add flag about above situation and could be extanded to cover more situations. Signed-off-by: Xiaoyu Min --- lib/ethdev/rte_flow.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index d8827dd184..578dd837f5 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -4875,6 +4875,17 @@ rte_flow_flex_item_release(uint16_t port_id, const struct rte_flow_item_flex_handle *handle, struct rte_flow_error *error); +/** + * The flags of rte flow port + */ +enum rte_flow_port_flag { + /** + * All flow operations for one specified flow will _strictlly_ happen + * on the same queue (create/destroy/query/update). + */ + RTE_FLOW_PORT_FLAG_STRICT_QUEUE = RTE_BIT32(0), +}; + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -4972,6 +4983,11 @@ struct rte_flow_port_attr { * @see RTE_FLOW_ACTION_TYPE_METER */ uint32_t nb_meters; + /** + * Port flags. + * @see enum rte_flow_port_flag + */ + enum rte_flow_port_flag flags; }; /** From patchwork Thu Apr 7 05:30:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Min X-Patchwork-Id: 109396 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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); }; /**