From patchwork Wed Jun 1 07:39:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Min X-Patchwork-Id: 112196 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 57C89A0547; Wed, 1 Jun 2022 09:39:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 497F740E09; Wed, 1 Jun 2022 09:39:46 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by mails.dpdk.org (Postfix) with ESMTP id C6BF740DF7 for ; Wed, 1 Jun 2022 09:39:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a9VyBDpHpc/s0ZgxuxQXcfJFULfXsZFHpWIHgjA0AInbHMhoz4CyyDlDwFTzZ8K2RdgAlgIqCCkiW3TaVrpJQV/4XmfmBib24aWIEt8cpxe7WbnzDl6ytdKtkMz1+Vcr/u0BQFv2oj5Ki0qElEuQ9Qs0vYP98Z4j2yodOO6UMtuJC3B47q+ZDGuzq0RSheZhzWlD9aJzck6E60vp7PsYgcFb/c2dgd2ehfm99z0BAeNJEcaovGG3H2pHRQyi29jzKplcUp9rU/vJ2RuDdWlLaFmVgui4wzvv/KBHFwboNqbubblqBMhAqxRcgoX2NumqCtZInYbJWwRGfDbIE7z/4Q== 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=aSiegVonyL7LN/41aBNoQvqCvRYU2P36bBXMLvFi3eM=; b=R+FdQ2R0YbsIis4CV7EuI4ZsyTi+glKfh1wiWs3cnVry4Z4gG/ZxHe7GAnKysCRDFfN31P0pnT79T4dPOz9NvhWFONrepWq159ddAFlldbi0iYlVg5hGyMoVPhqxC6FWb4icqatSAP5LdS2XzBCoF/24Nc4qT6vBf7Gb5Vee/gVef7qekJOTblx5YGsNz5vzmSVv/LCOk5IYzmWy3p6Aa6Xxl+uZWSDKC+smiL7xEse0TmbN2HVQrlBiyQrt7yODcskiyj60y1Dco+GRUClZj3kj7o1fBvpbobeWRH2jnon7+zOVlx+tkejONXsUlhnaJ8ZG8nz9qh7cxqswK3FyDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=aSiegVonyL7LN/41aBNoQvqCvRYU2P36bBXMLvFi3eM=; b=EOmLgu5NRTcDn4zHhmgQSwARms9RWre3E9Q7Yk4z34EHjXfKhTw/Tx1qvgXGLGHfJyI3LVPK+Npq7Ho59XBaomWE/1zeredprU82ArgBaNUBlEI26gyvGRBvL3q0qwilWfpnwk2LL8l+JtxOkz+Q66yVT6XOfTj8M8gzrsaxl90HpY74gEk8IuAlQHKRUtCdCSlnYY5SmgSlr+StkoQTfAazMDO8JjOvh7z1iM9Ee2tty0kP9+v7EIi06zz14C/NvoLaeIkBZkn0/urC6neCBxNrkGUrQNUkmXYHrt7AmdAkyeTDGxeNzPHRhUFsy0+hHO3hWzteip3TtfzuyBzkDg== Received: from MWHPR10CA0015.namprd10.prod.outlook.com (2603:10b6:301::25) by DM4PR12MB6589.namprd12.prod.outlook.com (2603:10b6:8:b4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.19; Wed, 1 Jun 2022 07:39:43 +0000 Received: from CO1NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:301:0:cafe::1b) by MWHPR10CA0015.outlook.office365.com (2603:10b6:301::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12 via Frontend Transport; Wed, 1 Jun 2022 07:39:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT055.mail.protection.outlook.com (10.13.175.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5314.12 via Frontend Transport; Wed, 1 Jun 2022 07:39:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 1 Jun 2022 07:39:40 +0000 Received: from nvidia.com (10.126.231.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, 1 Jun 2022 00:39:38 -0700 From: Xiaoyu Min To: , Ori Kam , Ferruh Yigit , Andrew Rybchenko CC: Subject: [RFC v2 1/2] ethdev: port flags for pre-configuration flow hints Date: Wed, 1 Jun 2022 15:39:18 +0800 Message-ID: <608febf8d5d3c434a1eddb2e56f425ebbd6ff0b4.1654063912.git.jackmin@nvidia.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd585039-46b8-4992-d288-08da43a1e3a5 X-MS-TrafficTypeDiagnostic: DM4PR12MB6589: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: pcogULH+40tE7mBxGPFSMvnUxznJCQjz2r6r4YgyEsoarxNTssyhXvkVfmVPzRpKmQjzz6iwvJsqiaig/rQNz4x+Q/+f3jd6Hupf06dpILhC72q4hYPDqg8iM/DWZTMlZdZO1f3YQOvB+01YfcjMW1feq1Zg4v9M9CRdv+qeGD+rXBEl0WPtQQSAtjgYbvVkQBe5MrzthK67Q6JrD0ui+F2Y4AUvY5oYB7k+p8RhTTBRCmHmnQ6DCxiI4fzqgr4FGYmsEejVFCSSLpcmLkZ9SmwAdbNv0CcbP4PRp3c+oN3Tz7sVdFrua7ioDNUY+iqRHLcW0pqbvkfRgVAd7iohM7k130TZOJ0+bwTHK6DBfQsZsjoUCGRzFxVp0UrrXaja30tMQcF80dLbN8OX+VPxWOX4F1kunaZLQS8qjC+tyVtp4iueQ7uUcLoW9rCpHJJlOL1v6G2ZV3fyZ6SU7P+SiE5b7ULehgchL8P9Q6ba43mlIY8yAipsBGLQDVcPnHN9OvyQkCYPV7T07BEBZdPG8xSL4Z7D93YiLVtrga4cHu9VRBCXPm4SCfsZmdRd4Jfz2XmcBvwMiUvTbxo67QxBGlZ5ICdyIjDC6513swB3995O0zpbpDCxWXSOLXGGyA68Ccl3k3V4ma9pdhAZRbcjg+7t3i/VEk+OxfsY2RolyzSjX96xsvrYctkNhDYR8fmco12TqO2artoNt6SowDxiJg== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(36860700001)(83380400001)(6666004)(7696005)(82310400005)(26005)(316002)(186003)(16526019)(6286002)(47076005)(426003)(336012)(508600001)(36756003)(8676002)(55016003)(2616005)(110136005)(40460700003)(5660300002)(8936002)(86362001)(70586007)(356005)(70206006)(81166007)(4326008)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2022 07:39:41.3187 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd585039-46b8-4992-d288-08da43a1e3a5 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6589 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 than traditional one by using hints provided by application in initialization phase. In addition to the current hints we have in port attr, more hints could be provided by application about its behaviour. One example is how the application do with the same flow rule ? 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 extended to cover more situations. Signed-off-by: Xiaoyu Min Acked-by: Ori Kam --- lib/ethdev/rte_flow.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index d8827dd184..38439fcd1d 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -4948,6 +4948,12 @@ rte_flow_info_get(uint16_t port_id, struct rte_flow_queue_info *queue_info, struct rte_flow_error *error); +/** + * Indicate all operations for a given flow rule will _strictly_ happen + * on the same queue (create/destroy/query/update). + */ +#define RTE_FLOW_PORT_FLAG_STRICT_QUEUE RTE_BIT32(0) + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -4972,6 +4978,11 @@ struct rte_flow_port_attr { * @see RTE_FLOW_ACTION_TYPE_METER */ uint32_t nb_meters; + /** + * Port flags. + * @see RTE_FLOW_PORT_FLAG_STRICT_QUEUE + */ + uint32_t flags; }; /** From patchwork Wed Jun 1 07:39:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Min X-Patchwork-Id: 112197 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 5A8A7A0547; Wed, 1 Jun 2022 09:39:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 31BFF427FF; Wed, 1 Jun 2022 09:39:50 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2048.outbound.protection.outlook.com [40.107.94.48]) by mails.dpdk.org (Postfix) with ESMTP id 5F52B40689 for ; Wed, 1 Jun 2022 09:39:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X4UXnI9o8gG7e8kLitMmWntPXh/znHPXwtGo0SuTU10eObWillEUr6D268KcJlqJjyTOZvY1uUqAi6hcB1Lbooy3SLWbJi3GZH07Cce55zBm5gUIND+JYVAeB979EXZH76rfPdIrAqUXm5SwKv2V7ZmiCqJc0jQ643wcEwLr77NT2AFxYdyaoOJ4AnLpM2bFpGqckUdXGS7DSMtXByZoI50eKtiiDJsjdY6B1rNAlIl2+MKoTlnJFWy2jZJHvvwZUnP/cPfC/7B4qGy80u1TdDVSRm2qS3RZ/KPg9u7vbRUrctr4ORZXJRGXmY8AMp5mztzm9wdiIyl+3B0QTXTfZQ== 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=pyIVVvBTI/dGRsH0uWD9vkoFiTT+lgWJO5wOscQRggA=; b=V8d7sWmIUOkEfI3T1RUUaadhhOPZDaSbOEFlJvLAAxJCZxZJXU/dhz/VJ4bdmSUSgigwZXKdAFNSS/C95aOR68OhUFavz+qH4XlEwsN2q95fjworTmCBOGbHJPZr8BDHXbzkP9bJAio82LWdeQzFqZVzv4YYcJfqmJK+hW024a520nDYBcxDpXaZwq9GIN14/y5hV7Zwa7Q3fMQZQMddy9EAN8SmQ7F+AR3DC8ZRIH2MT4HPmjCJvVangyc0G5dc5sQgtc+B6Ip5VlScAose6aPgSfYWsvXJaQ9ZRps10lprSRZjR1ChCNCMJF3LDkI9taYw+KC9Zx65IAudcMGWmQ== 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=pyIVVvBTI/dGRsH0uWD9vkoFiTT+lgWJO5wOscQRggA=; b=f692nSBhdpaI9jiMOKgcPG0bicWAqfbW0Of7iDZrlCdcoWYiZiZbeo4xzTIEE7onk0P0u33eOjFPJZGeQBkBJJVgsrJz3I/Xc9HPk+ZJqOiJjlyksOKYI8iV6NEVjgZo9Yfix2o4tWhSrAyP5zU3sMy8oLsPj6Cv7cqpaZwdIlRuv0IZKxeHmk1wmFHaUrGWE3w2DMNTD8X3N/zR/fbZ+UwhrpieXuo5XjwRMFqUiG5KIYKgqeVTZ1h2NZVa8nZjlEp7v5w9Vs/VHFyqmRtex53EgYe9bzzXWdYuLKLlgorUIC7oZVxQvoC0zk6muYbyf1P+S1L0FRPEJgTdKXdiIQ== Received: from BN0PR04CA0102.namprd04.prod.outlook.com (2603:10b6:408:ec::17) by DM6PR12MB3004.namprd12.prod.outlook.com (2603:10b6:5:11b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Wed, 1 Jun 2022 07:39:46 +0000 Received: from BN8NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ec:cafe::56) by BN0PR04CA0102.outlook.office365.com (2603:10b6:408:ec::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Wed, 1 Jun 2022 07:39:46 +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; pr=C Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT038.mail.protection.outlook.com (10.13.176.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5314.12 via Frontend Transport; Wed, 1 Jun 2022 07:39:44 +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; Wed, 1 Jun 2022 07:39:44 +0000 Received: from nvidia.com (10.126.231.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, 1 Jun 2022 00:39:42 -0700 From: Xiaoyu Min To: , Ori Kam , Ferruh Yigit , Andrew Rybchenko CC: Subject: [RFC v2 2/2] ethdev: queue-based flow aged report Date: Wed, 1 Jun 2022 15:39:19 +0800 Message-ID: <7a45693f478b1b721b4e05131141b526185a175c.1654063912.git.jackmin@nvidia.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2db35d2-af82-4134-9743-08da43a1e5d9 X-MS-TrafficTypeDiagnostic: DM6PR12MB3004: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: h+859afXtiZjtuxnlzBucgFOYle4iTMuTvMuaBHCXfeISpseFL5G3PA/kKfVqfvcWCNxdQ1a+8+dqtfLFVFCVctiLL5FfSrloGaPhc49t2J0v5AEAzsNyvpgyUHpBSDG9s+aReUBc06IiQFqDKAj+XR2gJbobG3ieXScOcgXmHlUxK20KpU3d3WJVBvmsEZPfSZquhjliPnPaMMTnv2yGj70aKHxCIFH/zEJ9eGHGxXh/w5iwuEMuJlwIj/ZUfxIRKAG8w1L4QWamFjJv3CDqCF++rDlS04HJiWj63rwryw+CQMg8nOTs3UyDNkaJ8YYRhi2CXw2Eg2FtZCzRABg9QDS0sgKnWwgCYMmmbvdq5MDIhl2BjBb+shFuUt9HgYYaV3I04ZOHEdZ7uxwjjnanZFPvgqixqEGrh9DRUJCsOoZ6iAnLFNRBhjspiU6tMNpOrKojgtub0KKBj8RISSJMMWEYlh1pOnK4JEHJG0z4VrjSHWTDknCJGLtgsQTxqGofD/V15HkIhNxkB+RUJz2y/FlCxjxXNussjnNpq+0fjfOlaL2RnP8JO2HIM3FmYEv08ylFhxupgavZzknVOMgSPhUGCku+/gv4iOhrtvVM07Lf8yS4VgChjMVtwgOFiUGvVgEpatrHW3pCC8vB5R98wvL3WrkyVeNtF938jTPDCbHRKNRYhByst2fPMA3aExa8CALxsGExFBnFiWFfWz8iA== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(2906002)(110136005)(26005)(316002)(82310400005)(6286002)(2616005)(8676002)(36860700001)(55016003)(508600001)(47076005)(7696005)(356005)(81166007)(6666004)(86362001)(16526019)(40460700003)(186003)(336012)(36756003)(8936002)(83380400001)(426003)(70206006)(70586007)(4326008)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2022 07:39:44.9666 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2db35d2-af82-4134-9743-08da43a1e5d9 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: BN8NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3004 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 rule management and operate the same flow rule on the same queue, e.g create/destroy/query, API of querying aged flow rules should also have 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 a given flow rule on different queues, the queue id parameter will be ignored. In addition to the above change, another new API is added which help the application get information about which queues have aged out flows after RTE_ETH_EVENT_FLOW_AGED event received. The queried queue id can be used in the above queue based query aged flows API. Signed-off-by: Xiaoyu Min Signed-off-by: Xiaoyu Min --- lib/ethdev/rte_flow.h | 82 ++++++++++++++++++++++++++++++++++++ lib/ethdev/rte_flow_driver.h | 13 ++++++ 2 files changed, 95 insertions(+) diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 38439fcd1d..a12becfe3b 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, @@ -5624,6 +5625,87 @@ rte_flow_async_action_handle_update(uint16_t port_id, const void *update, void *user_data, struct rte_flow_error *error); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Get flow queues which have aged out flows on a given port. + * + * The application can use this function to query which queues have aged out flows after + * a RTE_ETH_EVENT_FLOW_AGED event is received so the returned queue id can be used to + * get aged out flows on this given queue by call rte_flow_get_q_aged_flows. + * + * This function can be called from the event callback or synchronously regardless of the event. + * + * @param port_id + * Port identifier of Ethernet device. + * @param[in, out] queue_id + * Array of queue id that will be set. + * @param[in] nb_queue_id + * Maximum number of the queue id that can be returned. + * This value should be equal to the size of the queue_id array. + * @param[out] error + * Perform verbose error reporting if not NULL. Initialized in case of + * error only. + * + * @return + * if nb_queue_id is 0, return the amount of all queues which have aged out flows. + * if nb_queue_id is not 0 , return the amount of queues which have aged out flows + * reported in the queue_id array, otherwise negative errno value. + * + * @see rte_flow_action_age + * @see RTE_ETH_EVENT_FLOW_AGED + */ + +__rte_experimental +int +rte_flow_get_aged_queues(uint16_t port_id, uint32_t queue_id[], uint32_t nb_queue_id, + struct rte_flow_error *error); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Get aged-out flows of a given port on the given flow queue. + * + * RTE_ETH_EVENT_FLOW_AGED event will be triggered at least one new aged out flow was + * detected on any flow queue after the last call to rte_flow_get_q_aged_flows. + * + * The application can use rte_flow_get_aged_queues to query which queues have aged + * out flows after RTE_ETH_EVEN_FLOW_AGED event. + * + * 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..b665170bf4 100644 --- a/lib/ethdev/rte_flow_driver.h +++ b/lib/ethdev/rte_flow_driver.h @@ -260,6 +260,19 @@ struct rte_flow_ops { const void *update, void *user_data, struct rte_flow_error *error); + /** See rte_flow_get_aged_queues() */ + int (*get_aged_queues) + (uint16_t port_id, + uint32_t queue_id[], + uint32_t nb_queue_id, + 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); }; /**