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 BEBB0A0A0C for ; Mon, 28 Jun 2021 21:24:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AAAFD41150; Mon, 28 Jun 2021 21:24:18 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2088.outbound.protection.outlook.com [40.107.244.88]) by mails.dpdk.org (Postfix) with ESMTP id 2123F41155; Mon, 28 Jun 2021 21:24:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iXldIspXkSgVQCxTtC3gn5B/Z+d2SG/Rin9HpjK37IC5k8y4jB5D8LChu8+Smx0bR/Ei8yx9nyJ2Hw5l3yg3aE9xqC3cRuqvIuCUEeSFmPuPyA5jlg2DvwVuFBbTqT3AkiyG8nplDGvnk6d8XCP1UzbmeUTsYbUkU0WlzKHh6admTVR1aRCKuYUKq3W/sIQ5WWfmeSMFmiINoLYqmJCXKysjegmbc+aMvWTzp9LlLsixU5FvEFvuYXsD88fEKbx6Lwfc7Z/1qa2HvbiOy26BN4aC7Ycp6b36Mi+nZqnGneFRChJT9ySA/u++DKUhShgPvcZkSr/l88ApePxv1nLlAQ== 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-SenderADCheck; bh=YaGWfYbwgXWioYwomJdPeptflQ8mLCXOwQmXRzQWB8M=; b=iQ63M6e1BVhMtvhhPkRr3K27WoeHETD//mqa9i8gJHg+h8rpUgOGvKBwj3+SqaFDMWRyIZlwXj3u2S4KnIxFY9kr0DX8l0W+7fwt1PFS0ERrETaDAaeiKSazxshsA/qRBc7AVYuPVfwrY2X7av4Nu6L8t/lWCCzzaqtNyTFocSal/it2j/lU+Yd1wig7ry9JiOArM42hFPQc1+QC0OZ8H5Iwyc9Nj2F8OqsEB5ZDC+wiFArSAYE5KGd41eyMAO7pKGiwXDwCGEcC3ahbEy10JNUDSt9KUHVXnNOxzZr8sbgIvG+lU6JOUqdcmvPNU/lJHrGY9hSdsksjXNY0BOADGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=YaGWfYbwgXWioYwomJdPeptflQ8mLCXOwQmXRzQWB8M=; b=rEV904E/v4kALsx4JUr7XXTlhu0zZwaTK9msNCcug3RWt/ms/kvgogjyUvKWuAW9GFzLSl9gmZYTybznpheCv7vDvgLozvtglTfCgP9ZGqB8bg36bS5aC+7sQreDuZbcRPhfhuwBvUEZIkmVfuljfTb6A0HZyd1JdUzTBB2CNkrBUAk0VsZtkm0feYSVCZ8SbTtLI6m4UY0DwW+HBm99brZewle0l9x0iAGH5cuJ8RljWOBoKsUcSRXzfh8EXIVppTKRmVoDG2JktMLYUlH81inqj9Ds9YFVNeMmKHpfSmIIUvyxBk5y+BKqgM8Q/QSfzgdu3C5BHnvmRwA/NKga/Q== Received: from DM6PR13CA0017.namprd13.prod.outlook.com (2603:10b6:5:bc::30) by CY4PR12MB1848.namprd12.prod.outlook.com (2603:10b6:903:11d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Mon, 28 Jun 2021 19:24:15 +0000 Received: from DM6NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:5:bc:cafe::c) by DM6PR13CA0017.outlook.office365.com (2603:10b6:5:bc::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.8 via Frontend Transport; Mon, 28 Jun 2021 19:24:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT016.mail.protection.outlook.com (10.13.173.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4264.18 via Frontend Transport; Mon, 28 Jun 2021 19:24:15 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Jun 2021 19:24:11 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Date: Mon, 28 Jun 2021 22:23:46 +0300 Message-ID: <20210628192347.1825713-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210628192347.1825713-1-michaelba@nvidia.com> References: <20210628192347.1825713-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f076ea2-3a85-448f-21a5-08d93a6a516c X-MS-TrafficTypeDiagnostic: CY4PR12MB1848: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aq9QXb6XBX3FuOOfuUr7wLAUyNtXBQwAgEEQiukwI0rFKNCkWrHgVUEIcmMTAici231Yw0uDN0CElnAZ3Lmf9huIS8p8n4RFydKRyE2O0ZsnWPrD4gT7pr/6cgBGyglRn0nMhcWL/64iddbRcaboWQDzaYiL6b7DwhRsrh64VnWPfCx5JVkfHDOhlE/Q9GsekteKeSTO5rgepvJz3WopN03YxR1YP58Tf72HCmobjOVRurfc9cQKWKp6MSlISKHcVZkZPcRSPFuJZQcfmvDgEBgsHB3iDKUbnyj10Fi7dQUXxBqswXxiQU+NTgVDfHTf61dp+NN5ENosfec3hefV9yl+aNVpA//2JtG3E7dIPdqz03cjUl2DETCzBbC6fZnWjyVOI78mz9zQ0+EhE5v/rMt2/g5P6dmYRD3LwjkU1DwZMefz4XUQM9Gs5oPr5/GC24Kp37hENZTpNUUXrJJ9e3TVP2o19fBvFTvLHzicleR4ykib5pK2Ntqi9IH5W8JV/4gwDwVICj0QfR/ool07hZkBMQfNABhPb8UPd+4hoKylGkixAubYM2vU6Bx3QiXSeYIJBUvpzFAhOC+bUxl40ufYh+UIdauSslEFdAcBABcVu70PObSAYxhrvQWNjT202sJj7Lmg/Cefrpxg7E759LqC2A0Xvn2D55Hqpl3Isy2XzzwLLaKIbB3n4+JdjiuNy/h7lJO9pJUJinBETqHd0w== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(396003)(39860400002)(376002)(346002)(46966006)(36840700001)(1076003)(5660300002)(6286002)(7696005)(86362001)(6666004)(186003)(6916009)(2906002)(16526019)(478600001)(8676002)(26005)(82310400003)(2616005)(4744005)(55016002)(8936002)(7636003)(54906003)(47076005)(82740400003)(36860700001)(316002)(4326008)(426003)(36906005)(36756003)(70206006)(336012)(70586007)(356005)(450100002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2021 19:24:15.5521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f076ea2-3a85-448f-21a5-08d93a6a516c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1848 Subject: [dpdk-stable] [PATCH 2/3] regex/mlx5: fix leak in PCI remove function 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 Sender: "stable" In the PCI removal function, PMD releases all driver resources allocated in the probe function. The MR btree memory is allocated in the probe function, but it is not freed in remove function what caused a memory leak. Release it. Fixes: cda883bbb655 ("regex/mlx5: add dynamic memory registration to datapath") Cc: stable@dpdk.org Signed-off-by: Michael Baum --- drivers/regex/mlx5/mlx5_regex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c index 0f12d94d7e..f64dc2824c 100644 --- a/drivers/regex/mlx5/mlx5_regex.c +++ b/drivers/regex/mlx5/mlx5_regex.c @@ -280,6 +280,8 @@ mlx5_regex_pci_remove(struct rte_pci_device *pci_dev) if (TAILQ_EMPTY(&mlx5_mem_event_list)) rte_mem_event_callback_unregister("MLX5_MEM_EVENT_CB", NULL); + if (priv->mr_scache.cache.table) + mlx5_mr_release_cache(&priv->mr_scache); if (priv->pd) mlx5_glue->dealloc_pd(priv->pd); if (priv->uar) -- 2.25.1