From patchwork Fri Mar 6 09:57:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 184242 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp7232152ile; Fri, 6 Mar 2020 02:00:45 -0800 (PST) X-Google-Smtp-Source: ADFU+vsdVaV0SxxyEDQXGcWxu9e93lrLwo7hCa+A35YfVAQl0PvMtTtmxeUITKIH6xnGhGKGDgCo X-Received: by 2002:a05:6402:2214:: with SMTP id cq20mr2190920edb.302.1583488844833; Fri, 06 Mar 2020 02:00:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583488844; cv=none; d=google.com; s=arc-20160816; b=yGR0uK7qxG/n1wUL8zihwJHq0PWLX5ne/w3Q4aZeTaVxfaTJLI+ub4VMnxZp49GlDq WzVLh7GuzRHSmAKyy+L9gGz6vgZOeGIAyiodHj2JSg4r9q7wT/W8NsqvFzC4r/d66RZr UEMhKSb2qhkeGXzrZlAI7wY+N2ueoSCouHmazMCWpE6tSXRS2z5CsvGMZY/l2jfWi2f9 5uwnxrXWXPCtZ3FMYw0OJ7krQMexTmql7QeuFdI3biYeHVFD4y1W4V3OO9uB91XK17gY rnkbRD3//YOfFcT9KeF9IAINS4AZmctmDHJduI0z+HT83KIVqrfVEbuisbSVhtLfC3h2 tedg== 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=XdLpkyXRQti3Foa+D4VLIuYue5I2GbFZ7rGgsQPPXAf1xOjTWtBcHQELfmozZAhuN+ DbVNAM0bo2W/hCYdL4+77jlLkKooTNvFJr12hHmLmXSwqptZIa2GTjpYL3LK3mu5lOXO 13D15XUaSvCKr0gEdHuPnt1TDZ/SnHQBJ9B4lHwVlwCeRyfUon7fCmHmFYIXnCT7fyGl qOeS/5+HwHsEPggrA18mA5L3uvTzgfDQeXrhAclFJBIXFQ92C1KqsjuYT4rrp1uhp3Gp mnp4sVIzVymFqigAzmWFd/T5VdEOQdcvfEKtOYPBYdhXbxC+vZ43osVpxqJ/esBtAFhO Y1mw== 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 j5si1544721edv.89.2020.03.06.02.00.44; Fri, 06 Mar 2020 02:00:44 -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 874C21C030; Fri, 6 Mar 2020 10:59:55 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 800111BFF5 for ; Fri, 6 Mar 2020 10:59:49 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 644FB1A0AB0; Fri, 6 Mar 2020 10:59:49 +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 50C1D1A0AA0; Fri, 6 Mar 2020 10:59:47 +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 38E07402F3; Fri, 6 Mar 2020 17:59:43 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Nipun Gupta Date: Fri, 6 Mar 2020 15:27:32 +0530 Message-Id: <20200306095742.18080-7-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200306095742.18080-1-hemant.agrawal@nxp.com> References: <20200302145829.27808-1-hemant.agrawal@nxp.com> <20200306095742.18080-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 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); } /*