DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal/windows: support thread ID query
@ 2020-05-18 14:26 Tasnim Bashar
  2020-05-18 17:48 ` Dmitry Kozlyuk
  0 siblings, 1 reply; 2+ messages in thread
From: Tasnim Bashar @ 2020-05-18 14:26 UTC (permalink / raw)
  To: dev
  Cc: harini.ramakrishnan, pallavi.kadam, ranjit.menon, ocardona,
	navasile, dmitry.kozliuk, talshn, fady, ophirmu, thomas, tbashar

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>
---
 lib/librte_eal/windows/eal_thread.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index e149199a6f..18f03c4280 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -157,6 +157,12 @@ eal_thread_create(pthread_t *thread)
 	return 0;
 }
 
+/* get current thread ID */
+int rte_sys_gettid(void)
+{
+	return (int)eal_thread_self();
+}
+
 int
 rte_thread_setname(__rte_unused pthread_t id, __rte_unused const char *name)
 {
-- 
2.16.1.windows.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] eal/windows: support thread ID query
  2020-05-18 14:26 [dpdk-dev] [PATCH] eal/windows: support thread ID query Tasnim Bashar
@ 2020-05-18 17:48 ` Dmitry Kozlyuk
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Kozlyuk @ 2020-05-18 17:48 UTC (permalink / raw)
  To: Tasnim Bashar
  Cc: dev, harini.ramakrishnan, pallavi.kadam, ranjit.menon, ocardona,
	navasile, talshn, fady, ophirmu, thomas

On Mon, 18 May 2020 17:26:34 +0300
Tasnim Bashar <tbashar@mellanox.com> wrote:

> 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>
> ---
>  lib/librte_eal/windows/eal_thread.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/librte_eal/windows/eal_thread.c
> b/lib/librte_eal/windows/eal_thread.c index e149199a6f..18f03c4280
> 100644 --- a/lib/librte_eal/windows/eal_thread.c
> +++ b/lib/librte_eal/windows/eal_thread.c
> @@ -157,6 +157,12 @@ eal_thread_create(pthread_t *thread)
>  	return 0;
>  }
>  
> +/* get current thread ID */
> +int rte_sys_gettid(void)

Please follow the style guide and place return type on a separate line.
You can use ./devtools/checkpatches.sh to catch similar mistakes.

> +{
> +	return (int)eal_thread_self();

Maybe get rid of eal_thread_self() in this file and replace its call
with rte_sys_gettid()?

> +}
> +
>  int
>  rte_thread_setname(__rte_unused pthread_t id, __rte_unused const
> char *name) {

--
Dmitry Kozlyuk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-18 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 14:26 [dpdk-dev] [PATCH] eal/windows: support thread ID query Tasnim Bashar
2020-05-18 17:48 ` Dmitry Kozlyuk

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).