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 DEFA1A0C50; Mon, 12 Jul 2021 09:07:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B04141173; Mon, 12 Jul 2021 09:07:19 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2041.outbound.protection.outlook.com [40.107.100.41]) by mails.dpdk.org (Postfix) with ESMTP id 7CC374116D; Mon, 12 Jul 2021 09:07:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i33UQMluD27ZS1fR45MR3Bl+0c30r2kn2iMT0vwNcRdCdpnCvmV4Xy6DFTd0dZVEiVjaaHHnx/MQK3hQNESHKMGw5ZzrnJV34skN2lu0CTuuxD7GuM1edIhC4kpPl3JiEX9JmuIxn8SVqNI7YJpXSCb0QbhN7NRHl/NGIklGviWXttXxLaqLFItcJ/BmTZaJR3KDmhl/SV5FXxehijEtCDlbR8amGaLfpwMSuENnZKSBUHNk/bWw++ANaAaHb14zYRuwHAp+YQxHpEDu5NnBnLkVNJDFCmU/AcgwTdi9OTsnAOpJEbmIvkgg9dMAJeCymVcw7qF/vaCt8GiAWSwgZA== 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=bBdSswSuHCRHS3+SJSdW/bmMmhMzJ8+YtaWqy/dk9bmE5Ge3DLlyaVRfwulC+Sqv+jL0zh0ioyL7iycKE4dXWejj5Dr4ODWm1hQAuXF3XG0OsBHAeS1g5kjb6LpBWpkjNg09xB2V3xJ9CNQLLiMY5uS8VFIBDWm94G1nT46t1B8N21ahEZ2QqwnNSLUqTkeKfaJnc6+BQa7Y5jH6nGvGd3CKvAdZNwZJsPpjsRmXx4NCiSN+6Hf5CniwQsFyh1ZYm1qW+6wMWcMHsfWPuotruxaC5fFR9EbbX1Eo6upkJ3DqNXhQ0Mnxce4cv11kZrNr/Or1aAIVDB5cf3v59dE96Q== 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=XLNWwf25k/jZbfwPqx6XUOtfS7+WrVYqJyaticFVN755ZeFeXu11hA+xyfgDf8JoBRusZs5z90JV1wlJu2znO5W5v7UbPtrokhbKQoWqafsEdRdm1pc90QijveI01Vhp5bdQIp+I4fpFiM9LrLXqh878gdyws+JyQ5Xne359cgp5HFz2R2lo7h7HrhAZxunqgShPr++R2CfUl+etLQdhDB/pXcgi9iAS9s8sSAiUSimy17eraYErkmrT/0gAXNn/8JhswhNnVdzIdxJ5u5YhBzZCB3EqU6FurMn/4yai6rC4mi7gxqxC/RozZ1az3sg9GPoQtITSIYtHv9MVgq1vyw== Received: from CO2PR04CA0146.namprd04.prod.outlook.com (2603:10b6:104::24) by CH2PR12MB3941.namprd12.prod.outlook.com (2603:10b6:610:28::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Mon, 12 Jul 2021 07:07:15 +0000 Received: from CO1NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:104:0:cafe::c3) by CO2PR04CA0146.outlook.office365.com (2603:10b6:104::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Mon, 12 Jul 2021 07:07: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 CO1NAM11FT017.mail.protection.outlook.com (10.13.175.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Mon, 12 Jul 2021 07:07:14 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Jul 2021 07:07:12 +0000 From: Michael Baum To: CC: Matan Azrad , Thomas Monjalon , "Ori Kam" , Date: Mon, 12 Jul 2021 10:06:43 +0300 Message-ID: <20210712070644.2848418-3-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712070644.2848418-1-michaelba@nvidia.com> References: <20210707120303.2490006-2-michaelba@nvidia.com> <20210712070644.2848418-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] 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: 513d116d-1ae3-4329-bd4d-08d94503ad94 X-MS-TrafficTypeDiagnostic: CH2PR12MB3941: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: s7nNZfaGp/2ZzF9YTxclE2EIWVVk6QsfG3e4iHt+LzuH81hg5B/JWHKsqpACcP1rHteu89K34LhMiWCwnradQAPsTVTwsUXiHD/eHDNNeSdaTmnYR+Mgs76BzgBMZuAW6xkd1zHxYUtgU01de3ov9XFEqsocXDLVIXkp+FYUf3twdTHuKzGcgydqnvi9lIgBx3aZddzVFEboFPU6+U89AvfZpCRkg0eQACqojYD+W8JzNCfWpTYVXolyAm6jqCJ2J8KpZN2uVPqwp4mPXQciiQI65H4RGrUxrBQmk7/kTHQMwNbVOrr77wrCNU1FttzM+5mxIbU1xP4wUXEa/b5yRikgkn9jYdaq5jcYWr/YgKqB3MW43+oSMisxtzFZYQswMjfsffpL0XT9T9lFFsd6LWfU7qKK0+OLhP2Pw0X7NYtZw18gGEV3mMhnrQpYFzibtUGa1n1pmAN250CfnCVbqW4Mpb3bP2UcrB4+a9l2jUvOsjr8RrPnIHzxDKs0J2yaZaHnAyVEGx5+oKkyes2pO+4xc/D6tNj7EX0UyG6Cfj3xrApIHWrBWoa9Y3xYaNtciL/TFJEH9EyH6K0rZwSbAg9K9q9YjTUZJIZI3JAwwJejZbnZOg2gn8OpfJ+WqXHgLsMnZzq0Lfvct+h6Ijb05xxY6lXTS7kSut//e67FR2xd90GFvR0+v341385i0QK3qnAgvFwKCNCXs7Aq+Zgbpcwq0OBlyvVBmjYDk9OTxnI= 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)(376002)(396003)(346002)(39860400002)(36840700001)(46966006)(34020700004)(82740400003)(356005)(7636003)(36906005)(478600001)(316002)(36756003)(5660300002)(36860700001)(47076005)(82310400003)(4744005)(6286002)(70586007)(86362001)(55016002)(4326008)(70206006)(16526019)(1076003)(8936002)(26005)(6666004)(54906003)(6916009)(7696005)(426003)(2616005)(186003)(8676002)(336012)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2021 07:07:14.8051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 513d116d-1ae3-4329-bd4d-08d94503ad94 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: CO1NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3941 Subject: [dpdk-dev] [PATCH_v4 2/3] regex/mlx5: fix leak in PCI remove function 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 Sender: "dev" 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