From patchwork Mon Mar 2 14:58:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 184078 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2192315ile; Mon, 2 Mar 2020 01:27:37 -0800 (PST) X-Google-Smtp-Source: APXvYqx72xbtLrkWFBFdyKYiBdQ4Et8OfK2RiXWrAnin5Lcw+E2B5FZe3EACAzREkGDP88hE7ohF X-Received: by 2002:a05:6402:153:: with SMTP id s19mr15224801edu.149.1583141257055; Mon, 02 Mar 2020 01:27:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583141257; cv=none; d=google.com; s=arc-20160816; b=jrsoz4CbsI+9MnKt+wkEdh2zBzXaPpz4xxXu6xuR//dqj+F2SeQeDvEY49HIamHpPZ qULfave24JWlp/FZi0m/9s80bX18/aoo2hQYLKyPcMuAM/O9emHISygxjDcpuRWXao0m Xodvw2otaw/On7LpUqXGe9EI8sNlca3PoIsXGP5FjDPAcxlhnoe7Xl3VHWYTN85Z74qR lCIcsnovO2/6D3RTUHnc4MjaophbX6sdc6yfcBWVMbOJZGeaoHXymNSfW07PNM/x8O4T nHCJAaZEPwE2QOGt36ppWsbmLCljvQGozH81bZGW5XvRSZpaOI33okdjk8fs4xIcY+2H Iwng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=flnDolx4+AgifEEonUxUXPuA2wkg88lpPccymmgBjh4=; b=AgaKfdstjZSWfMCbcNk1Sty2PK22ZywTW1pNYatd9Ry95Kvu5Ac84mnjMbIJacVvuC r5AHhdcN36ysvL5FBWB69FSwivqKyEKvebhQDojremOdKwbfResqucTv9loOkG25E/fl QAteoRdPRDEBG0nbYys/z5wwlaFr8SLaf8Ne0xfhsADbThJo3n5340Y2MNI3syWrEKjr 7gmFQjyPupDPO66MhDMl00q8dysLzhDDurGcn92BMKSYx3GGNu3CeVio4oO+hzGEKt5q 7P3joJNBaF+9gY2lLjgqYPjZBVPHumMBr7MTVGs5ZP0A4Hoh6dkL7xrTHg3PeNQsl0Qm jFkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id b1si6729634eds.169.2020.03.02.01.27.36; Mon, 02 Mar 2020 01:27:37 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 28E211C08C; Mon, 2 Mar 2020 10:26:44 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 93F171C02A for ; Mon, 2 Mar 2020 10:26:38 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6C5721A0FB0; Mon, 2 Mar 2020 10:26:38 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5B2E11A02D7; Mon, 2 Mar 2020 10:26:36 +0100 (CET) Received: from bf-netperf1.ap.com (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 197A1402F3; Mon, 2 Mar 2020 17:26:32 +0800 (SGT) From: Hemant Agrawal To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Nipun Gupta Date: Mon, 2 Mar 2020 20:28:19 +0530 Message-Id: <20200302145829.27808-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200302145829.27808-1-hemant.agrawal@nxp.com> References: <20200302145829.27808-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 06/16] bus/fslmc: limit pthread destructor called for dpaa2 only X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Nipun Gupta The destructor was being called for non-dpaa2 as well Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 1a1453ea3..054d45306 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -299,6 +299,13 @@ static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void) return NULL; } + ret = pthread_setspecific(dpaa2_portal_key, (void *)dpio_dev); + if (ret) { + DPAA2_BUS_ERR("pthread_setspecific failed with ret: %d", ret); + dpaa2_put_qbman_swp(dpio_dev); + return NULL; + } + return dpio_dev; } @@ -346,12 +353,14 @@ dpaa2_affine_qbman_ethrx_swp(void) return 0; } -static void __attribute__((destructor(102))) dpaa2_portal_finish(void *arg) +static void dpaa2_portal_finish(void *arg) { RTE_SET_USED(arg); dpaa2_put_qbman_swp(RTE_PER_LCORE(_dpaa2_io).dpio_dev); dpaa2_put_qbman_swp(RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev); + + pthread_setspecific(dpaa2_portal_key, NULL); } /*