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 5BF5443AFD; Sun, 18 Feb 2024 06:12:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C19D40ED1; Sun, 18 Feb 2024 06:12:12 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2083.outbound.protection.outlook.com [40.107.95.83]) by mails.dpdk.org (Postfix) with ESMTP id 47EEA427E5 for ; Sun, 18 Feb 2024 06:12:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XVZ4IzLCn6AyjIffJy5KnWrHR8LEEsJ4BknC7tzGLEJxEoajQIYD4QDTSM86zqFdN/TUGQkIC0IJWwYcZQm7c8ovi7cW6ZxKj5GnX2S/hSm4CWOXMu7iUFwnaki1ZVbRf5PIMhNNYbGKMFTjRQ6+56lJIOHeUhhNmurWfI2ZzaSK2pl3Tqzzf7LxTUunFXrHf2sUBlsMTz0NL97HkfKcaGBxYoJxWIlLLDLc3ii3ddu+i2O8WyNhPMA1YH62u0UHuapMzvsK4RX/TX/mIytBPdLkSaGsEwlwaSWi7iANfIguF0yPSHq6QF5i9XV1dmWJ1zjtWUpshK3XPcnsVUBYSA== 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=UJhiDqlBeo+XYxbdtLuJR2A5BqKb+TXUUrMsmnjAGJc=; b=ipdx/dca/mqc+AlyYGiRivuMCI9eiDuhMEm5aO0JwtBP521iNqg6vwsnz6J+rLhLMjjK2wasaV/LFR5uLC/guKYslw8MGCoT+mtZax66bDRiR/ixdMiDfj69rw8Mj2abD2r6c3w9yTd3vVFubshhhENw1SiZOLb1LhYPRBWgHI0rMw3Qm87PVuyGJXh65cIE9uUv9MLyHso8KDLP4muROPmuf+lyTnnCaE/hCKSlYNzJjDJkKoGNQnU3hzRam2dyDY6qKCsjjV+VbPkcy0zG8amuH+uQON1/lt91VKCCzKHvghkd3JcNi3ORx07irBuvT7uyq6ev1baRQ49Xzz6Nfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net 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=UJhiDqlBeo+XYxbdtLuJR2A5BqKb+TXUUrMsmnjAGJc=; b=VFGXti/5gXiWY1ku4yhi+nIXB9X3UpAaaEtlyGDQSUKIzZIp3Wh94BmLISqOIqSrcBrzwcG/Q/JpKiTUXW9JLSABE3eVfCDklK8IBLtEbX1dCNzIwaMf75ZC6OFPtVJXN+0Gq2iRp22bc1k26EoeU0I3OY4XNhos0acs3Q4uDyzI19s71P+u/2DD97pBeCs7subx14KJ+2ZdIiRzHfB61cYESoRSCCVCod0H+2CBO6xM3qMOXJCkXsdGQqRdmMeTvy4zVKZSfXIVDiL96+n+h5rpZALGuFN8Zl+YIC3vzQ8+Aiw5Giy6cCs7CI7dc+IqZJfyr0Qbf9Vz/vP/tK0gKQ== Received: from CH2PR19CA0005.namprd19.prod.outlook.com (2603:10b6:610:4d::15) by SJ0PR12MB6829.namprd12.prod.outlook.com (2603:10b6:a03:47b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.17; Sun, 18 Feb 2024 05:12:04 +0000 Received: from CH3PEPF00000009.namprd04.prod.outlook.com (2603:10b6:610:4d:cafe::32) by CH2PR19CA0005.outlook.office365.com (2603:10b6:610:4d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.34 via Frontend Transport; Sun, 18 Feb 2024 05:12:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CH3PEPF00000009.mail.protection.outlook.com (10.167.244.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Sun, 18 Feb 2024 05:12:03 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 17 Feb 2024 21:11:55 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Sat, 17 Feb 2024 21:11:54 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12 via Frontend Transport; Sat, 17 Feb 2024 21:11:52 -0800 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad CC: Subject: [v2 05/10] net/mlx5/hws: check the rule status on rule update Date: Sun, 18 Feb 2024 07:11:19 +0200 Message-ID: <20240218051125.717011-5-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240218051125.717011-1-igozlan@nvidia.com> References: <20240213095038.451299-9-igozlan@nvidia.com> <20240218051125.717011-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000009:EE_|SJ0PR12MB6829:EE_ X-MS-Office365-Filtering-Correlation-Id: b066ece3-9cdc-4077-5d30-08dc304024ca X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xaC3qhq0Yz5bbC0LtDnUIkN8rbyddHmIt4Ow+ewjzJES0hbc64ILT5iXbcu50p+jXRjmecYbuv2x+XAn3IJKvTK5Oychoibwpk9/CPfNyB/VRXNJeLYiuFSi5cbdKx/7G4PTFdcV4fZBOxCUizv9m6ml59on9dMylIT9muNGcnpp4jPFBXQ6isZAanSi9YToFT7/EOoFFqC7ol5YjUKyPZbLfukkxQIcaQ6EpWB3A7XSRy0v0ryEWDXJJyhu7VKYAxdAHrH6dSpDV8BmY3nlEt+L+/XKNpBi7gi8g1En6A5gIIKNJlhSn8O1XFAg2N7KwlGCtQHvzMlAoOhSDENeEL1VC0x4GaQd3VhVX0UR5G0/arhYojJSWvCNCqDVsXoMNT/ZrOj8ViFkc6pORheQCESg0tELWYEFsVtMG38FVgpuTQLDeuQvd5LqE2EysRBeLhbsUVdN4v/FiU1LIa0eAuLQNuQEd+fV6se2T9/nce3XsWbEFuKHd/u4fVQF+4KImorblIAHYfMrY2YbEJABNH6/f6keF9i2zTWrXppnMWHgP25sFw4Hy7xWea0tfAvNPOI9T8tKZYNci6FDyVsxGwWuJlVpXCpOugkhWlowC0KDH0iMN2rJyHiDkjkPXGpw3oAcehKI8ZNejN0NQp+upSb54FD7kEpXkeW4oY08Arw= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(376002)(346002)(396003)(230922051799003)(82310400011)(186009)(451199024)(1800799012)(64100799003)(36860700004)(46966006)(40470700004)(15650500001)(2906002)(6666004)(6286002)(26005)(36756003)(7696005)(478600001)(2616005)(82740400003)(7636003)(426003)(336012)(1076003)(356005)(83380400001)(86362001)(4326008)(8936002)(8676002)(70586007)(70206006)(5660300002)(921011)(110136005)(6636002)(316002)(55016003)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2024 05:12:03.1487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b066ece3-9cdc-4077-5d30-08dc304024ca X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000009.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6829 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: Hamdan Igbaria Only allow rule updates for rules with their status value equal to MLX5DR_RULE_STATUS_CREATED. Otherwise, the rule may be in an unstable stage like deleting and this will result in a faulty unexpected scenario. Signed-off-by: Hamdan Igbaria Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_rule.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c index 6bf087e187..aa00c54e53 100644 --- a/drivers/net/mlx5/hws/mlx5dr_rule.c +++ b/drivers/net/mlx5/hws/mlx5dr_rule.c @@ -977,6 +977,12 @@ int mlx5dr_rule_action_update(struct mlx5dr_rule *rule_handle, if (unlikely(mlx5dr_rule_enqueue_precheck_update(rule_handle, attr))) return -rte_errno; + if (rule_handle->status != MLX5DR_RULE_STATUS_CREATED) { + DR_LOG(ERR, "Current rule status does not allow update"); + rte_errno = EBUSY; + return -rte_errno; + } + ret = mlx5dr_rule_create_hws(rule_handle, attr, 0, -- 2.39.3