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 BE219A0C4B for ; Wed, 7 Jul 2021 14:03:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A3C741504; Wed, 7 Jul 2021 14:03:42 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) by mails.dpdk.org (Postfix) with ESMTP id 297BF414F7; Wed, 7 Jul 2021 14:03:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U8iY4Y7SNkDi+Q3Ujb77o0V2+525/z+jbECVJUUJd+WT09uwHaEyXO+gWtgfn/yz69W7hRL4PDNKqAyNurAaLjTP1oE4yyGCyo9Og/czx+lquKTRHSGXV0q+oKA7QpX1GGT3oVOJA0uuIBAFvzcLApI0TahqoAI2vJnmoiP3mf9Eio4mdJgHdV4khuHFR1ncLCG5qBxlFGMYbSK24VXC53wj3quqqnFqlR+EoMTLk0fWHJvczX2qqz+8gp2BhAnxPWMKQu2wLT3HTkPgKcrl8/Mrxh7tAXFK2CZ4BYR8GF1enFLcd2EwH1WnehdL957Vc07nJjK8NI3R/ydVB8OB2Q== 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=LLUSEvwx5TQUi3U4EnpybAhdBHsDgKHtKBpJZYha3inWxrDCc0qsMkWAOU9xjguzXA62RII60WNS2fE5bZEiAt0SIZKpxTk4Pp3je2kbkMMlw2MJxhIB0ODNJorNbGDx/Mo61FqMCJhxRuoVcldiAR9V+N2QM9uvGo8xcSqWl8ZexTzPqqSCYvjtzayVKWjnNLEaUmbos+hMD8M3PfoHtZgcxKv3Hy+sJoU6g5UYQX/0ljtJxdv6QLm/U4zat1LdrdXngJA3O7xQx2GTMXKPUgIqPyMvZwvXqsywgd/+I4gpAeM3HIZN7ALbvLPecWKy0jGzTQ7j6JGbQbqFKm7AbA== 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=H5WX4DW/BHTQp65/rxbI9cP6ZUmSsADZ552l5KKZPCREHZkyh5lMnSYsPtU0KajttcIAVm0PbquRjiCTBBf8/7P0c+MwgI03bLjnncMN2fZxfhrB9wtfUd8pWiUDUs+NaAESI2IjG6+zQvVwxf4c8VZbZ8/9PEQ0lcPpFBi6N4ig0knTYEvl/GeYLyUCYE+Awm04a+OqqnQc+yFu50hKxJZvg3kyipXM387FIFnIS6eHDHvmA1kygXqldPK3HpDPbQVu1vKB92L0S0OqqrJvx1mTJRKCtUW4npp5S2hTqp/GjClXzv0t2yKVDmWIzw7nSK7G5RULhMZcUfWAtQjLGQ== Received: from BN8PR03CA0013.namprd03.prod.outlook.com (2603:10b6:408:94::26) by CH2PR12MB5530.namprd12.prod.outlook.com (2603:10b6:610:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.23; Wed, 7 Jul 2021 12:03:38 +0000 Received: from BN8NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:408:94:cafe::c4) by BN8PR03CA0013.outlook.office365.com (2603:10b6:408:94::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Wed, 7 Jul 2021 12:03:38 +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 BN8NAM11FT068.mail.protection.outlook.com (10.13.177.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Wed, 7 Jul 2021 12:03:38 +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; Wed, 7 Jul 2021 12:03:36 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Date: Wed, 7 Jul 2021 15:03:02 +0300 Message-ID: <20210707120303.2490006-3-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210707120303.2490006-1-michaelba@nvidia.com> References: <20210705052730.2283962-1-michaelba@nvidia.com> <20210707120303.2490006-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: fde85a8a-804c-4802-9dd9-08d9413f418b X-MS-TrafficTypeDiagnostic: CH2PR12MB5530: 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: kGPWbk9yvtjnUgFk1fsZJ/NlJ8vso9IbDX8gXo9n/xqsWzA5DGEUoGEw0VLN2fCPYB/g1Pv0HMXaSIeaHdlGnF7xKQs7J7TC3J17uLZoU0fE/lDY1n+RQ3qlUshe4LjiMSf3ZihJJARl5d8B35ZtFqbeLB9D0W5n7M/nnj6/5Ws6xkCyPxyzqEUY9D0H16LYbgtuA2/nhyy7iHx7iH+Kw5yxGVvU5dCYQgVCRj5V8cwvUINd56loCoYnw5ToTGTA9bUI/zqiKx51vTzwCGnwpnp5kxklZWRzAJvfRqTWhJNd/1jc6XeYAZQ83riKAUc6UC6qDGINeJv/OCGbJXMUwVo9NA6KWU2Si2ZmbVL4IHjq13wPfp3aabYKxKC4B7/+7IuCPFsGi3ZupKbA+/KlauVf3WwKFcbai6f2PpE5iW8D56FQ/A5ajePSFxYRqKgoQqB0yhKL9UVoQ5mDc6j7p6nJiFf4ne+WWRxvi3bacFiv/SKQI3RkOojxAzWoQi9kzja5bRgyZGBG0qDyPBNKhHkuRATFRYTEfd8QoyEXRRVqxWo21NDuKj4ac0bKzSJ+fJDGRTP7JpHCJRGbjpO0YRNyXM+IzIWDFD32/hTbGqY44tYXt8NSOLgxvzReZhzUKZhxAfnuh8h1zvx7GSCkYYGgpNdUoaEsQBXN/X8VbnBkPtKN14yH6pl8gau9/8rRgoUVufLWW7YXMMDxkoG18Q== 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)(376002)(346002)(39860400002)(46966006)(36840700001)(6286002)(36860700001)(6666004)(316002)(7636003)(4744005)(1076003)(55016002)(356005)(4326008)(54906003)(86362001)(5660300002)(450100002)(36756003)(26005)(426003)(7696005)(47076005)(2906002)(6916009)(82310400003)(186003)(16526019)(8936002)(478600001)(70586007)(8676002)(70206006)(36906005)(336012)(82740400003)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2021 12:03:38.6100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fde85a8a-804c-4802-9dd9-08d9413f418b 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: BN8NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5530 Subject: [dpdk-stable] [PATCH_v3 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