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 5F999433C8 for ; Fri, 8 Mar 2024 04:23:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4122A40291; Fri, 8 Mar 2024 04:23:07 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2051.outbound.protection.outlook.com [40.107.223.51]) by mails.dpdk.org (Postfix) with ESMTP id 2B57C40284; Fri, 8 Mar 2024 04:23:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hpZq4+Nty7BT7Fz+ZFViH1eakSFwUkKCosGu044K6lSsmvaL/rLD7PzOa670NqiH6vfzwqrzzG9uS6ES9yUCpehx/fLNXP9d0rKYSg5gShEXyOYGRhhaYrmPVXl2CcrOHhROTmgmnzIx9j+ngFU/Wc+qR2CJ9AYTQ5Y2m5YBFl4PHETwXTTIEd6tEzBKX976TwEY3k5FQruV8Rx0VLqz7Xlv/H3CVXhx1Gho+UF6nNAhkT8oFyzlHpGg5f8z13xd1/HSOHJhSb8PLR+b6TVcEOITBxlIC5I+8WWOYfKoqG1+LiVkc+Yje/zveb2KoHmN2kh6B65YeCb/Fa4MJsPFIQ== 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=PNjraey9Pr8bKFICw5BZaQXF8/r95M4rDNPwoDAcR1Y=; b=g3xDMX5Q96kET848eB4sl892WeSGPZL5HoUF0LC8mPQrdZBXRFwWTp45KeI6O/MTKUyWJ8OlPyqq0LjMWilKyawK6JC810282R/U4v5vk5p0xd+JJQC2rryf8w95XrJlC/y6l86Ttta9ARVUTgTtpBWYqPr6JFjKmjMgMzLDhFI/VA7TnLT5AqxuOOQovyvTsZCJ/L8RMnstjdBAjKwhhOMJ0BlAFEg/6ihhQ4ZsoSS7iqq3E06SrbXs3CuuH1UDljoYM8ZmkL4ssCMcj1n9UtTU1a534pYnxTNugMhPaPncAJT17WqQ6lv2MfzaxrletQIPgG0WOcCBYMXSP0GMcw== 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=PNjraey9Pr8bKFICw5BZaQXF8/r95M4rDNPwoDAcR1Y=; b=qzjp41TUpf4kndBrzMBnprRYUUv6hV4DaUE+snQ8VKwRxK+Zimd310ZSqPhEVBeRVQWmXiwOO2mvdx9YYsGn64/75IZk7jDwLcbQhw+CqNJlcqn0BRrA32fCjlkfC7pdBR9vULArFcMbTA66yewZ3dJmF1UZ0Ftml02s51yzvD/bDhnsmpWk+eeGDZnvknvtC4nB0DBqk0As+Q+A1530KrOlW/ENnHdoBHrUZJhq8QlVVLsOwrVdCc16svMUyVVv0aJvVuJxU6RP1d24fmcDr1h3u59WrMs2EzFHLn9gzXOiKNdRCZZCcdJuBhv1xOQEeLzlJlZxYVCxTM/2DVHe1w== Received: from DS7PR03CA0353.namprd03.prod.outlook.com (2603:10b6:8:55::13) by LV2PR12MB5775.namprd12.prod.outlook.com (2603:10b6:408:179::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 03:23:03 +0000 Received: from CY4PEPF0000E9D2.namprd03.prod.outlook.com (2603:10b6:8:55:cafe::f7) by DS7PR03CA0353.outlook.office365.com (2603:10b6:8:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27 via Frontend Transport; Fri, 8 Mar 2024 03:23:03 +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 CY4PEPF0000E9D2.mail.protection.outlook.com (10.167.241.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Fri, 8 Mar 2024 03:23:03 +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, 7 Mar 2024 19:22:53 -0800 Received: from nvidia.com (10.126.231.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, 7 Mar 2024 19:22:51 -0800 From: Bing Zhao To: , , CC: , , , , Subject: [PATCH] net/mlx5: fix the timing of releasing drop action Date: Fri, 8 Mar 2024 05:22:37 +0200 Message-ID: <20240308032237.315106-1-bingz@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: CY4PEPF0000E9D2:EE_|LV2PR12MB5775:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ce37af8-d02c-4e32-8e64-08dc3f1f109f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vrlPAEygijz20KT+W2vaU6pgy34O0itWRmP6q58iXUg672Jtk0XasHypB+JNOMWiTClm88BjxVQjq+u3NXf1DdHzqXJ1fdAd4qVZf23GqKn4PVUvpx1IO/H+SZOFg/w2IJhdwaFLb0yj5TkVk7U7x9kJMdZ+Fc564feZB9snEtAW2dvntmDgUQalDPngbhECelNn1fcBp8LYvbR9VNdqi8O9zAPMCF84vHSeohyiBifPDMiUFiC7YcNZhdjwy/En5OLUflRog+F0BsjBUphQ5MNkpH2mYg8sS0vTO11wDzEuEqYsYbTvdtXs1VGezUp+Zw1JplkqikmXcmwL4A35a0ddOw9oG5pKSzwV8EBRdF1ptEdeSWCUjdNAD4PaEQdem7mTm3VoCybmrSBhHssXEjmUV21JAmFaPkk2h6h1pPqjeXDpkfNDFeza1le+EVHj/b4oMSaLXvoil0K6Bd0JNZTrK7NpF6R8F/pQWnHTDlxaEhmbHg73Q7m0vvodB3DYWj12H26bOn0fbTbRxb44O81Tj0UHnbprktzIIqNkwonIzhPO5ctvkSikXc5pyzjavkslp4yyX6IYbljL0/0xTDRWqvMbUfdhb4+0N1163hXHuyAMO4aAW7ch+5/frsmepXxJs+4NaXitFEcs6a9CmQ8ARRkTnpzTIsb6OO93n+sr6sDZeEVBX5/SERMF5TF4ArZwvS1q2dKIVFSTDTUgVaq/rn9TEIkcjV4kboM1gcK1Pm7KAvewUqHO3tU0xhwN 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)(376005)(1800799015)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 03:23:03.4102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ce37af8-d02c-4e32-8e64-08dc3f1f109f 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: CY4PEPF0000E9D2.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5775 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 When creating the drop action Devx object, the global counter set is also used as in the regular or hairpin queue creation. The drop action should be destroyed before the global counter set release procedure. Or else, the counter set object is still referenced and cannot be released successfully. This would cause the counter set resources to be exhausted after starting and stopping the ports repeatedly. Fixes: 65b3cd0dc39b ("net/mlx5: create global drop action") Cc: suanmingm@nvidia.com Cc: stable@dpdk.org Signed-off-by: Bing Zhao Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 39dc1830d1..984eeb3709 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -2381,12 +2381,12 @@ mlx5_dev_close(struct rte_eth_dev *dev) priv->txqs = NULL; } mlx5_proc_priv_uninit(dev); + if (priv->drop_queue.hrxq) + mlx5_drop_action_destroy(dev); if (priv->q_counters) { mlx5_devx_cmd_destroy(priv->q_counters); priv->q_counters = NULL; } - if (priv->drop_queue.hrxq) - mlx5_drop_action_destroy(dev); if (priv->mreg_cp_tbl) mlx5_hlist_destroy(priv->mreg_cp_tbl); mlx5_mprq_free_mp(dev); -- 2.34.1