DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: stephen@networkplumber.org, anatoly.burakov@intel.com,
	thomas@monjalon.net, ktraynor@redhat.com
Subject: [dpdk-dev] [PATCH v3 09/12] eal: deinline lcore APIs
Date: Fri, 25 Oct 2019 15:56:08 +0200	[thread overview]
Message-ID: <1572011772-23271-10-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1572011772-23271-1-git-send-email-david.marchand@redhat.com>

Those functions are used to setup or take control decisions.
Move them into the EAL common code and put them directly in the stable
ABI.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/eal_common_lcore.c  | 38 ++++++++++++++++++++++++++++
 lib/librte_eal/common/include/rte_lcore.h | 41 +++----------------------------
 lib/librte_eal/rte_eal_version.map        | 10 ++++++++
 3 files changed, 52 insertions(+), 37 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index 59a2fd1..b01a210 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -16,6 +16,16 @@
 #include "eal_private.h"
 #include "eal_thread.h"
 
+unsigned int rte_get_master_lcore(void)
+{
+	return rte_eal_get_configuration()->master_lcore;
+}
+
+unsigned int rte_lcore_count(void)
+{
+	return rte_eal_get_configuration()->lcore_count;
+}
+
 int rte_lcore_index(int lcore_id)
 {
 	if (unlikely(lcore_id >= RTE_MAX_LCORE))
@@ -43,6 +53,34 @@ rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)
 	return lcore_config[lcore_id].cpuset;
 }
 
+int rte_lcore_is_enabled(unsigned int lcore_id)
+{
+	struct rte_config *cfg = rte_eal_get_configuration();
+
+	if (lcore_id >= RTE_MAX_LCORE)
+		return 0;
+	return cfg->lcore_role[lcore_id] == ROLE_RTE;
+}
+
+unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
+{
+	i++;
+	if (wrap)
+		i %= RTE_MAX_LCORE;
+
+	while (i < RTE_MAX_LCORE) {
+		if (!rte_lcore_is_enabled(i) ||
+		    (skip_master && (i == rte_get_master_lcore()))) {
+			i++;
+			if (wrap)
+				i %= RTE_MAX_LCORE;
+			continue;
+		}
+		break;
+	}
+	return i;
+}
+
 unsigned int
 rte_lcore_to_socket_id(unsigned int lcore_id)
 {
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index 0c68391..ea40c25 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -93,11 +93,7 @@ rte_lcore_id(void)
  * @return
  *   the id of the master lcore
  */
-static inline unsigned
-rte_get_master_lcore(void)
-{
-	return rte_eal_get_configuration()->master_lcore;
-}
+unsigned int rte_get_master_lcore(void);
 
 /**
  * Return the number of execution units (lcores) on the system.
@@ -105,12 +101,7 @@ rte_get_master_lcore(void)
  * @return
  *   the number of execution units (lcores) on the system.
  */
-static inline unsigned
-rte_lcore_count(void)
-{
-	const struct rte_config *cfg = rte_eal_get_configuration();
-	return cfg->lcore_count;
-}
+unsigned int rte_lcore_count(void);
 
 /**
  * Return the index of the lcore starting from zero.
@@ -215,14 +206,7 @@ rte_lcore_cpuset(unsigned int lcore_id);
  * @return
  *   True if the given lcore is enabled; false otherwise.
  */
-static inline int
-rte_lcore_is_enabled(unsigned int lcore_id)
-{
-	struct rte_config *cfg = rte_eal_get_configuration();
-	if (lcore_id >= RTE_MAX_LCORE)
-		return 0;
-	return cfg->lcore_role[lcore_id] == ROLE_RTE;
-}
+int rte_lcore_is_enabled(unsigned int lcore_id);
 
 /**
  * Get the next enabled lcore ID.
@@ -237,25 +221,8 @@ rte_lcore_is_enabled(unsigned int lcore_id)
  * @return
  *   The next lcore_id or RTE_MAX_LCORE if not found.
  */
-static inline unsigned int
-rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
-{
-	i++;
-	if (wrap)
-		i %= RTE_MAX_LCORE;
+unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap);
 
-	while (i < RTE_MAX_LCORE) {
-		if (!rte_lcore_is_enabled(i) ||
-		    (skip_master && (i == rte_get_master_lcore()))) {
-			i++;
-			if (wrap)
-				i %= RTE_MAX_LCORE;
-			continue;
-		}
-		break;
-	}
-	return i;
-}
 /**
  * Macro to browse all running lcores.
  */
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 6d7e0e4..d88649e 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -310,6 +310,16 @@ DPDK_19.08 {
 
 } DPDK_19.05;
 
