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 D9ECCA0A0F; Mon, 5 Jul 2021 07:28:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 649364114E; Mon, 5 Jul 2021 07:28:02 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2087.outbound.protection.outlook.com [40.107.223.87]) by mails.dpdk.org (Postfix) with ESMTP id 7ED8540141; Mon, 5 Jul 2021 07:28:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ar8/Pkm/+NImDbBvU2o0fse46JFHj+aXURBZXT9yyIHZq5ODuj9BvAuXpLzoenu5IsWhIPlL5CCgcTF00QFpv1dYATix7aI/iT/sYAeJvPvjqsaA6KpDhJO2dgePp/Bb1Mb3hu3GOXpDhj/tTNgAMjpdMkKLUn/yufJWyr6OvQTe/rhHWWZerWpccJtAeL1buWFq5bbh8Ab5C7syUoQ26HTEwuc3oYfFoumrSKsXXd18Gwslzf8Bl34ahnyd6a3ICX4rX3Ke9rZAtV2BNLIsPpndJvgG54vrFnLdYNekOpsuK1SvwFTJkt0iUwn/15niza0AGEBMQNIj3A08PDeeIg== 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=d+K5eLDAMV7CCEXMEvs8by14GvoNTIz/VELVs5/hZBIesICgImXu56F5Iudt/Niy+V4ssQnYThHGKZgEGggXm4eZrnZuwYNz6cZ6qeC/dl30usLfYTzvrVhKz63VWggpWikbI62FMMMN7DlW5HE+r+W4gwQPj5Az3dNOSDhHOHPteI8Y7GF58l4C0w+v9LOMhuXuDPVqkw+fJ5nQt4nLEblUnmH2QWgdkZ8wkEpl58SJRL/RQZ4dJITrzU/OkBtAc8Js84WuNGqEDLUjJyoG8B07IgdQq4UlrkiSYSF9FhoESjw8Lz+pcNU6QDXa0Zgfw0/1jICKT4GQsPUYb7i4QA== 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=nrSP0rMMoVSrieO06NgvQ+yxEOLgPkW8Pk+S3Hecml6QmtFfQdNl40/IBiojgk/XhaWM9ubaPCHxHFYsLSXIXtSASlIAGwU8gidzrT0tZ8/ttbJ7szQyVmTwcu7KQ4vnX5O5j8ZfdaZhuJwc8AVd47H1nOS1tR5+Jehm5vqA7VVYLX9ujlRJ3kaZk5ZDhLmNNZnXqPbBGgupoNjUAmv0U270WY9ow01de3KBAdAn3AoRb7HRwVFNOQ8w8oJSRTL/gDqfx3PxkNH+TMxEcWCPQ9eLFN0JHssC7FfDdakpx4E6NheNzMvgg10mZZPyFm9bJDYCv21Szm+ImOvyUtBiPQ== Received: from CO2PR04CA0191.namprd04.prod.outlook.com (2603:10b6:104:5::21) by MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22; Mon, 5 Jul 2021 05:27:58 +0000 Received: from CO1NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:104:5:cafe::17) by CO2PR04CA0191.outlook.office365.com (2603:10b6:104:5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Mon, 5 Jul 2021 05:27:58 +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 CO1NAM11FT005.mail.protection.outlook.com (10.13.174.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4287.22 via Frontend Transport; Mon, 5 Jul 2021 05:27:58 +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, 5 Jul 2021 05:27:56 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Date: Mon, 5 Jul 2021 08:27:29 +0300 Message-ID: <20210705052730.2283962-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210705052730.2283962-1-michaelba@nvidia.com> References: <20210628192347.1825713-1-michaelba@nvidia.com> <20210705052730.2283962-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: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af2cd1cd-21ea-495d-bd33-08d93f75a65e X-MS-TrafficTypeDiagnostic: MN2PR12MB4192: 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: K3qBaYwO/3eTox9vZIEs02hThk8TfGEC+YKeVHARLj6GcO3zILdBu0Z88fQwFumZeBkPdBKuwVz+AXoTM5/5zC2iTXJ9rIq47I8Xzt8XMPzceG4ipNbgw8TmCQxYuza8kJ4RAk7ZXmSYCGDmWf/RwvFcLzQ7Y6WAE7XDrzo/6A774DAIbfCONwOoJSqI3rwlrsFjWjJ56CN619/lMyJxQqK6655OjH8BKGZgTr6eLqbe9uGs4Q5OtLLqDEOKMGwPvyUBnJxM7aKax7AJSlG8SJutLGfZ3Kx0FDeyFIQOVk/sxn3AxQbQqlxfSHAsbLDKG3Gt8vpy2e4b9DmDs/gnPJDbUL/ZSgJU5pqG6+YTzD1bWFVMOikY+9p5y0oRcxl5RzsrcJfXdit7j0fJ6jI3Tb/F+gs/On58kwNDcuI2wZq/FnIMwUtEGRcpUp8OVAUFS2Dp2era+Cl6tcXc6NAdfmxicJEBby0C9QGVzhMvZg02uH1ii3lGuPR/x5mFNb5I9ppwiZQa5uWKWZoImcURKDhb7qVQCBtkBzUkg1Yoa6uQ03GIBEb6jLk5hYGexotNBQd+YmoAjeahflPczO9+QOhiChFsMgHphmcXhEwN3ifObx4tCB7Dx4ikE0QG5A5SxzJoTRVeIWMh1B93nbRuh9niz8vG8ENTqIF1z8Xfi/BkjixaxHX7ZZNac7OsC2e6WEcVbJroGU01/SY2pHq37A== 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)(396003)(376002)(136003)(346002)(39860400002)(46966006)(36840700001)(1076003)(86362001)(4744005)(2906002)(47076005)(36756003)(36860700001)(82740400003)(82310400003)(7636003)(2616005)(426003)(6286002)(7696005)(5660300002)(16526019)(336012)(4326008)(54906003)(36906005)(316002)(356005)(478600001)(450100002)(6666004)(6916009)(70586007)(8676002)(26005)(186003)(8936002)(55016002)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2021 05:27:58.3216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af2cd1cd-21ea-495d-bd33-08d93f75a65e 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: CO1NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4192 Subject: [dpdk-dev] [PATCH_v2 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