From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 3910243B86
	for <public@inbox.dpdk.org>; Tue,  5 Mar 2024 10:55:17 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 333D34026B;
	Tue,  5 Mar 2024 10:55:17 +0100 (CET)
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on2084.outbound.protection.outlook.com [40.107.244.84])
 by mails.dpdk.org (Postfix) with ESMTP id 602814026B
 for <stable@dpdk.org>; Tue,  5 Mar 2024 10:55:15 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ViSz7MqnwJleGRsIpDQvUzIkvPHCMtH5HiFwU73ZJMmUy5hcQo0dRYZiF4sWPZYIRCT9FJQKCr60zKe5VqCcsBUNxJmCdJcc04ysT2Yl+BGAqoxYfAUOCzoK4DslPR2tdOHpcWtcoryXPvZrdywKpwIcpK4aOG34pjgW16UUpgXyQHDiiUBYOBTQ12Na53yicOKdzNp8t4erK6XZBxuLv5cMhG8skJJmedumC+caHRKd4dPEL8Sxcmt+S77nDR6j/yriZRzpleOlOE3s4Drid6eapT7cNjVWjnFe+QVgDYxDCfUeg8ZdNhhAIaimFzgv8iqvQAGb34P6q3mcB3SFlg==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=htGvbn/56rsngV1TX2yVJsSBwDM2yvTYPLEJeXZJwKk=;
 b=jpdB+KsCOctgsI8uCIdGQn0k2E52Rv1i6AdAuqmYCak6hPz3GjUvzL1yD6fVSQbZSBAE3TgngVEYFTmQi1XKb0lJp9BNg2FxlkLqqFuc/jknwg3h3U1KAOSwYGcHAT0BnE9qObGwSNh1LUBuWIIIz99OC0sg2vxQSk7nqVJx4I2+q+4HshvbZ5M8AvIg9BmN7rGk7sTqigEihF/vEQqVGOIE1yHeiHyZw+ePfRWwrnuLZBvORzMGrbP4E4PmolT1GkeGY26aQxhEydfGNA9OOT7Wls2m/iGJRnvIGdwiYmxOfzH3vEOV918pL5Eu2lc1yLMzYAduC3y1gITagxP2Jg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 216.228.117.161) smtp.rcpttodomain=corigine.com smtp.mailfrom=nvidia.com;
 dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;
 dkim=none (message not signed); arc=none (0)
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=htGvbn/56rsngV1TX2yVJsSBwDM2yvTYPLEJeXZJwKk=;
 b=IyqepbFD5JqINXluSXp8iKKw9wCsZOHdH0aPwkvXQOjjdWCjJbRMDjcGAZPtAeatrHTL2GLAuCxhNWjdRCBMgUd/6TOVRoPJBvnzq2P/MscoNnJYOXMLrzdng/l3pxu+SrY3CMAvtr4vms2r1tunqoKo0VNZgzGpnlRfl7BdbQtJHj9ob8Asr8vF1l6he6Csp9sfVnRr7NMTb7PKC02vROXaP63o/0tTcZDgEe1tez7zzr3dgJ3F06aKLa2jc4w4I1rD1siwemtRr0PP5GZmwlCVAwfSx6Tcfr2NQ842KvW/6m/2Bikjis31yA1MNx05HU5iFI4OkuMKwlXn64yWQA==
Received: from SJ0PR03CA0379.namprd03.prod.outlook.com (2603:10b6:a03:3a1::24)
 by CY8PR12MB7362.namprd12.prod.outlook.com (2603:10b6:930:52::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.37; Tue, 5 Mar
 2024 09:55:12 +0000
Received: from SJ5PEPF000001D7.namprd05.prod.outlook.com
 (2603:10b6:a03:3a1:cafe::3b) by SJ0PR03CA0379.outlook.office365.com
 (2603:10b6:a03:3a1::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend
 Transport; Tue, 5 Mar 2024 09:55:12 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161)
 smtp.mailfrom=nvidia.com;
 dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=nvidia.com;
Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates
 216.228.117.161 as permitted sender) receiver=protection.outlook.com;
 client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C
