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 600EFA034F
	for <public@inbox.dpdk.org>; Wed, 10 Nov 2021 07:38:47 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 2513540142;
	Wed, 10 Nov 2021 07:38:47 +0100 (CET)
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2062.outbound.protection.outlook.com [40.107.237.62])
 by mails.dpdk.org (Postfix) with ESMTP id 31D12410F2
 for <stable@dpdk.org>; Wed, 10 Nov 2021 07:38:44 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=fjhMkstQq41UlqWFfdxy32mgsQtOoZ0NQfPM2Iyzl6Wu0Q1Bq1oW2po+TauPqNqICtCAWuGQBCztKnvEGnsflkvJVHh2/b3a0X0i8GSTlAowkDZkxM1eSDyLwmcrT+z0toqrFWeXpgtsr+iL2XUB9tt5jFRiAlQHPEBxRO2Rpdl1nzqHyNMbkYWlv/6SpeEGxtrpt2qSgwBxaVHzRNcjiTsA3V0pC4TOKK/nnPliFgrkjDI9RLxPYNlqAdhzC4cEbjlsI9caBkCYCsDtTTSxZG8HwO0lVaxggRLpG+icjdUsXmbpXM2A5dj3Ko/OaAzu3Gd6EvxHsLZB3VC57BixZA==
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=se069sIWWsysARQh1mWM0EMZrrw0bC4qB4exnXcL2JA=;
 b=Q2zIoR4YSEtVcKV93bYEpLHNA49DZsvH3BjSlxBxm8cqhtOVtrttKwndtjL9Ihss4vJ+Eb8nzsZHipz7xMOwWNbsNZ6tZ7AhsIDGuPnlzc4eYgYA76JkV99c+KBtdqKp4KRY23UltQZf3wTPREN3Mq76LubqmHGSbhlzQkNCCZ3ABChYAqR+NtAt95csg5YRBYzZ64GV7ion4XFds7fX+0JqhD4LxjWw4knWjRCefbC4y25u1+UuO3IIxvfju1fIGdAvazv7wJqWTZmeCD4dzTpvmTiOVqsn2Cmo2etY0umILQnodB7I+F9sFWMTZacGhg4pWfrRWt3zWQ+m9HmUGA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com;
 dmarc=pass (p=quarantine sp=quarantine 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=se069sIWWsysARQh1mWM0EMZrrw0bC4qB4exnXcL2JA=;
 b=AixVNBHP6V+4+arBjgj5we6PDEgzHQCfKoWWUSYq9msB9uGU5B3FKoEFkP5mXoRgRbbz40Kp69FitYJGXoGJ2n4w1Ux8ZRzWrThAy3flNZPjQr0VEO0hFRmMPb4jrSZ+j374lt8XBiA/lvgMqxJ+zbG61c7GR+JGHHUT8BOXbXG8U2j73FprAvxbGenVYKBQgxeGjYY6UF9zMa3EWlnbFhQgYRlw4KU8/SeUjgypxQDn++0yVSgdDYbwfXVEgJd9CyJKfYgunw7FcODpY+2E66Yy84eY2Mp9kcXgSR5tG0Oo4/KZeTc5WpTOhwPPtJPCPU350UGoWLqg5EMvIg0BmQ==
Received: from DM6PR01CA0016.prod.exchangelabs.com (2603:10b6:5:296::21) by
 SA0PR12MB4526.namprd12.prod.outlook.com (2603:10b6:806:98::23) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.4690.15; Wed, 10 Nov 2021 06:38:42 +0000
Received: from DM6NAM11FT044.eop-nam11.prod.protection.outlook.com
 (2603:10b6:5:296:cafe::a0) by DM6PR01CA0016.outlook.office365.com
 (2603:10b6:5:296::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend
 Transport; Wed, 10 Nov 2021 06:38:42 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34)
 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.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
 DM6NAM11FT044.mail.protection.outlook.com (10.13.173.185) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id
 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:38:42 +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.18; Wed, 10 Nov
 2021 06:38:39 +0000
From: Xueming Li <xuemingl@nvidia.com>
To: Qiming Chen <chenqiming_huawei@163.com>
CC: Luca Boccassi <bluca@debian.org>, Qi Zhang <qi.z.zhang@intel.com>, dpdk
 stable <stable@dpdk.org>
Date: Wed, 10 Nov 2021 14:29:02 +0800
Message-ID: <20211110063216.2744012-59-xuemingl@nvidia.com>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com>
References: <20211110063216.2744012-1-xuemingl@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: 272684b3-2714-4542-26e6-08d9a414bcd3
X-MS-TrafficTypeDiagnostic: SA0PR12MB4526:
X-Microsoft-Antispam-PRVS: <SA0PR12MB4526422FE768DEE437E8C378A1939@SA0PR12MB4526.namprd12.prod.outlook.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:9508;
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: QjvS1HnRGzzjKFSuaPxdueebWr9qyAeIef+iyK1sL5w2bz7U3bvpaLAxnGPWEos1ZHWo68tlZZk/Y+d/QDvQAc/RZ0X5MtbCfHmuHsxOwpo4kVZOIcYLUtacjL1eXjLI8MZslXKaATEdmKZKoCo0Bv8ZtXI7pvpsqbP6sjeyDPpXpZeI9OJ+ODbTCeA21IjNy/FERZpMR3tu+n1z0upDmdaxKig04vieOA3da90e3inrOacd2osqVXaiZppkI5fF0UNGoK+NDrRNJ8pUljFUHmNnRkuGgLNFDOXRBlreopj01TaDiufLRuQXc+pgZcIxKGdzQu+HriDQj6PY3dzDqmbuPoWc6aBykRIvH+OV8ICI6j9xNXo6fwlxIxCjzjrPD2V/l5F4Hj0nzmAYOPGo6Hbvw59BPOP9uX6wfoulLwEwQjvyJogCGKRP57qpYG00TU/Sbh3wv6l/hNZ5NQ1VpBQ4FVR7qyuj5XCvAs0WvZcdJvJ1214UXWJYoaquNK5dNxOIxGS2CYXh7U73yGi0leiI/7Di+MQM1GTX0AtF3mDWiEqfocvUSXy+RZjE8PP9Y8suvL+iGM4vAk07C9ZDnPwfds74KBEd4jhWQi7u+PaQYzYufA/XC498IP88cptC4l8sKl46Jaud8oLHrZJxkHxeQDCqfEs3RbpYXO7oJYFzpWBSRC4x7pr+1VMJBmx4lDZ3tOgXPdVUPQ+u201VzY5wjMvd1+BfZx6JXDngxjXPq7CsbD3iHx8f6O7hbjTajzsM+vHN85bkcGu/B2+78PnZCoY0OuXRz65Mkbzrd72+g9nDZo5f1tJvOb5oK661uG297ymq5Vb6GpuQ7QEZVQ==
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)(36840700001)(46966006)(53546011)(8676002)(7696005)(966005)(47076005)(5660300002)(26005)(186003)(54906003)(4326008)(8936002)(508600001)(16526019)(36756003)(6916009)(356005)(86362001)(82310400003)(336012)(316002)(2906002)(426003)(6666004)(1076003)(36906005)(70206006)(70586007)(2616005)(4001150100001)(7636003)(55016002)(6286002)(36860700001);
 DIR:OUT; SFP:1101; 
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:38:42.2932 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 272684b3-2714-4542-26e6-08d9a414bcd3
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: DM6NAM11FT044.eop-nam11.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4526
Subject: [dpdk-stable] patch 'net/i40e: fix mbuf leak' has been queued to
 stable release 20.11.4
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
Sender: "stable" <stable-bounces@dpdk.org>

Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. 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://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/30fcdc4f505bc16ecfd36ab72f9980f33967c119

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
>From 30fcdc4f505bc16ecfd36ab72f9980f33967c119 Mon Sep 17 00:00:00 2001
From: Qiming Chen <chenqiming_huawei@163.com>
Date: Mon, 23 Aug 2021 09:50:34 +0800
Subject: [PATCH] net/i40e: fix mbuf leak
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4b458675d3df13d1a35db959fe97a04a132788b2 ]

