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 4011AA0C58; Tue, 31 Aug 2021 22:38:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C703410FB; Tue, 31 Aug 2021 22:38:04 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2042.outbound.protection.outlook.com [40.107.100.42]) by mails.dpdk.org (Postfix) with ESMTP id 1BDE84013F; Tue, 31 Aug 2021 22:38:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jUV0+Q+BLNQRU4wZoi9kq1CPBdHjPupp57oext0/XRruar7RDPp/D59zlkOZear7RSlx7Myl8TrL/z69lHXIliNcnYE3dl1puDv0uRISoKjetfwHwhlbLayQ1q6HGZwL0znLYPialaGgB1TN+mBrLV8L2TxH49ynrEdcYyw1CPS+BeO17zl7+T0wkyZPGmhkSSPRl/eI1MxY1vOqiRttR9/+AZ9DZUByUAztfGbIugjLWUptfnzatAsl28Uaigmf1/21HZvXqJswJ3cd/G0F9JCvGeac/zXZMrB093xZK6wyJyRSIm7331AIRleOlolHvkVNgaCjRwDbzzUy4GEWeg== 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=pfLTsK5uCZRrH8j2khvKuoTENJ3Q/Kdn0uMdAcwH9yI=; b=LiXW/Y1BwslYsdZ2VheR8M51+9bn3vZlnC/Q0hQLr9LRF3UqRPA2coq551oSaNXRmt2VPMGSnFabRJ6SnhXuWmzwin214ApmheI77uW2+ASecXTHC4qLM3cupniTr7zzmE+8ZwGwUlBmUP06m+whuLNS0RloUSHfW52k7Hh17McDNCMWFvR9S0cJcHJ3s5VGR9uEbdQkh8KQ4fkFHoiJ+TjVvog7WmHh1bhLYYC/dFDhhBPedMZoLqpx3mOkpRBaahi1lv32vP1RLmtYtIQCFNwWF3kZYUEcP+WQ2Q4ZNVzXEDSu8KS/kZcwc1QM6EyMJXownSKrxdhCvhbZbxEJ6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine 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=pfLTsK5uCZRrH8j2khvKuoTENJ3Q/Kdn0uMdAcwH9yI=; b=Sh9rJOm0stUsRzZhFtykFv/Ucle39RZvbRnDB8rJuoKCeVtXk2Y6UnGD7rLW2eox0AlfEodxapjPebfVgxbghHxJHy3ILBEUjEgCc1k8UwEqt5/vQ+f6q79GS7MwCAdQsUK+bp4462sf+/CotxMYDjcIMfHwltG+q5QaAQPbQA5B43r0eBIoALqoKo5Cns5rqRB7G/UrepJgz0IO4RJ3hDcBM9qUvMxowxKDBeZi0D63eENt3MFaaYZsMrlOd4CXF+SM0SWYr4nUqq1GqAD6zNaXAK53tTBV7XZoNAF+Lmolk5HGXhVBcf1Y8SKdv+2Z2myghOoYGe09dfkt+8py5Q== Received: from BN8PR12CA0025.namprd12.prod.outlook.com (2603:10b6:408:60::38) by BL1PR12MB5301.namprd12.prod.outlook.com (2603:10b6:208:31f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 31 Aug 2021 20:37:59 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:408:60:cafe::74) by BN8PR12CA0025.outlook.office365.com (2603:10b6:408:60::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17 via Frontend Transport; Tue, 31 Aug 2021 20:37:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) 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.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4478.19 via Frontend Transport; Tue, 31 Aug 2021 20:37:59 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 31 Aug 2021 20:37:58 +0000 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 31 Aug 2021 20:37:56 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Date: Tue, 31 Aug 2021 23:37:27 +0300 Message-ID: <20210831203732.3411134-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210831203732.3411134-1-michaelba@nvidia.com> References: <20210831203732.3411134-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: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2fd9451-66d1-4df7-ad07-08d96cbf387b X-MS-TrafficTypeDiagnostic: BL1PR12MB5301: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:127; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q8PwK0xROaiRYsWWT1TKCKu7MgR62AsGqMAnS9lza0e/P9wr2ttUgQrDZ9kC5EIl26d/VmCIFRiZR5oiaI0UIEBGWcWaqFUwz80DfkkFL66CUYMYzuuP/j8Pk2Id+kD47WWbZoUZ7+fouo6KmUei6EbXuR4NALsgdKVwHm8VDavSZlhoa8715qEydUmnE0VJsfAiqoB0gocaxcg9eWzdWmP/q6QK2oYG8p2M3HdVb9Sl6dViO6mUW+MElGtigqUFdsiRCzTDeOrTstq3RdJAInufO5r8M7iLQG5+OnQTjN+KIx1P5MO3qojw02a2zhK8P8grxQa7HMxSMq4kTVyfi6gPKO/bfUSQ6KH9Jz3OJoS771T2PKrgAFWV3kIqugk943pOcjkg9ctW6WBD9NKc16C0515cGpKGLr0WBFITa/PuIoIMRpcnUd1QuVeYCvzjHLYqLmxPJxKpk6xc/KkHPyNMqWMjriUEkFQDefjuL/AmLvUK3UpopR4lU2KfrUeslLh0p2f/j4bAR6eN/D1nzVn8yl4FRyJYuCdj4b7iMFD2yUAeBGjq4ek9yQqhR+b3WYwZkl7BMTRMqZbTxpKuk5Jrowo9dBNZGdRd14vZaW5ip4NgOLnKzrEbW4AUByQVzUDBrevQxNT6h4tWcaKdWsqEJEOKyXRVTUm7bFUpdocHm7kBww7elUGBo2ODX/Oc1EKWNCf2pXEGMlx2ZMWd+Q== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid02.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(136003)(376002)(346002)(396003)(36840700001)(46966006)(426003)(478600001)(186003)(55016002)(6286002)(26005)(54906003)(8676002)(82310400003)(6666004)(4326008)(316002)(450100002)(82740400003)(36860700001)(86362001)(36906005)(8936002)(16526019)(70206006)(6916009)(356005)(4744005)(47076005)(70586007)(2616005)(7636003)(7696005)(336012)(1076003)(2906002)(5660300002)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 20:37:59.0269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2fd9451-66d1-4df7-ad07-08d96cbf387b 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.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5301 Subject: [dpdk-dev] [PATCH 1/6] net/mlx5: fix shared device context creation error flow 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 shared device context creation, there are two validations after MR btree memory allocation. When one of them fails, the MR btree memory was not freed what caused a memory leak. Free it. Fixes: 632f0f19056f ("net/mlx5: manage shared counters in three-level table") Cc: stable@dpdk.org Signed-off-by: Michael Baum --- drivers/net/mlx5/mlx5.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index f84e061fe7..f0ec2d1279 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1254,6 +1254,8 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn, MLX5_ASSERT(sh); if (sh->cnt_id_tbl) mlx5_l3t_destroy(sh->cnt_id_tbl); + if (sh->share_cache.cache.table) + mlx5_mr_btree_free(&sh->share_cache.cache); if (sh->tis) claim_zero(mlx5_devx_cmd_destroy(sh->tis)); if (sh->td) -- 2.25.1