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 82ED643C2C; Wed, 28 Feb 2024 18:01:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FDC442EC7; Wed, 28 Feb 2024 18:01:41 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2063.outbound.protection.outlook.com [40.107.220.63]) by mails.dpdk.org (Postfix) with ESMTP id C349A427DC for ; Wed, 28 Feb 2024 18:01:39 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lhj5MRJxF6Rkko2ViQVp3uRwqFmJdfo8OrsU+edAcf21MinjWuI8EPqAT2UjMK5TOCQZ+EhbJ6bEAGpSDum+EHAykNT8YktTrQnEP4L+6AXsvaBuduej0HZIVfjS1Oiz+qhxsE5jKz9/JfsG1buPe5JLhGZ0eo9jeoc++94bvWFWnHzc3Q4aqqKRkWtHVGXiYV2La/8V4LUnxA06g8xpakSsgNRav2J7Tj3tYfbmPvLUvF7XOE3WUUSfzR1UnkhITxMxT4myGbWvqu2PlVyhul66o9bChbLadzVfMpKMFVF1KJ+f88cj8hEdUFWxDWSyf8dbStZGmzFZGpk++CUJqA== 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=q/epHbG1dWUHwGzKcM7OzwXlRekbmJHuqRhVpfUqL5Q=; b=cdoBzzIkUwMr3VRK/GeaMR1iRSvOYnuzR++wjLmVgNmYovZ2QorqfPokibKuav//zHXeNqOAVo/Dop8vJmBiEhoKa7FqFG9MRkLk1JBSRecIHQakJHZl4axSEIBLlB45Jdr3le0pMF9phupOYXfOXTBD0vHYB4RsLC4KwRMYOCP34oOFkTbv8nMqY1W7Tb7rzD870jlkNH1JRFhhuF1rSy/JporEIdGCY4cnbvMpwmy+svjuS5UKI5e3H5lHaE+6vKz5z8P/zzIbYYRrKm9ftoSlZzW2AHuaB+Q7dAMI3MFD9LooVmZeZYoYICbRjcj9Px2dhMQBiwPk+9OzOJaCPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org 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 (0) 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=q/epHbG1dWUHwGzKcM7OzwXlRekbmJHuqRhVpfUqL5Q=; b=XGdHDZ/TsSEA3y+BLiJQAuFFZj0fM/tbOpEkQsc/jdBgXVjr0GWFe2SfGQ6LYb50VCF8wLI1SYupOv1ScFKWmTqe5yTQHT6W35kWUqQMWEeFATirZReXdSWebglVP/yNQEfqQqHBRekUnDjaLSQPc0koggZDK6Cw2ZvEOl/NfRbZkmvIe9tEdteypvITVHTgU6kZfP6VpovObS17LfLdsMRD1L6VlhztYUF51ojR1/p5ukrevucaAgnwlO7dr81QEaOJbmmPv7jhwrT7s/I3voXUL4P5YUoC719EF28BxVHyA8Ji7JTLVkPWB1XKKnuM2SQSOa1yUVd0tXhX00UoQw== Received: from MN2PR07CA0014.namprd07.prod.outlook.com (2603:10b6:208:1a0::24) by DM6PR12MB4530.namprd12.prod.outlook.com (2603:10b6:5:2aa::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.39; Wed, 28 Feb 2024 17:01:36 +0000 Received: from BL02EPF0001A106.namprd05.prod.outlook.com (2603:10b6:208:1a0:cafe::86) by MN2PR07CA0014.outlook.office365.com (2603:10b6:208:1a0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.50 via Frontend Transport; Wed, 28 Feb 2024 17:01:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0001A106.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Wed, 28 Feb 2024 17:01:36 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 28 Feb 2024 09:01:09 -0800 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.1258.12; Wed, 28 Feb 2024 09:01:06 -0800 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad CC: , Raslan Darawsheh , Bing Zhao , Erez Shitrit Subject: [PATCH 02/11] net/mlx5/hws: add check for matcher rule update support Date: Wed, 28 Feb 2024 18:00:37 +0100 Message-ID: <20240228170046.176600-3-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240228170046.176600-1-dsosnowski@nvidia.com> References: <20240228170046.176600-1-dsosnowski@nvidia.com> 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-TrafficTypeDiagnostic: BL02EPF0001A106:EE_|DM6PR12MB4530:EE_ X-MS-Office365-Filtering-Correlation-Id: 298fdd8f-10db-4ef9-900f-08dc387eec72 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BjNj6dT7br6fszJkkgFGwfm3PrcpPluth1FMNd+oKP8Id5OQQ6usd1N560Cipf1k6+jsE8UIfkb4ZUyp/U+ZfhR+hQYLkV1H+v8lRzq8rXdtA+gawA+srlKir7rD57Fxu5RRWo4E783OA2sOFMecGYXfoxa7svmAWtLdaMfr6SPxfGGCO7ZP91/vGH+5PkH1Z7J1mAzBI5tefueCnHQnw2IzKKSsaXD2lzU0YPpDNWwBS6In2EOLLIamd8RmpW72wHyH5yJmHy02WYfCtVP4I5nCyaZWJxrSi+Nsvt4d9gg9ngsJCAy3cSEPKe1oXoInAOXRXFHU3Yn4WOr3tPmWy5MYpMUJVbFuJqds0HDQP8MY2O/mdqlJOTrOOdUE1zlDi79QWGqUTI3PMI0XcfAcwxYBqmW+MHhvffAIA3Q/9tAcoh+N9LNlPUGUb6ivv9+uXntkmuOhohyoMeyilWAGYOPmkMLLAQ1Q9zsJqmxRmpIYgtaAWGOiZw1CQMD6jGQrXkQagukwuCDZpPnCPTF1IhRswKBk2N6NpCugKvbqQ/J0RsW5LXAj7HB6FE711Cd9tgAXUKNso0BNo0EcuxZaGm9GR2YIZEk/WQI+uGrzuSPF78RADLSE8vYpzqC00D8mtuXU6A2OXfZ2MRaRDXH6EqlKCJTg5gT+tpCxZreOOGti0NB2amyiYNQEm/226voc26ywV7P8HHoCJDA1wDzkwDxyNCA1WzJvgMkjSpEnszg8Tzn081ZOfZPQhiPpxT6G X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2024 17:01:36.1702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 298fdd8f-10db-4ef9-900f-08dc387eec72 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A106.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4530 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 From: Erez Shitrit The user want to know before trying to update a rule if that matcher that keeps the original rule supports updating. Signed-off-by: Erez Shitrit --- drivers/net/mlx5/hws/mlx5dr.h | 8 ++++++++ drivers/net/mlx5/hws/mlx5dr_matcher.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h index d612f300c6..781b11e681 100644 --- a/drivers/net/mlx5/hws/mlx5dr.h +++ b/drivers/net/mlx5/hws/mlx5dr.h @@ -491,6 +491,14 @@ int mlx5dr_matcher_resize_rule_move(struct mlx5dr_matcher *src_matcher, struct mlx5dr_rule *rule, struct mlx5dr_rule_attr *attr); +/* Check matcher ability to update existing rules + * + * @param[in] matcher + * that the rule belongs to. + * @return true when the matcher is updatable false otherwise. + */ +bool mlx5dr_matcher_is_updatable(struct mlx5dr_matcher *matcher); + /* Get the size of the rule handle (mlx5dr_rule) to be used on rule creation. * * @return size in bytes of rule handle struct. diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c index 8a74a1ed7d..4e4da8e8f6 100644 --- a/drivers/net/mlx5/hws/mlx5dr_matcher.c +++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c @@ -1530,6 +1530,18 @@ int mlx5dr_match_template_destroy(struct mlx5dr_match_template *mt) return 0; } +bool mlx5dr_matcher_is_updatable(struct mlx5dr_matcher *matcher) +{ + if (mlx5dr_table_is_root(matcher->tbl) || + mlx5dr_matcher_req_fw_wqe(matcher) || + mlx5dr_matcher_is_resizable(matcher) || + (!matcher->attr.optimize_using_rule_idx && + !mlx5dr_matcher_is_insert_by_idx(matcher))) + return false; + + return true; +} + static int mlx5dr_matcher_resize_precheck(struct mlx5dr_matcher *src_matcher, struct mlx5dr_matcher *dst_matcher) { -- 2.39.2