From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48C5FA059A for ; Fri, 10 Apr 2020 08:22:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E7A01C1FB; Fri, 10 Apr 2020 08:22:34 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7B2C11C1AD; Fri, 10 Apr 2020 08:22:31 +0200 (CEST) IronPort-SDR: ENZ9cDDauJ6v8HKEdFMpsaiyRd7ClhmtEIS6KDVmf9T24VaPCPxohx7sgMV2URjABCJEUM3VH+ abJuJIK3N82Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 23:22:30 -0700 IronPort-SDR: Bo640l4wLCqbJzNQ/WiEpjH7fWMBmplAFB7mOG15dOKFtLoRmlwTCsG/QxG3L83x7WkpJWZC8l cFo3ikRXkGew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,364,1580803200"; d="scan'208";a="270318279" Received: from ubuntu.sh.intel.com ([10.240.183.163]) by orsmga002.jf.intel.com with ESMTP; 09 Apr 2020 23:22:26 -0700 From: taox.zhu@intel.com To: konstantin.ananyev@intel.com, wenzhuo.lu@intel.com, xiaolong.ye@intel.com Cc: dev@dpdk.org, martin.weiser@allegro-packets.com, Zhu Tao , stable@dpdk.org Date: Fri, 10 Apr 2020 02:22:27 -0400 Message-Id: <20200410062227.24201-1-taox.zhu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <1586495895-9610-1-git-send-email-taox.zhu@intel.com> References: <1586495895-9610-1-git-send-email-taox.zhu@intel.com> Subject: [dpdk-stable] [PATCH v2] net/ixgbe: fix resource leak after thread exits normally X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Zhu Tao When the thread exits normally, pthread_join() is not called, which can result in a resource leak. Therefore, the thread is set to separation mode using function pthread_detach(), so that no program call pthread_join() is required to recycle, and when the thread exits, the system automatically reclaims resources. Fixes: 819d0d1d57f1 ("net/ixgbe: fix blocking system events") Cc: stable@dpdk.org Signed-off-by: Zhu Tao --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) v2 changes: commit log. diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 2c57976..f141ae4 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4165,11 +4165,9 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, ixgbe_dev_cancel_link_thread(struct rte_eth_dev *dev) { struct ixgbe_adapter *ad = dev->data->dev_private; - void *retval; if (!ixgbe_dev_wait_setup_link_complete(dev)) { pthread_cancel(ad->link_thread_tid); - pthread_join(ad->link_thread_tid, &retval); rte_atomic32_clear(&ad->link_thread_running); PMD_DRV_LOG(ERR, "Link thread not complete, cancel it!"); } @@ -4186,6 +4184,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, u32 speed; bool autoneg = false; + pthread_detach(pthread_self()); speed = hw->phy.autoneg_advertised; if (!speed) ixgbe_get_link_capabilities(hw, &speed, &autoneg); -- 1.8.3.1