+DPDK_19.11 {
+	global:
+
+	rte_get_master_lcore;
+	rte_get_next_lcore;
+	rte_lcore_count;
+	rte_lcore_is_enabled;
+
+} DPDK_19.08;
+
 EXPERIMENTAL {
 	global:
 
-- 
1.8.3.1


  parent reply	other threads:[~2019-10-25 13:57 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22  9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 1/8] eal: make lcore config private David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 2/8] eal: remove deprecated CPU flags check function David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 3/8] eal: remove deprecated malloc virt2phys function David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 4/8] mem: hide internal heap header David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 5/8] net/bonding: use non deprecated PCI API David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 6/8] pci: remove deprecated functions David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 7/8] log: add log stream accessor David Marchand
2019-10-22 16:34   ` Stephen Hemminger
2019-10-22 16:50     ` David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 8/8] log: hide internal log structure David Marchand
2019-10-22 16:35   ` Stephen Hemminger
2019-10-23 13:02   ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 01/12] eal: make lcore config private David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 02/12] eal: remove deprecated CPU flags check function David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 03/12] eal: remove deprecated malloc virt2phys function David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 04/12] mem: hide internal heap header David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 05/12] net/bonding: use non deprecated PCI API David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 06/12] pci: remove deprecated functions David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 07/12] log: add log stream accessor David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure David Marchand
2019-10-24 16:30     ` Thomas Monjalon
2019-10-25  9:19       ` Kevin Traynor
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 09/12] test/mem: remove dependency on EAL internals David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 10/12] eal: deinline lcore APIs David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 11/12] eal: factorize lcore role code in common code David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 12/12] eal: make the global configuration private David Marchand
2019-10-23 21:10   ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 Stephen Hemminger
2019-10-24  7:32     ` David Marchand
2019-10-24 15:37       ` Stephen Hemminger
2019-10-24 16:01         ` David Marchand
2019-10-24 16:37   ` Thomas Monjalon
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 01/12] eal: make lcore config private David Marchand
2019-10-25 15:18     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 02/12] eal: remove deprecated CPU flags check function David Marchand
2019-10-25 15:20     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 03/12] eal: remove deprecated malloc virt2phys function David Marchand
2019-10-25 15:22     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header David Marchand
2019-10-25 15:23     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 05/12] net/bonding: use non deprecated PCI API David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 06/12] pci: remove deprecated functions David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 07/12] log: add log stream accessor David Marchand
2019-10-25 19:05     ` Kevin Traynor
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 08/12] test/mem: remove dependency on EAL internals David Marchand
2019-10-25 15:24     ` Burakov, Anatoly
2019-10-25 13:56   ` David Marchand [this message]
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 10/12] eal: factorize lcore role code David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 11/12] eal: make the global configuration private David Marchand
2019-10-25 15:27     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI David Marchand
2019-10-25 15:30     ` Burakov, Anatoly
2019-10-25 15:33     ` Thomas Monjalon
2019-10-26 18:14     ` Kevin Traynor
2019-10-26 18:48       ` David Marchand
2019-10-26 19:18   ` [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11 David Marchand
2019-10-27  6:26     ` David Marchand
2019-10-27  9:56       ` David Marchand

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=1572011772-23271-10-git-send-email-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    --cc=stephen@networkplumber.org \
    --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).