From patchwork Tue Aug 27 07:07:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172251 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5396462ily; Tue, 27 Aug 2019 00:09:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyySsMBwna6N1PZ4J+piOO68VupUHSGKjgLGH59xWmIYOjlUf2NFuuBDUhBxhnSEW3TMKb X-Received: by 2002:a17:906:e088:: with SMTP id gh8mr19999866ejb.117.1566889782478; Tue, 27 Aug 2019 00:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566889782; cv=none; d=google.com; s=arc-20160816; b=w4eYr/qA2Op/nWX9/uNAKQjHWWST9kRGRkyuBYZzz/VSeiyQbq0zIY1hfpq978lwLt +/C6TD3qyUbHymJ7TLLioP+7vwOLnsiMtl6JtGFC+62fBDR5cQYY398dwBLR5z77BeqA o/nHBSzEPDhaLCo3Md4Q24KuPVwlrG44InD8AZBR3wk9cGfpc/i40EoR7jOxhsXeaBwb S1NSoWNccVLheePaEs8r8YQRcXX/0oEcB19vhR1LhOl4hnT37+b5av3VWudb9AMe/TLP 3Op65EKmjv7eju9nH3gzxsYBPgn6LtEnbxFF5vVw8hxCKzurNFsOLDkQ2MPNhwYlR3NY ORtw== 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=l0UKPCTMnGCbO+BhomoJqgqwQq4WXLWjd4U+1AElciI=; b=ccpeos/ffRG6e3Rv9vL7F/n4lSp8GWfzPKw3N9yK6asSp3uLDDYEKlw5wsClbNs4ME YljtR1eo5HkoK7NJj/msBLgbnTkraETs+3pj5BrZ6iuEi+B867xIk2f3xujpn7YCKRVn 9DU0MsFDU4KIosCRCO+uAsrYU6XjkBCYcWUMU5IuA7w7im+EIA0pypZLD/okvnfZ+LpD bW/7J+qKLW0CCfPs6rf++rxoKJfC10g278Zd89qrNLaBRAQa94N6ud4Bx0eBtkO3E/l8 ytjLSsHnjJ/ngxeRYid2Kgf5k7a7+qX84DpYxAREbM9MQ8uA75kJOiWYS/JnUtkUKh1H F3Rg== 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 f27si8335728edf.102.2019.08.27.00.09.42; Tue, 27 Aug 2019 00:09:42 -0700 (PDT) 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 52DD01BFC6; Tue, 27 Aug 2019 09:09:22 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 5383E1BF7D for ; Tue, 27 Aug 2019 09:09:16 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E1D08200131; Tue, 27 Aug 2019 09:09:15 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9EFB92005C6; Tue, 27 Aug 2019 09:09:13 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 20F5A402EB; Tue, 27 Aug 2019 15:09:10 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Tue, 27 Aug 2019 12:37:03 +0530 Message-Id: <20190827070730.11206-4-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190827070730.11206-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v1 03/30] bus/dpaa: remove un-necessary thread affinity 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 Thread affinity is already taken care by DPDK. Remove them from bus. Signed-off-by: Nipun Gupta --- drivers/bus/dpaa/base/qbman/qman_driver.c | 56 ++--------------------- drivers/bus/dpaa/dpaa_bus.c | 13 ------ 2 files changed, 3 insertions(+), 66 deletions(-) -- 2.17.1 diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index ba153396d..5c773669a 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) * * Copyright 2008-2016 Freescale Semiconductor Inc. - * Copyright 2017 NXP + * Copyright 2017,2019 NXP * */ @@ -32,31 +32,9 @@ static __thread struct dpaa_ioctl_portal_map map = { static int fsl_qman_portal_init(uint32_t index, int is_shared) { - cpu_set_t cpuset; struct qman_portal *portal; - int loop, ret; struct dpaa_ioctl_irq_map irq_map; - - /* Verify the thread's cpu-affinity */ - ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), - &cpuset); - if (ret) { - error(0, ret, "pthread_getaffinity_np()"); - return ret; - } - qpcfg.cpu = -1; - for (loop = 0; loop < CPU_SETSIZE; loop++) - if (CPU_ISSET(loop, &cpuset)) { - if (qpcfg.cpu != -1) { - pr_err("Thread is not affine to 1 cpu\n"); - return -EINVAL; - } - qpcfg.cpu = loop; - } - if (qpcfg.cpu == -1) { - pr_err("Bug in getaffinity handling!\n"); - return -EINVAL; - } + int ret; /* Allocate and map a qman portal */ map.index = index; @@ -145,14 +123,11 @@ void qman_thread_irq(void) struct qman_portal *fsl_qman_portal_create(void) { - cpu_set_t cpuset; struct qman_portal *res; - struct qm_portal_config *q_pcfg; - int loop, ret; struct dpaa_ioctl_irq_map irq_map; struct dpaa_ioctl_portal_map q_map = {0}; - int q_fd; + int q_fd, ret; q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { @@ -160,31 +135,6 @@ struct qman_portal *fsl_qman_portal_create(void) return NULL; } - /* Verify the thread's cpu-affinity */ - ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), - &cpuset); - if (ret) { - error(0, ret, "pthread_getaffinity_np()"); - kfree(q_pcfg); - return NULL; - } - - q_pcfg->cpu = -1; - for (loop = 0; loop < CPU_SETSIZE; loop++) - if (CPU_ISSET(loop, &cpuset)) { - if (q_pcfg->cpu != -1) { - pr_err("Thread is not affine to 1 cpu\n"); - kfree(q_pcfg); - return NULL; - } - q_pcfg->cpu = loop; - } - if (q_pcfg->cpu == -1) { - pr_err("Bug in getaffinity handling!\n"); - kfree(q_pcfg); - return NULL; - } - /* Allocate and map a qman portal */ q_map.type = dpaa_portal_qman; q_map.index = QBMAN_ANY_PORTAL_IDX; diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index f7d1a5b63..b0e68c4a4 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -250,11 +250,9 @@ dpaa_clean_device_list(void) int rte_dpaa_portal_init(void *arg) { - pthread_t id; unsigned int cpu, lcore = rte_lcore_id(); int ret; struct dpaa_portal *dpaa_io_portal; - rte_cpuset_t cpuset; BUS_INIT_FUNC_TRACE(); @@ -266,17 +264,6 @@ int rte_dpaa_portal_init(void *arg) cpu = rte_lcore_to_cpu_id(lcore); - /* Set CPU affinity for this thread.*/ - id = pthread_self(); - cpuset = rte_lcore_cpuset(lcore); - ret = pthread_setaffinity_np(id, sizeof(cpu_set_t), - &cpuset); - if (ret) { - DPAA_BUS_LOG(ERR, "pthread_setaffinity_np failed on core :%u" - " (lcore=%u) with ret: %d", cpu, lcore, ret); - return ret; - } - /* Initialise bman thread portals */ ret = bman_thread_init(); if (ret) {