DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tasnim Bashar <tbashar@mellanox.com>
To: dev@dpdk.org
Cc: harini.ramakrishnan@microsoft.com, pallavi.kadam@intel.com,
	ranjit.menon@intel.com, ocardona@microsoft.com,
	navasile@linux.microsoft.com, dmitry.kozliuk@gmail.com,
	talshn@mellanox.com, fady@mellanox.com, ophirmu@mellanox.com,
	thomas@monjalon.net
Subject: [dpdk-dev] [PATCH v2] eal/windows: support thread ID query
Date: Wed, 20 May 2020 17:32:53 -0700	[thread overview]
Message-ID: <20200521003253.75212-1-tbashar@mellanox.com> (raw)
In-Reply-To: <20200518142634>

Add rte_sys_gettid function to use rte_gettid() on Windows.
rte_gettid() is required for recursive spin lock and recursive ticket lock.

Signed-off-by: Tasnim Bashar <tbashar@mellanox.com>
---

v2: remove eal_thread_self function and fix style

---
 lib/librte_eal/windows/eal_thread.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index e149199a6f..4c1e31c58a 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -64,12 +64,6 @@ eal_thread_init_master(unsigned int lcore_id)
 	RTE_PER_LCORE(_lcore_id) = lcore_id;
 }
 
-static inline pthread_t
-eal_thread_self(void)
-{
-	return GetCurrentThreadId();
-}
-
 /* main loop of threads */
 void *
 eal_thread_loop(void *arg __rte_unused)
@@ -81,7 +75,7 @@ eal_thread_loop(void *arg __rte_unused)
 	int m2s, s2m;
 	char cpuset[RTE_CPU_AFFINITY_STR_LEN];
 
-	thread_id = eal_thread_self();
+	thread_id = pthread_self();
 
 	/* retrieve our lcore_id from the configuration structure */
 	RTE_LCORE_FOREACH_SLAVE(lcore_id) {
@@ -157,6 +151,13 @@ eal_thread_create(pthread_t *thread)
 	return 0;
 }
 
+/* get current thread ID */
+int
+rte_sys_gettid(void)
+{
+	return GetCurrentThreadId();
+}
+
 int
 rte_thread_setname(__rte_unused pthread_t id, __rte_unused const char *name)
 {
-- 
2.19.1.windows.1


       reply	other threads:[~2020-05-21  0:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200518142634>
2020-05-21  0:32 ` Tasnim Bashar [this message]
2020-05-25  1:08   ` Dmitry Kozlyuk
2020-06-11 14:41     ` 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=20200521003253.75212-1-tbashar@mellanox.com \
    --to=tbashar@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=fady@mellanox.com \
    --cc=harini.ramakrishnan@microsoft.com \
    --cc=navasile@linux.microsoft.com \
    --cc=ocardona@microsoft.com \
    --cc=ophirmu@mellanox.com \
    --cc=pallavi.kadam@intel.com \
    --cc=ranjit.menon@intel.com \
    --cc=talshn@mellanox.com \
    --cc=thomas@monjalon.net \
    /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).