Received: from mail.nvidia.com (216.228.117.161) by
 SJ5PEPF000001D7.mail.protection.outlook.com (10.167.242.59) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:55:12 +0000
Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com
 (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 5 Mar 2024
 01:55:01 -0800
Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com
 (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 5 Mar
 2024 01:54:59 -0800
From: Xueming Li <xuemingl@nvidia.com>
To: Chaoyong He <chaoyong.he@corigine.com>
CC: Long Wu <long.wu@corigine.com>, Peng Zhang <peng.zhang@corigine.com>,
 "dpdk stable" <stable@dpdk.org>
Subject: patch 'net/nfp: fix resource leak for VF' has been queued to stable
 release 23.11.1
Date: Tue, 5 Mar 2024 17:47:00 +0800
Message-ID: <20240305094757.439387-80-xuemingl@nvidia.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com>
References: <20240305094757.439387-1-xuemingl@nvidia.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.126.231.35]
X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To
 rnnvmail201.nvidia.com (10.129.68.8)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D7:EE_|CY8PR12MB7362:EE_
X-MS-Office365-Filtering-Correlation-Id: fcbcd0cc-fbc3-4ce0-3d76-08dc3cfa59a8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: EfXmGJ/AcTPnV1MAlmEpKkKHpX1zjyEz1WKVTZ8oEXOdDV7PxpR2vtyYuuAntCXaVoFCXqzyNIYeqtCd5+n1mVQfFAbF7BqLZWYfWf56wERxQEdAvqUGRrkm3IM24Lannc/2KIgjXzOVBFZzJztUo1dBJDNblEH9PM74sklFF83JaSRTkfXvP5bkje4s/e3REfOU+Ws9tgT2IeusZBPHXDFEAme5zAmQy/N220C2/i5DauU3bhhxlLFoAfpHkyCcGaFJ6Wlgur86VmsNWY1svKc2U+J717Z13IgRyt1ErHFw7XXl5A3eG1WLKx+cBcKkBu/4OuEDJiBgAm9Dc3RzsHe/PCECTa14Dx2ogRFd6TuUkjuYm1MHzJ5cZ4DraJViosBDKPucpJeM5EQdXZqCLyoBq2ORWy49/2coiK+E20/jJ9dOOIuZ2nKkG5n9WlKaJtDn5JxCo/qpqPqGfFP/Lq53zEWM3bsFndREUepp6EvplTYGbrfRo424uf9OroXkn+0Zt7odyGA/594xea5683f0+Z2JG1Pig6ls9ME4LU1zyVbV8/faCNwOKfdIv8xpR9SXCSUMGl8gTVKMrDnt/w8M3PxKnmUFX8IrZaHXINy8cbLLbk8H+1+oU/C+4W3Y+tu3NiBuH5clpSgC7EmBnYKsUQM+IuKBvqHDPJwBj548rtBdOU9yDa83t+NczFw13S4B6v1d2WoOq5UaVkSaBXrS4Gig2CaGV5KVVG8Sz6HDQweI3cXGY9Fs+jgC1V08
X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE;
 SFS:(13230031)(82310400014)(376005)(36860700004); DIR:OUT; SFP:1101; 
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:55:12.3143 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: fcbcd0cc-fbc3-4ce0-3d76-08dc3cfa59a8
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161];
 Helo=[mail.nvidia.com]
X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001D7.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7362
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c2a5c0d0855ae555373d84f9a350844c1eae8845

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
>From c2a5c0d0855ae555373d84f9a350844c1eae8845 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:18 +0800
Subject: [PATCH] net/nfp: fix resource leak for VF
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 ]

Fix the resource leak problem in the logic of VF.

Fixes: f26e82397f6d ("net/nfp: implement xstats")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev_vf.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 7927f53403..88da593190 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -160,13 +160,17 @@ nfp_netvf_set_link_down(struct rte_eth_dev *dev __rte_unused)
 static int
 nfp_netvf_close(struct rte_eth_dev *dev)
 {
+	struct nfp_net_hw *net_hw;
 	struct rte_pci_device *pci_dev;

 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;

+	net_hw = dev->data->dev_private;
 	pci_dev = RTE_ETH_DEV_TO_PCI(dev);

+	rte_free(net_hw->eth_xstats_base);
+
 	/*
 	 * We assume that the DPDK application is stopping all the
 	 * threads/queues before calling the device close function.
@@ -323,7 +327,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 	if (eth_dev->data->mac_addrs == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to space for MAC address");
 		err = -ENOMEM;
-		goto dev_err_ctrl_map;
+		goto free_xstats;
 	}

 	nfp_read_mac(hw);
@@ -360,8 +364,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)

 	return 0;

-dev_err_ctrl_map:
-		nfp_cpp_area_free(net_hw->ctrl_area);
+free_xstats:
+	rte_free(net_hw->eth_xstats_base);

 	return err;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.390713080 +0800
+++ 0079-net-nfp-fix-resource-leak-for-VF.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 Mon Sep 17 00:00:00 2001
+From c2a5c0d0855ae555373d84f9a350844c1eae8845 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org