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 EF025A00C3 for ; Sun, 18 Sep 2022 02:58:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E175241148; Sun, 18 Sep 2022 02:58:34 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2042.outbound.protection.outlook.com [40.107.220.42]) by mails.dpdk.org (Postfix) with ESMTP id 97384400D4; Sun, 18 Sep 2022 02:58:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l4RG8nDO2GgLuRi1ZtmmGRA/cKGyc3/YMBD/4E2mcf9vkLy0PtmByj5/K55eAwr9sjVYruAWG71G1noMfewis9QOHpZTyb/4+y5Vuqz23TdoRJ46rpslkQoobMoyaRrIZQO5yp7lLCT9TMAUpS3UQEIUTu7aEjUbfohn1Dcm1DlT5dBJm7Oh+smo2DvXammMt5kNvIOWLvA2IpyGgMkJnRx8hbrbrUouM1wlSxWiVLStEyZ/kcdzY2IAdoHor5ILroG4jRsobtnwNqvGW7yLAriXf/H5ddgako4A21/wycKQoXrOJnYpxeAmM6DFjk/+JCnkQ39CHJSM5O8ZK1ucDg== 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=eqtBQWEBt5xkpHmr84OZz21lYavf82Um381fMnnD3x8=; b=Fc6jSzECDMZ6FNSyNjNPQE9q25jQe0ETr2M3aJF0L8KpYFpBCxrILrVY/kmciTOMPDmB2zsqAv4AUcAURNgtf58baPf+n/nHfvjMw5Ahf1Q26Mn8V2NzhcsCW0+8kzO9SIbwbfN2obvOomECtQUX7W01w2qpSvxsLdLfMjVKq5asL0YNb9HvqBRCXfKu3iTeUMKcp0YsSwN+jUl59lqOEW5tynpEk8EtKisOxlvw6UbkbI6a04ckrKzHZsgeo2VI5RfquE4FCIhjlzCnidQ3pCOPETONE7u6yF90GXg3vmHYoLmWTJDh6125IlqNENqF1WMIrnwTqrolHJRR0a8pKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 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=eqtBQWEBt5xkpHmr84OZz21lYavf82Um381fMnnD3x8=; b=sCFQGgzZj3ZdcYy5C8QXwVNNlx4qqJpxqH7j0jhqwCA8XfDFbtbNGO0pbGiEYIok6lnaOltHPJQyvFrk3zGpkYpihyKD/eEX3aLiKV0MoQmXDJ0U19DpZBpCkHH4/hQ0riBf0MLAI+Oghty9Zd0I01BVQeuKjL4SJfteCEWmksx7ZrdX0BHEMQpvFm9A5oS1NlV0bb3dk9PekBBNQF3UxgpWJKHPFsCJRPCojdeU8dsQ/A5M/HepaBCENSmsjoyHJppgtRPzQkXW0gB0n8r2HZ+O3G7KfpPRPG+CVYrfbW3TaytCITZLOq1/uq8xDfgJ1VVgbleD1m1r+O4RvEE39A== Received: from MW2PR16CA0027.namprd16.prod.outlook.com (2603:10b6:907::40) by BL0PR12MB4850.namprd12.prod.outlook.com (2603:10b6:208:1c5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.18; Sun, 18 Sep 2022 00:58:30 +0000 Received: from CO1NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:907:0:cafe::52) by MW2PR16CA0027.outlook.office365.com (2603:10b6:907::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.18 via Frontend Transport; Sun, 18 Sep 2022 00:58:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT083.mail.protection.outlook.com (10.13.174.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Sun, 18 Sep 2022 00:58:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Sat, 17 Sep 2022 17:58:18 -0700 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.986.29; Sat, 17 Sep 2022 17:58:16 -0700 From: Shun Hao To: , , , "Suanming Mou" CC: , , , Matan Azrad Subject: [PATCH v1] net/mlx5: fix meter profile delete fail Date: Sun, 18 Sep 2022 03:58:02 +0300 Message-ID: <20220918005802.3395176-1-shunh@nvidia.com> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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-TrafficTypeDiagnostic: CO1NAM11FT083:EE_|BL0PR12MB4850:EE_ X-MS-Office365-Filtering-Correlation-Id: df8c500c-c089-4d8a-9d37-08da9910e70a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pRMomLcajH589yzs6X3pKw/PXVZbARVjZp9VCcZe0XY65rWqWWnaMTTPDS2Sz0MAH7mclAQ4oT1gAizhVZX1/sy51/MTCXmf7K96THg285gEFSqaIUeVmDSx2+w9hcSlW+9dnVcRWzIFllMTSxOXGndGvvV0XqG+vW4Fs4WDlrrEygg2VwemUDEBPeiSJna2rHZhGtd5Lvr/KLplgr7q/4rGzpFuiKlkpJB6FgwBmq7LhlvxixmouKUuJNP/d1JZEADWJhNVz3NrmsYPt2pDwBrJc6T7piolm1akmIkzK8IY53C+VOeH8U8BqqYegr2dgrak8lCKbV6miof4kPEk2X+0KB8zvBa7+Fws0jwmJEbz7kYEYtyUvu2g7DV/abjyuSYZoUr1WEKdUmlYHtuTKcC7XN9fVcQrDX4QZS2957ngOpLtYZbQglr9TWVreuXZtQInkOBmY7ILhjKDOYbkya2xQF69Apof/YL7183Bp/yDitJ/Dsxj6EZdiRpm5Dvez0r84+KrMu6FsyPovAdSKzaU7H8qwq080ucvFvnaDY/jX6/UzyQbOxqARarP9WJhxmx397bbR/OfeERXSPp9tw1CDECtfeFlG5AC8jF9u6mOJ8apmtOr32RujjeKKnY87IHQSClrIoXSedLg7P5dCpxDnvDWA2Fh7Sjz2yptwzJ8AYVzQrjWB86yA8POC+6SA8skSwpTBajKRfRbB/HKpMvOZYI5fTw9uAJdulRNZWCGFYPnhEXoPSHfgQetwDPrh0Wlmdtw4D9htazwRZECTA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(39850400004)(376002)(346002)(136003)(451199015)(46966006)(36840700001)(40470700004)(40480700001)(2906002)(82310400005)(36756003)(55016003)(316002)(36860700001)(82740400003)(426003)(47076005)(4326008)(8676002)(5660300002)(70206006)(70586007)(450100002)(8936002)(110136005)(86362001)(54906003)(16526019)(336012)(1076003)(186003)(478600001)(7636003)(2616005)(6286002)(26005)(356005)(83380400001)(40460700003)(6666004)(107886003)(41300700001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2022 00:58:29.9543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df8c500c-c089-4d8a-9d37-08da9910e70a 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4850 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org If a meter's profile is changed after meter disabled, there's an issue that will fail when deleting the old profile. This patch fixes this by adding the correct process to decrease the old profile's reference count when changing profile. Fixes: 63ffeb2ff2 ("net/mlx5: support meter profile update") Cc: stable@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_meter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c index 7c0d84907a..d4aafe4eea 100644 --- a/drivers/net/mlx5/mlx5_flow_meter.c +++ b/drivers/net/mlx5/mlx5_flow_meter.c @@ -1656,7 +1656,7 @@ mlx5_flow_meter_profile_update(struct rte_eth_dev *dev, fm->profile = fmp; /* Update meter params in HW (if not disabled). */ if (fm->active_state == MLX5_FLOW_METER_DISABLE) - return 0; + goto dec_ref_cnt; ret = mlx5_flow_meter_action_modify(priv, fm, &fm->profile->srtcm_prm, modify_bits, fm->active_state, 1); if (ret) { @@ -1666,6 +1666,7 @@ mlx5_flow_meter_profile_update(struct rte_eth_dev *dev, NULL, "Failed to update meter" " parameters in hardware."); } +dec_ref_cnt: old_fmp->ref_cnt--; fmp->ref_cnt++; return 0; -- 2.20.0