From: Nipun Gupta Date: Thu, 29 Aug 2019 10:27:10 +0000 (+0530) Subject: bus/dpaa: remove thread affinity X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=84e3d0853e1f3a0f678c60da40e47fc1bd39f5bb;p=dpdk.git bus/dpaa: remove thread affinity Thread affinity is already taken care by DPDK. Remove them from bus. Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index ba153396d7..5c773669ae 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 f7d1a5b63b..b0e68c4a4e 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) {