bus/dpaa: reduce thread ID syscall usage

Reuse DPDK rte_gettid instead of syscall.
It will help to reduce the dpaa portal allocation time.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
This commit is contained in:
Hemant Agrawal 2021-07-19 19:29:13 +05:30 committed by Thomas Monjalon
parent 8d2bf7c1d5
commit 97f4844c3f
2 changed files with 5 additions and 7 deletions

View File

@ -12,7 +12,6 @@
#include <signal.h> #include <signal.h>
#include <pthread.h> #include <pthread.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/syscall.h>
#include <sys/eventfd.h> #include <sys/eventfd.h>
#include <rte_byteorder.h> #include <rte_byteorder.h>
@ -314,7 +313,7 @@ int rte_dpaa_portal_init(void *arg)
DPAA_PER_LCORE_PORTAL->qman_idx = qman_get_portal_index(); DPAA_PER_LCORE_PORTAL->qman_idx = qman_get_portal_index();
DPAA_PER_LCORE_PORTAL->bman_idx = bman_get_portal_index(); DPAA_PER_LCORE_PORTAL->bman_idx = bman_get_portal_index();
DPAA_PER_LCORE_PORTAL->tid = syscall(SYS_gettid); DPAA_PER_LCORE_PORTAL->tid = rte_gettid();
ret = pthread_setspecific(dpaa_portal_key, ret = pthread_setspecific(dpaa_portal_key,
(void *)DPAA_PER_LCORE_PORTAL); (void *)DPAA_PER_LCORE_PORTAL);

View File

@ -19,7 +19,6 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include<sys/eventfd.h> #include<sys/eventfd.h>
@ -278,8 +277,8 @@ static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void)
return NULL; return NULL;
} }
DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %lu", DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %u",
dpio_dev, dpio_dev->index, syscall(SYS_gettid)); dpio_dev, dpio_dev->index, rte_gettid());
/* Set the Stashing Destination */ /* Set the Stashing Destination */
cpu_id = dpaa2_get_core_id(); cpu_id = dpaa2_get_core_id();
@ -310,7 +309,7 @@ int
dpaa2_affine_qbman_swp(void) dpaa2_affine_qbman_swp(void)
{ {
struct dpaa2_dpio_dev *dpio_dev; struct dpaa2_dpio_dev *dpio_dev;
uint64_t tid = syscall(SYS_gettid); uint64_t tid = rte_gettid();
/* Populate the dpaa2_io_portal structure */ /* Populate the dpaa2_io_portal structure */
if (!RTE_PER_LCORE(_dpaa2_io).dpio_dev) { if (!RTE_PER_LCORE(_dpaa2_io).dpio_dev) {
@ -332,7 +331,7 @@ int
dpaa2_affine_qbman_ethrx_swp(void) dpaa2_affine_qbman_ethrx_swp(void)
{ {
struct dpaa2_dpio_dev *dpio_dev; struct dpaa2_dpio_dev *dpio_dev;
uint64_t tid = syscall(SYS_gettid); uint64_t tid = rte_gettid();
/* Populate the dpaa2_io_portal structure */ /* Populate the dpaa2_io_portal structure */
if (!RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev) { if (!RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev) {