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 381FA43C35; Thu, 29 Feb 2024 12:52:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A4A0410FD; Thu, 29 Feb 2024 12:52:39 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2071.outbound.protection.outlook.com [40.107.244.71]) by mails.dpdk.org (Postfix) with ESMTP id 0AB0440E36 for ; Thu, 29 Feb 2024 12:52:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gjI8PBI278BMrDc71+3JDa6S43JThyf7odo8Zq3FtKlrgYunpIbRxRPbloBgEY5li5xwGuoIKkDrbw4TJa9YbRZ+IEczWr7s/16nZZTIis94bDjxKPVwpp8kq9wnmCA4vaJCUv0MqlJ+5/B3kepMiWpegZMiyHNTU8/gm04VBlODxtFtgm0rn8W84UkVjLTH4FxCIU1EDFhn0WjO66RzOzliAhAd6mafh/ZbrG1cnY9hrqTtt7jtzi5OO9IxkCo+ggM3kFJzx8EMD//bPRYjQS2iZwQY8AiirOfmqcRpY8WByrcei941M59T3AK/D0Tl929C9+r9A+o46Enr77Lx4Q== 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=r5FOxgIxIxNCGHFYNs0039XnsKjmdH627p/IJEj1hpk=; b=UfQWPuJNPxIy86dk3H1+U+xC8Q9suyHr2ZnrGbcKrRJpx7j7kBmsncAZ31Ea9lI4RoWaSeRitNBqaAmcIFYkCCX2kihHRJD7/8hCC/LIBBDt6sHmIqcJYY6EUQ2Jg0HIihdWwesZZ5+gXpGNpu1Ht3zcPqVoLlRhQxviF/K1OSqPyHvtKyroP+f5zORRkjpC2hJleyA6iX+RQ1KbGbcVKrQ+YXdn0mYmjqcHx33HhZhnYagYlohWI+nnqi3f3se9kxxaInlII8M7/isMZzKCSZkTZ5EVnmjC8tMXQr9JW5byvoIvr63G8TkOaoXlvPXUkShTO0d3z8G3F9wcRo1FUA== 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=r5FOxgIxIxNCGHFYNs0039XnsKjmdH627p/IJEj1hpk=; b=g1O/iwTeT868598kJWXaJ9mDfhxRnpLl0F3VvznoqVcMlEpb1yGiO1HXZNukwufzxu5rQrr8ZLNnRkYoabMyyD4BfW455HvrnL8bIxLZgPGOTGEHC4J//FQfNWVnnR53tc5WDtFK+ZfHcXN0eH+EvKFwDYzwB705GkPDMSn3oNNGBp48rR2AqaAHUQ9pJ7ooUC6FmIL0D1M8+rYPbSH7RJSnU6V/L6LbVVDN/StHwjVws6SF5VXEQt6mWxQl8I/RnIZFLJx8MqB+fQ+3x3MrjC8VoE+XDOvrfrAvswm28VlHmfnJTogQdy5Jb7o7SsG13QIjDef49t6/OAaRKXPeBA== Received: from BL1PR13CA0216.namprd13.prod.outlook.com (2603:10b6:208:2bf::11) by DM4PR12MB7576.namprd12.prod.outlook.com (2603:10b6:8:10c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb 2024 11:52:35 +0000 Received: from BL6PEPF0001AB4C.namprd04.prod.outlook.com (2603:10b6:208:2bf:cafe::5d) by BL1PR13CA0216.outlook.office365.com (2603:10b6:208:2bf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.13 via Frontend Transport; Thu, 29 Feb 2024 11:52:35 +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 BL6PEPF0001AB4C.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Thu, 29 Feb 2024 11:52:35 +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; Thu, 29 Feb 2024 03:52:17 -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; Thu, 29 Feb 2024 03:52:14 -0800 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad CC: , Raslan Darawsheh , Bing Zhao , Erez Shitrit Subject: [PATCH v2 02/11] net/mlx5/hws: add check for matcher rule update support Date: Thu, 29 Feb 2024 12:51:47 +0100 Message-ID: <20240229115157.201671-3-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240229115157.201671-1-dsosnowski@nvidia.com> References: <20240228170046.176600-1-dsosnowski@nvidia.com> <20240229115157.201671-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4C:EE_|DM4PR12MB7576:EE_ X-MS-Office365-Filtering-Correlation-Id: 90be83b0-aacf-4c29-6b25-08dc391ceb91 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FmQFxTZneurkjRCPNj2GlcPchcGxPSRi3jRLJrpaHwMAEmA32DSPRUOa+Enm39PZst30QvtSdP72Ud7aV98f2IAGWUbfmuvLML9qJ7qG0mqSe3LZhQw69O1yHjZW5T7FPnPgLDYxS4tm123QvsEk9DeYcEw1Iur5CzXqvtrnxSvjyl0W9fMDvROO9hTKe8BA9ib481Wq8nrLkJVotAanRW6/VJCSvv35MYzHnOo1xuvhlHyTg+n9zZrYNVM0KIkGKPDmyVvang7kJKOSAGjrJiuABpQq+HNLwnVPuclZOmSlpc3B0ct2NeHR7qwugO6zkQV42drtfNJqQNbe17a/65LpGEQ+YJxw/b0c95AsbRazysgMIQng9OScZHlv0AIzAhBD37Xy5qB+qm4aFgcemQbQ5iR3gLyKkwlvJXKse2u9F78Jq/s+JqEfhlj3p7Gm3y0XzJvb6FRCwr69y4yRVky0mpdzkgSBLcO0Z60/NL1Il6SHm83OVbveD3tQXW70LA5bS4FpRBGVSz4NHUqOsMJteEJvLwWQ83QQHerQnQKqlPJIObMMqRYc+LMy+3XuAyAULEQAMNSwmPJxcQOqVNKn/dq18X5bXzUNwuwcDW0Oxjec3bzF8ZgTX6BfGHtt4eU9hOQ7akGTHfGnRSoqf2OV48ROnYkdVm20/UGzanIW/YzwUjWO1dWOFYsHGpl37jfsG+rN0o5yF4rPGHAdXXqQ8+TxFTRubCXypxFVRCEPWTEVIQhqN96qAoDRb4Ur 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: 29 Feb 2024 11:52:35.0842 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90be83b0-aacf-4c29-6b25-08dc391ceb91 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: BL6PEPF0001AB4C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7576 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 Acked-by: Ori Kam --- 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 8441ae97e9..c5824a6480 100644 --- a/drivers/net/mlx5/hws/mlx5dr.h +++ b/drivers/net/mlx5/hws/mlx5dr.h @@ -492,6 +492,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