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 28005A0524
	for <public@inbox.dpdk.org>; Thu,  6 May 2021 11:45:29 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 1E2F1410EE;
	Thu,  6 May 2021 11:45:29 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [216.205.24.124])
 by mails.dpdk.org (Postfix) with ESMTP id 62D80410FF
 for <stable@dpdk.org>; Thu,  6 May 2021 11:45:27 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1620294326;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=//eaFyvgHuwz5mQWpB36yYb4OB5+4PjRCK7vl/sXkfg=;
 b=fJ0mrdhYgh4gZKVyZFIaVMn9qTIK7w6mRROtNtDkTmQLvoQvIKPYEjx4oXpvjFj+xxNC/I
 D37yVqaZN4XcelWDGY9lD4MfCuE0uoTvZ4nqTwWXhKvwlkfS95qoM3fcCMZES/w8sZrCz1
 yyYUHd0v3ed378iNYgO0hLPW5sP/gmI=
Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com
 [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-477-mgznzR7WN6mBmdL7Qoe_8Q-1; Thu, 06 May 2021 05:45:23 -0400
X-MC-Unique: mgznzR7WN6mBmdL7Qoe_8Q-1
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
 [10.5.11.11])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C22A0107ACC7;
 Thu,  6 May 2021 09:45:21 +0000 (UTC)
Received: from dmarchan.remote.csb (unknown [10.40.192.60])
 by smtp.corp.redhat.com (Postfix) with ESMTP id 3A0C359460;
 Thu,  6 May 2021 09:45:19 +0000 (UTC)
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Qiming Yang <qiming.yang@intel.com>,
 Qi Zhang <qi.z.zhang@intel.com>, Haiyue Wang <haiyue.wang@intel.com>
Date: Thu,  6 May 2021 11:44:52 +0200
Message-Id: <20210506094452.1689-3-david.marchand@redhat.com>
In-Reply-To: <20210506094452.1689-1-david.marchand@redhat.com>
References: <20210506094452.1689-1-david.marchand@redhat.com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="US-ASCII"
Subject: [dpdk-stable] [PATCH 2/2] net/ice: fix leak on thread termination
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>

A terminated pthread should be joined or detached so that its associated
resources are released.

The "ice-reset-<vf_id>" threads are used to service some reset task in the
background, but they are never joined by the thread that created them.
The easiest solution is to detach new threads.

Fixes: 3b3757bda3c3 ("net/ice: get VF hardware index in DCF")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/ice/ice_dcf_parent.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index c8e433239b..1d7aa8bc87 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -121,6 +121,8 @@ ice_dcf_vsi_update_service_handler(void *param)
 	struct ice_dcf_hw *hw = reset_param->dcf_hw;
 	struct ice_dcf_adapter *adapter;
 
+	pthread_detach(pthread_self());
+
 	rte_delay_us(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
 
 	rte_spinlock_lock(&vsi_update_lock);
-- 
2.23.0