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 E06BB43B05; Tue, 13 Feb 2024 10:51:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4477541153; Tue, 13 Feb 2024 10:51:21 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2067.outbound.protection.outlook.com [40.107.94.67]) by mails.dpdk.org (Postfix) with ESMTP id 4EDB94027B for ; Tue, 13 Feb 2024 10:51:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WyG29FeiiyJIuBu0KvjgXjEm9nkjCyYC9/JxzBaQR+MNguKoMymYeGsbtsd4a8a3n4PzhFpxKLohnAiJcfQG4bnkuYIxSHKkkgPh5AW6M9kxGezDqqHV/NW+zzqOq7cXs2yf4ufxiWyckwFfV4cNLba4nIWYny6zPNTeBGRenFwMd4PYw/QHNFIiYyJWukAc6SAgZvWlUo5za72qlV5g8bJEhw8rDC9PbM86yVsx6VO6XgTDw+739ymsU4yIZkxoiaNWiN1fXkIHejqFWBonu8J0rCGyz0zMxSxYc+o1+6/SqqCdKipWFqEn8lbz8rvTDpe430waqZrM8EpcuMdr7g== 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=JVNafvLasqN67HOIlC5wcn8s1rvGw64zdUZ4aXkDQiirG3gtbqEHSeO85AOse5UgpaZd3zLHCh0YdSrvuBK4CSh0647qdFA/bAAv5ZXQM3iUR5xj65ZyDxEYmdr/TB5OowBG4BIt7w/r17gSe8+YsvWN0UGI3ray1suEoIG4/UHtWB9Hk8arbzu3Pn/OpNO+RSTqb78ZJ8knlUPFY2LEtTj3drUixxXaNMIljzuBdmMivCy8FJEi6imcsayTB3fVyOMKyP8qvu2IuhHhOJqGc2hpSunCohnRXnKR8xsHcagB4Rf6uZj5rPSc21r/cQru6wwD2qCWqXvcrVb6R1bYfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=HekPhhestK7ivQmDcy9RX8eL+xSct9AKo8nukGmW+iKg8rVTeos71QHAxJnVcPw27VSQvYPIpIt12xOK9nLOh4EV8TGDdMTH6HBRUn6NCjHo9b3jvu0se8OZ2qVwmw6ac1jkkmYm8Zunz6+iXq4WSyxPx2mpqzOyY2Us5O0c4E1a279XuGIPgAnmmAO86bbS8yYfK1hrN8uM7X4NdlCQ16KxYJKs9eU4kon7Nxkpm5hKbTxTGUXmiqRSdxiKMi8xKRmOTMAzcmu0SrSVWHi9cL8Iy+IZM1UgZQZ+yJQTnTW3K42TCeazX5qTrmrbgBjA+o9TkUZmCm9E3TssRHvh9A== Received: from CH2PR19CA0020.namprd19.prod.outlook.com (2603:10b6:610:4d::30) by SJ2PR12MB8012.namprd12.prod.outlook.com (2603:10b6:a03:4c7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.14; Tue, 13 Feb 2024 09:51:17 +0000 Received: from CH2PEPF0000009A.namprd02.prod.outlook.com (2603:10b6:610:4d:cafe::6b) by CH2PR19CA0020.outlook.office365.com (2603:10b6:610:4d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39 via Frontend Transport; Tue, 13 Feb 2024 09:51:17 +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 CH2PEPF0000009A.mail.protection.outlook.com (10.167.244.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Tue, 13 Feb 2024 09:51:17 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) 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; Tue, 13 Feb 2024 01:51:04 -0800 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 13 Feb 2024 01:51:03 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41 via Frontend Transport; Tue, 13 Feb 2024 01:51:01 -0800 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad CC: Subject: [PATCH 5/9] net/mlx5/hws: check the rule status on rule update Date: Tue, 13 Feb 2024 11:50:33 +0200 Message-ID: <20240213095038.451299-5-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240213095038.451299-1-igozlan@nvidia.com> References: <20240213095038.451299-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: CH2PEPF0000009A:EE_|SJ2PR12MB8012:EE_ X-MS-Office365-Filtering-Correlation-Id: a0ac552f-92c7-40c2-b2ee-08dc2c7952d5 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: TvYRXwVlWQ/I5Kgk0Ozr1XKTtEWqEeoXbOsgqCnR0RA6trAvvZDnikee+rGpz5l/0LoF8O0sURypSzFjFyiNwSYWeArRP+JD1ywXKOTMOxxq1WOnBNh3gzekyubJkbU9H2a79E68R+bqrI9gV8/2KAcPUYu102sMlTjki890gmwdQplmFrEuldubpkt6OUKxijwXOLjiWcmaJF7J+Fqq6lxT40qkIEd5r9f2CB9sKD0eq0zdj0lRhBMIS4Rq9nuxu6IfXwr7CXyvsOt5A7ABqCEl7rgCcc/fdWqlHTB75nRI6Wp9nUp4vavtxS3Gvzbm8jdNHuMQ6mJMT5gbpfThMx4uG8KnLj6KWdH9nAbVBHN8VI9lXU0fJdSvevL4YG76vK0l3qkvgVC9fgaRvR/cF+Dze9NfyNZkZ4Oaydz8KcrtV893oQD6EzJBzJznD1TnNGTEK1KrD4/6rzq/swBEpwrm+CSx1VeAVwJhP1ovo7ikpa9rnloPUYoViUjdu6hIEDs0iJ/IzjKNbx0qkt6oTn4jtUyqtJ4K1p839AvtEqZN0pMmxP3NmW/8KAFPRjEhNZTtai6MGwCsXJLrdxGrHmqbGg2jBkrGQ841j7lY5XjsszWdAk9T8wErGP7xNu2XTdoCaUPWoA6QFqH32EoVrw== 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)(4636009)(376002)(136003)(396003)(346002)(39860400002)(230922051799003)(64100799003)(82310400011)(451199024)(1800799012)(186009)(40470700004)(46966006)(36840700001)(2616005)(83380400001)(82740400003)(26005)(1076003)(356005)(7696005)(336012)(6286002)(41300700001)(36756003)(86362001)(6666004)(426003)(921011)(7636003)(478600001)(4326008)(8676002)(55016003)(8936002)(5660300002)(2906002)(15650500001)(70586007)(6636002)(70206006)(110136005)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 09:51:17.0606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0ac552f-92c7-40c2-b2ee-08dc2c7952d5 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: CH2PEPF0000009A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8012 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