From: Tal Shnaiderman <talshn@nvidia.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, pallavi.kadam@intel.com,
dmitry.kozliuk@gmail.com, navasile@linux.microsoft.com,
dmitrym@microsoft.com, david.marchand@redhat.com
Subject: [dpdk-dev] [PATCH v8 1/2] eal: move thread affinity functions to new file
Date: Wed, 6 Jan 2021 21:45:42 +0200 [thread overview]
Message-ID: <20210106194543.14024-2-talshn@nvidia.com> (raw)
In-Reply-To: <20210106194543.14024-1-talshn@nvidia.com>
Move the definition of the functions
rte_thread_set_affinity and rte_thread_get_affinity
to new file, rte_thread.h
The file will implement generic threading functionality
and will only host threading functions which do not reference
pthread API.
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
lib/librte_eal/include/meson.build | 1 +
lib/librte_eal/include/rte_lcore.h | 22 +----------------
lib/librte_eal/include/rte_thread.h | 47 +++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 21 deletions(-)
create mode 100644 lib/librte_eal/include/rte_thread.h
diff --git a/lib/librte_eal/include/meson.build b/lib/librte_eal/include/meson.build
index dc007084ff..0dea342e1d 100644
--- a/lib/librte_eal/include/meson.build
+++ b/lib/librte_eal/include/meson.build
@@ -40,6 +40,7 @@ headers += files(
'rte_service_component.h',
'rte_string_fns.h',
'rte_tailq.h',
+ 'rte_thread.h',
'rte_time.h',
'rte_trace.h',
'rte_trace_point.h',
diff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h
index 48b87e253a..0fe0bd839c 100644
--- a/lib/librte_eal/include/rte_lcore.h
+++ b/lib/librte_eal/include/rte_lcore.h
@@ -15,6 +15,7 @@
#include <rte_per_lcore.h>
#include <rte_eal.h>
#include <rte_launch.h>
+#include <rte_thread.h>
#ifdef __cplusplus
extern "C" {
@@ -357,27 +358,6 @@ __rte_experimental
void
rte_lcore_dump(FILE *f);
-/**
- * Set core affinity of the current thread.
- * Support both EAL and non-EAL thread and update TLS.
- *
- * @param cpusetp
- * Point to cpu_set_t for setting current thread affinity.
- * @return
- * On success, return 0; otherwise return -1;
- */
-int rte_thread_set_affinity(rte_cpuset_t *cpusetp);
-
-/**
- * Get core affinity of the current thread.
- *
- * @param cpusetp
- * Point to cpu_set_t for getting current thread cpu affinity.
- * It presumes input is not NULL, otherwise it causes panic.
- *
- */
-void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
-
/**
* Set thread names.
*
diff --git a/lib/librte_eal/include/rte_thread.h b/lib/librte_eal/include/rte_thread.h
new file mode 100644
index 0000000000..43bf568d59
--- /dev/null
+++ b/lib/librte_eal/include/rte_thread.h
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2021 Mellanox Technologies, Ltd
+ */
+
+#include <rte_os.h>
+
+#ifndef _RTE_THREAD_H_
+#define _RTE_THREAD_H_
+
+/**
+ * @file
+ *
+ * Threading functions
+ *
+ * Simple threads functionality supplied by EAL.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Set core affinity of the current thread.
+ * Support both EAL and non-EAL thread and update TLS.
+ *
+ * @param cpusetp
+ * Point to cpu_set_t for setting current thread affinity.
+ * @return
+ * On success, return 0; otherwise return -1;
+ */
+int rte_thread_set_affinity(rte_cpuset_t *cpusetp);
+
+/**
+ * Get core affinity of the current thread.
+ *
+ * @param cpusetp
+ * Point to cpu_set_t for getting current thread cpu affinity.
+ * It presumes input is not NULL, otherwise it causes panic.
+ *
+ */
+void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_THREAD_H_ */
--
2.16.1.windows.4
next prev parent reply other threads:[~2021-01-06 19:46 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-13 20:24 [dpdk-dev] [PATCH v2] eal/windows: add pthread TLS function support Tal Shnaiderman
2020-12-15 22:36 ` Dmitry Kozlyuk
2020-12-17 17:49 ` [dpdk-dev] [PATCH v3] eal: add generic thread-local-storage functions Tal Shnaiderman
2020-12-17 20:56 ` Dmitry Kozlyuk
2020-12-18 19:37 ` Tal Shnaiderman
2020-12-22 7:30 ` [dpdk-dev] [PATCH v4] " Tal Shnaiderman
2020-12-23 1:18 ` Dmitry Kozlyuk
2020-12-23 11:44 ` Tal Shnaiderman
2020-12-23 11:58 ` Dmitry Kozlyuk
2020-12-23 18:16 ` [dpdk-dev] [EXTERNAL] " Dmitry Malloy (MESHCHANINOV)
2020-12-26 16:08 ` [dpdk-dev] [PATCH v5] " Tal Shnaiderman
2020-12-29 23:13 ` Dmitry Kozlyuk
2020-12-30 10:04 ` Tal Shnaiderman
2020-12-30 11:12 ` [dpdk-dev] [PATCH v6] " Tal Shnaiderman
2021-01-01 22:16 ` Dmitry Kozlyuk
2021-01-05 11:53 ` Thomas Monjalon
2021-01-05 17:06 ` [dpdk-dev] [PATCH v7 0/2] support generic threading functions Tal Shnaiderman
2021-01-05 17:06 ` [dpdk-dev] [PATCH v7 1/2] eal: move thread affinity functions to new file Tal Shnaiderman
2021-01-06 14:40 ` Dmitry Kozlyuk
2021-01-06 19:45 ` [dpdk-dev] [PATCH v8 0/2] support generic threading functions Tal Shnaiderman
2021-01-06 19:45 ` Tal Shnaiderman [this message]
2021-01-06 19:45 ` [dpdk-dev] [PATCH v8 2/2] eal: add generic thread-local-storage functions Tal Shnaiderman
2021-01-06 20:10 ` Dmitry Kozlyuk
2021-01-06 20:33 ` Tal Shnaiderman
2021-01-06 20:35 ` [dpdk-dev] [PATCH v9 0/2] support generic threading functions Tal Shnaiderman
2021-01-06 20:35 ` [dpdk-dev] [PATCH v9 1/2] eal: move thread affinity functions to new file Tal Shnaiderman
2021-01-06 20:35 ` [dpdk-dev] [PATCH v9 2/2] eal: add generic thread-local-storage functions Tal Shnaiderman
2021-01-07 14:46 ` Dmitry Kozlyuk
2021-02-10 13:33 ` Burakov, Anatoly
2021-02-10 14:26 ` Medvedkin, Vladimir
2021-02-11 7:34 ` Tal Shnaiderman
2021-02-11 7:26 ` Tal Shnaiderman
2021-01-11 22:33 ` [dpdk-dev] [PATCH v9 0/2] support generic threading functions Thomas Monjalon
2021-01-05 17:06 ` [dpdk-dev] [PATCH v7 2/2] eal: add generic thread-local-storage functions Tal Shnaiderman
2021-01-06 15:05 ` Dmitry Kozlyuk
2021-01-06 16:04 ` Tal Shnaiderman
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=20210106194543.14024-2-talshn@nvidia.com \
--to=talshn@nvidia.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=dmitrym@microsoft.com \
--cc=navasile@linux.microsoft.com \
--cc=pallavi.kadam@intel.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).