From patchwork Thu Aug 29 10:27:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 58253 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 290161DF98; Thu, 29 Aug 2019 12:41:55 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id D08A21D440 for ; Thu, 29 Aug 2019 12:41:46 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 92B32200332; Thu, 29 Aug 2019 12:41:46 +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 514F8200322; Thu, 29 Aug 2019 12:41:44 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D9C57402F0; Thu, 29 Aug 2019 18:41:40 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, Nipun Gupta Date: Thu, 29 Aug 2019 15:57:10 +0530 Message-Id: <20190829102737.13267-4-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> <20190829102737.13267-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 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 Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman_driver.c | 56 ++--------------------- drivers/bus/dpaa/dpaa_bus.c | 13 ------ 2 files changed, 3 insertions(+), 66 deletions(-) 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) {