summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Gupta <nipun.gupta@nxp.com>2019-08-29 15:57:10 +0530
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-08 12:14:30 +0200
commit84e3d0853e1f3a0f678c60da40e47fc1bd39f5bb (patch)
tree4f7de321d60655fd553c99f7c1f8a5044a45dcf3
parent1cd8d4ce5d78064e7747e9de49932eebcea23802 (diff)
downloaddpdk-84e3d0853e1f3a0f678c60da40e47fc1bd39f5bb.zip
dpdk-84e3d0853e1f3a0f678c60da40e47fc1bd39f5bb.tar.gz
dpdk-84e3d0853e1f3a0f678c60da40e47fc1bd39f5bb.tar.xz
bus/dpaa: remove thread affinity
Thread affinity is already taken care by DPDK. Remove them from bus. Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
-rw-r--r--drivers/bus/dpaa/base/qbman/qman_driver.c56
-rw-r--r--drivers/bus/dpaa/dpaa_bus.c13
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 ba15339..5c77366 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 f7d1a5b..b0e68c4 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) {