DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCH 3/7] bus/dpaa: reduce syscall usages
Date: Mon, 19 Jul 2021 19:29:13 +0530	[thread overview]
Message-ID: <20210719135917.26241-4-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20210719135917.26241-1-hemant.agrawal@nxp.com>

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>
---
 drivers/bus/dpaa/dpaa_bus.c              | 3 +--
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 9 ++++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 2f48d4036b..e499305d85 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -12,7 +12,6 @@
 #include <signal.h>
 #include <pthread.h>
 #include <sys/types.h>
-#include <sys/syscall.h>
 #include <sys/eventfd.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->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,
 				  (void *)DPAA_PER_LCORE_PORTAL);
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index c6f8312a1d..c224a883ae 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -19,7 +19,6 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
-#include <sys/syscall.h>
 #include <sys/epoll.h>
 #include<sys/eventfd.h>
 
@@ -278,8 +277,8 @@ static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(void)
 		return NULL;
 	}
 
-	DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %lu",
-			dpio_dev, dpio_dev->index, syscall(SYS_gettid));
+	DPAA2_BUS_DEBUG("New Portal %p (%d) affined thread - %u",
+			dpio_dev, dpio_dev->index, rte_gettid());
 
 	/* Set the Stashing Destination */
 	cpu_id = dpaa2_get_core_id();
@@ -310,7 +309,7 @@ int
 dpaa2_affine_qbman_swp(void)
 {
 	struct dpaa2_dpio_dev *dpio_dev;
-	uint64_t tid = syscall(SYS_gettid);
+	uint64_t tid = rte_gettid();
 
 	/* Populate the dpaa2_io_portal structure */
 	if (!RTE_PER_LCORE(_dpaa2_io).dpio_dev) {
@@ -332,7 +331,7 @@ int
 dpaa2_affine_qbman_ethrx_swp(void)
 {
 	struct dpaa2_dpio_dev *dpio_dev;
-	uint64_t tid = syscall(SYS_gettid);
+	uint64_t tid = rte_gettid();
 
 	/* Populate the dpaa2_io_portal structure */
 	if (!RTE_PER_LCORE(_dpaa2_io).ethrx_dpio_dev) {
-- 
2.17.1


  parent reply	other threads:[~2021-07-19 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 13:59 [dpdk-dev] [PATCH 0/7] NXP DPAAx fixes and improvements Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 1/7] bus/dpaa: fix to use right type of memory free Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 2/7] net/dpaa: fix headroom in VSP case Hemant Agrawal
2021-07-19 13:59 ` Hemant Agrawal [this message]
2021-07-19 13:59 ` [dpdk-dev] [PATCH 4/7] net/dpaa: add check for parsing default Rx queue Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 5/7] net/dpaa2: add per thread init PMD API Hemant Agrawal
2021-09-09  7:09   ` Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 6/7] net/dpaa2: add input validation Hemant Agrawal
2021-07-19 13:59 ` [dpdk-dev] [PATCH 7/7] doc: remove SDK info form individual dev guides Hemant Agrawal
2021-07-23 18:34 ` [dpdk-dev] [PATCH 0/7] NXP DPAAx fixes and improvements Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210719135917.26241-4-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).