A local test found that repeated port start and stop operations during
the continuous SSE vector bufflist receiving process will cause the mbuf
resource to run out. The final positioning is when the port is stopped,
the mbuf of the pkt_first_seg pointer is not released. Resources leak.
The patch scheme is to judge whether the pointer is empty when the port
is stopped, and release the corresponding mbuf if it is not empty.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 0e5293fc94..154f649b45 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2488,6 +2488,10 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq)
 #endif /* RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC */
 	rxq->rx_tail = 0;
 	rxq->nb_rx_hold = 0;
+
+	if (rxq->pkt_first_seg != NULL)
+		rte_pktmbuf_free(rxq->pkt_first_seg);
+
 	rxq->pkt_first_seg = NULL;
 	rxq->pkt_last_seg = NULL;
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:04.673186500 +0800
+++ 0058-net-i40e-fix-mbuf-leak.patch	2021-11-10 14:17:01.810746582 +0800
@@ -1 +1 @@
-From 4b458675d3df13d1a35db959fe97a04a132788b2 Mon Sep 17 00:00:00 2001
+From 30fcdc4f505bc16ecfd36ab72f9980f33967c119 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4b458675d3df13d1a35db959fe97a04a132788b2 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 8329cbdd4e..3eb82578b0 100644
+index 0e5293fc94..154f649b45 100644
@@ -26 +28 @@
-@@ -2590,6 +2590,10 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq)
+@@ -2488,6 +2488,10 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq)