From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: techboard@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: [RFC PATCH 09/44] eal: move runtime state to appropriate structure
Date: Wed, 29 Apr 2026 17:58:01 +0100 [thread overview]
Message-ID: <20260429165845.2136843-10-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260429165845.2136843-1-bruce.richardson@intel.com>
Remove the last of the fields from the internal config to the runtime
state structure, allowing us to remove the general internal_config
struct and it's reference function.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/eal/common/eal_common_config.c | 10 ----------
lib/eal/common/eal_common_mcfg.c | 5 ++---
lib/eal/common/eal_common_memzone.c | 4 +++-
lib/eal/common/eal_common_options.c | 19 ++++++++++---------
lib/eal/common/eal_common_proc.c | 6 +++---
lib/eal/common/eal_common_thread.c | 8 ++++----
lib/eal/common/eal_internal_cfg.h | 9 +--------
lib/eal/common/eal_options.h | 2 +-
lib/eal/common/eal_private.h | 9 ---------
lib/eal/freebsd/eal.c | 7 +++----
lib/eal/linux/eal.c | 7 +++----
11 files changed, 30 insertions(+), 56 deletions(-)
diff --git a/lib/eal/common/eal_common_config.c b/lib/eal/common/eal_common_config.c
index 50cba4fa1a..f1a5e84aa9 100644
--- a/lib/eal/common/eal_common_config.c
+++ b/lib/eal/common/eal_common_config.c
@@ -37,9 +37,6 @@ static struct eal_platform_info eal_platform_info;
/* internal runtime configuration */
static struct eal_runtime_state eal_runtime_state;
-/* internal configuration */
-static struct internal_config internal_config;
-
RTE_EXPORT_SYMBOL(rte_eal_get_runtime_dir)
const char *
rte_eal_get_runtime_dir(void)
@@ -66,13 +63,6 @@ rte_eal_get_configuration(void)
return &rte_config;
}
-/* Return a pointer to the internal configuration structure */
-struct internal_config *
-eal_get_internal_configuration(void)
-{
- return &internal_config;
-}
-
/* Return a pointer to the user configuration structure */
struct eal_user_cfg *
eal_get_user_configuration(void)
diff --git a/lib/eal/common/eal_common_mcfg.c b/lib/eal/common/eal_common_mcfg.c
index fddeae255e..497b0933c7 100644
--- a/lib/eal/common/eal_common_mcfg.c
+++ b/lib/eal/common/eal_common_mcfg.c
@@ -15,14 +15,13 @@ eal_mcfg_complete(void)
{
struct rte_config *cfg = rte_eal_get_configuration();
struct rte_mem_config *mcfg = cfg->mem_config;
- struct internal_config *internal_conf =
- eal_get_internal_configuration();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
/* ALL shared mem_config related INIT DONE */
if (cfg->process_type == RTE_PROC_PRIMARY)
mcfg->magic = RTE_MAGIC;
- internal_conf->init_complete = 1;
+ runtime_state->init_complete = 1;
}
void
diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
index db43af13a8..1207d524c9 100644
--- a/lib/eal/common/eal_common_memzone.c
+++ b/lib/eal/common/eal_common_memzone.c
@@ -20,6 +20,7 @@
#include "malloc_heap.h"
#include "malloc_elem.h"
+#include "eal_internal_cfg.h"
#include "eal_private.h"
#include "eal_memcfg.h"
@@ -30,9 +31,10 @@ RTE_EXPORT_SYMBOL(rte_memzone_max_set)
int
rte_memzone_max_set(size_t max)
{
+ const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
struct rte_mem_config *mcfg;
- if (eal_get_internal_configuration()->init_complete > 0) {
+ if (runtime_state->init_complete > 0) {
EAL_LOG(ERR, "Max memzone cannot be set after EAL init");
return -1;
}
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 0750a52373..2d6d4dc9bc 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -491,10 +491,11 @@ eal_get_hugefile_prefix(void)
}
void
-eal_reset_internal_config(struct internal_config *internal_cfg)
+eal_reset_internal_config(void)
{
struct eal_user_cfg *user_cfg = eal_get_user_configuration();
struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
int i;
user_cfg->memory = 0;
@@ -540,8 +541,8 @@ eal_reset_internal_config(struct internal_config *internal_cfg)
user_cfg->no_telemetry = false;
user_cfg->iova_mode = RTE_IOVA_DC;
user_cfg->user_mbuf_pool_ops_name = NULL;
- CPU_ZERO(&internal_cfg->ctrl_cpuset);
- internal_cfg->init_complete = 0;
+ CPU_ZERO(&runtime_state->ctrl_cpuset);
+ runtime_state->init_complete = 0;
user_cfg->max_simd_bitwidth.bitwidth = RTE_VECT_DEFAULT_SIMD_BITWIDTH;
user_cfg->max_simd_bitwidth.forced = 0;
}
@@ -1958,7 +1959,6 @@ eal_parse_huge_worker_stack(const char *arg)
int
eal_parse_args(void)
{
- struct internal_config *int_cfg = eal_get_internal_configuration();
struct eal_user_cfg *user_cfg = eal_get_user_configuration();
struct rte_config *rte_cfg = rte_eal_get_configuration();
bool remap_lcores = (args.remap_lcore_ids != NULL);
@@ -2307,7 +2307,7 @@ eal_parse_args(void)
}
#endif
- if (eal_adjust_config(int_cfg) != 0) {
+ if (eal_adjust_config() != 0) {
EAL_LOG(ERR, "Invalid configuration");
return -1;
}
@@ -2316,9 +2316,10 @@ eal_parse_args(void)
}
static void
-compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
+compute_ctrl_threads_cpuset(void)
{
- rte_cpuset_t *cpuset = &internal_cfg->ctrl_cpuset;
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
+ rte_cpuset_t *cpuset = &runtime_state->ctrl_cpuset;
rte_cpuset_t default_set;
unsigned int lcore_id;
@@ -2359,7 +2360,7 @@ eal_cleanup_config(const struct eal_user_cfg *user_cfg)
}
int
-eal_adjust_config(struct internal_config *internal_cfg)
+eal_adjust_config(void)
{
struct eal_user_cfg *user_cfg = eal_get_user_configuration();
int i;
@@ -2367,7 +2368,7 @@ eal_adjust_config(struct internal_config *internal_cfg)
if (user_cfg->process_type == RTE_PROC_AUTO)
user_cfg->process_type = eal_proc_type_detect();
- compute_ctrl_threads_cpuset(internal_cfg);
+ compute_ctrl_threads_cpuset();
/* if no memory amounts were requested, this will result in 0 and
* will be overridden later, right after eal_hugepage_info_init() */
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index 74f4f60b0a..dcf18ebf4c 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -343,8 +343,8 @@ process_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
struct action_entry *entry;
struct rte_mp_msg *msg = &m->msg;
rte_mp_t action = NULL;
- const struct internal_config *internal_conf =
- eal_get_internal_configuration();
+ const struct eal_runtime_state *runtime_state =
+ eal_get_runtime_state();
EAL_LOG(DEBUG, "msg: %s", msg->name);
@@ -382,7 +382,7 @@ process_msg(struct mp_msg_internal *m, struct sockaddr_un *s)
pthread_mutex_unlock(&mp_mutex_action);
if (!action) {
- if (m->type == MP_REQ && !internal_conf->init_complete) {
+ if (m->type == MP_REQ && !runtime_state->init_complete) {
/* if this is a request, and init is not yet complete,
* and callback wasn't registered, we should tell the
* requester to ignore our existence because we're not
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index dcd81f9e32..c2e7315bf4 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -234,9 +234,8 @@ struct control_thread_params {
static int control_thread_init(void *arg)
{
- struct internal_config *internal_conf =
- eal_get_internal_configuration();
- rte_cpuset_t *cpuset = &internal_conf->ctrl_cpuset;
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
+ rte_cpuset_t *cpuset = &runtime_state->ctrl_cpuset;
struct control_thread_params *params = arg;
__rte_thread_init(rte_lcore_id(), cpuset);
@@ -354,11 +353,12 @@ RTE_EXPORT_SYMBOL(rte_thread_register)
int
rte_thread_register(void)
{
+ const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
unsigned int lcore_id;
rte_cpuset_t cpuset;
/* EAL init flushes all lcores, we can't register before. */
- if (eal_get_internal_configuration()->init_complete != 1) {
+ if (runtime_state->init_complete != 1) {
EAL_LOG(DEBUG, "Called %s before EAL init.", __func__);
rte_errno = EINVAL;
return -1;
diff --git a/lib/eal/common/eal_internal_cfg.h b/lib/eal/common/eal_internal_cfg.h
index fbbe5dce82..9a898e676e 100644
--- a/lib/eal/common/eal_internal_cfg.h
+++ b/lib/eal/common/eal_internal_cfg.h
@@ -102,13 +102,6 @@ struct eal_platform_info {
* as appropriate.
*/
struct eal_runtime_state {
- uint8_t reserved;
-};
-
-/**
- * internal configuration
- */
-struct internal_config {
rte_cpuset_t ctrl_cpuset; /**< cpuset for ctrl threads */
volatile unsigned int init_complete;
/**< indicates whether EAL has completed initialization */
@@ -117,6 +110,6 @@ struct internal_config {
struct eal_user_cfg *eal_get_user_configuration(void);
struct eal_platform_info *eal_get_platform_info(void);
struct eal_runtime_state *eal_get_runtime_state(void);
-void eal_reset_internal_config(struct internal_config *internal_cfg);
+void eal_reset_internal_config(void);
#endif /* EAL_INTERNAL_CFG_H */
diff --git a/lib/eal/common/eal_options.h b/lib/eal/common/eal_options.h
index 5ad347b61d..a70c5b0c05 100644
--- a/lib/eal/common/eal_options.h
+++ b/lib/eal/common/eal_options.h
@@ -13,7 +13,7 @@ struct eal_user_cfg;
int eal_parse_log_options(void);
int eal_parse_args(void);
int eal_option_device_parse(void);
-int eal_adjust_config(struct internal_config *internal_cfg);
+int eal_adjust_config(void);
int eal_cleanup_config(const struct eal_user_cfg *user_cfg);
enum rte_proc_type_t eal_proc_type_detect(void);
int eal_plugins_init(void);
diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h
index e032dd10c9..d9807fb2fb 100644
--- a/lib/eal/common/eal_private.h
+++ b/lib/eal/common/eal_private.h
@@ -710,15 +710,6 @@ eal_mem_set_dump(void *virt, size_t size, bool dump);
int
eal_set_runtime_dir(const char *run_dir);
-/**
- * Get the internal configuration structure.
- *
- * @return
- * A pointer to the internal configuration structure.
- */
-struct internal_config *
-eal_get_internal_configuration(void);
-
/**
* Get the current value of the rte_application_usage pointer
*
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 996a2de9ff..f41a700125 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -407,9 +407,8 @@ rte_eal_init(int argc, char **argv)
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
char thread_name[RTE_THREAD_NAME_SIZE];
const struct rte_config *config = rte_eal_get_configuration();
- struct internal_config *internal_conf =
- eal_get_internal_configuration();
struct eal_user_cfg *user_cfg = eal_get_user_configuration();
+ const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
bool has_phys_addr;
enum rte_iova_mode iova_mode;
@@ -454,7 +453,7 @@ rte_eal_init(int argc, char **argv)
goto err_out;
}
- eal_reset_internal_config(internal_conf);
+ eal_reset_internal_config();
if (rte_eal_cpu_init() < 0) {
rte_eal_init_alert("Cannot detect lcores.");
@@ -745,7 +744,7 @@ rte_eal_init(int argc, char **argv)
if (rte_eal_process_type() == RTE_PROC_PRIMARY && !user_cfg->no_telemetry) {
if (rte_telemetry_init(rte_eal_get_runtime_dir(),
rte_version(),
- &internal_conf->ctrl_cpuset) != 0)
+ &runtime_state->ctrl_cpuset) != 0)
goto err_out;
}
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index f692521fe7..ffe930155a 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -569,9 +569,8 @@ rte_eal_init(int argc, char **argv)
char thread_name[RTE_THREAD_NAME_SIZE];
bool phys_addrs;
const struct rte_config *config = rte_eal_get_configuration();
- struct internal_config *internal_conf =
- eal_get_internal_configuration();
struct eal_user_cfg *user_cfg = eal_get_user_configuration();
+ const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
/* first check if we have been run before */
if (!rte_atomic_compare_exchange_strong_explicit(&run_once, &has_run, 1,
@@ -614,7 +613,7 @@ rte_eal_init(int argc, char **argv)
goto err_out;
}
- eal_reset_internal_config(internal_conf);
+ eal_reset_internal_config();
if (rte_eal_cpu_init() < 0) {
rte_eal_init_alert("Cannot detect lcores.");
@@ -918,7 +917,7 @@ rte_eal_init(int argc, char **argv)
if (rte_eal_process_type() == RTE_PROC_PRIMARY && !user_cfg->no_telemetry) {
if (rte_telemetry_init(rte_eal_get_runtime_dir(),
rte_version(),
- &internal_conf->ctrl_cpuset) != 0)
+ &runtime_state->ctrl_cpuset) != 0)
goto err_out;
}
--
2.51.0
next prev parent reply other threads:[~2026-04-29 17:00 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 16:57 [RFC PATCH 00/44] Allow intitializing EAL without argc/argv Bruce Richardson
2026-04-29 16:57 ` [RFC PATCH 01/44] eal: define new functionally distinct config structs Bruce Richardson
2026-04-29 19:03 ` Stephen Hemminger
2026-04-30 7:56 ` Bruce Richardson
2026-04-29 16:57 ` [RFC PATCH 02/44] eal: move memory request fields to user config Bruce Richardson
2026-04-29 16:57 ` [RFC PATCH 03/44] eal: move NUMA " Bruce Richardson
2026-04-29 16:57 ` [RFC PATCH 04/44] eal: move hugepage policy " Bruce Richardson
2026-04-29 16:57 ` [RFC PATCH 05/44] eal: move process " Bruce Richardson
2026-04-29 16:57 ` [RFC PATCH 06/44] eal: move advanced user config options to user cfg struct Bruce Richardson
2026-04-29 16:57 ` [RFC PATCH 07/44] eal: move hugepage size info to platform info struct Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 08/44] telemetry: make cpuset init parameter const Bruce Richardson
2026-04-29 16:58 ` Bruce Richardson [this message]
2026-04-29 16:58 ` [RFC PATCH 10/44] eal: record details of all cpus in platform info Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 11/44] eal: use platform info for lcore lookups Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 12/44] eal: add RTE_CPU_FFS macro Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 13/44] eal: store lcore configuration in runtime data Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 14/44] eal: cleanup CPU init function Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 15/44] eal: move numa node information to platform info struct Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 16/44] eal: move lcore role and count to runtime state Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 17/44] eal: make lcore role a field in lcore config struct Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 18/44] eal: move main lcore setting to runtime " Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 19/44] eal: move iova mode and process type to runtime cfg Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 20/44] eal: move memory config pointer to runtime state struct Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 21/44] eal: remove rte_config structure Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 22/44] eal: separate runtime state update from arg parsing Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 23/44] eal: move devopt_list staging list into user_cfg Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 24/44] eal: separate plugin paths from loaded plugin objects Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 25/44] eal: simplify internal driver path iteration APIs Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 26/44] eal: move trace config into user config struct Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 27/44] eal: record service cores in " Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 28/44] eal: store user-provided lcore info " Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 29/44] eal: clarify docs on params taking lcore IDs Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 30/44] eal: remove internal config reset function Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 31/44] eal: move functions setting runtime state Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 32/44] eal: initialize platform info on first use Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 33/44] eal: remove duplicated scan of sysfs for hugepage details Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 34/44] eal: add utilities for working with user config struct Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 35/44] eal: split EAL init into two stages Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 36/44] eal: provide hooks for init with externally supplied config Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 37/44] eal_cfg: add new library to programmatically init DPDK Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 38/44] eal_cfg: configure defaults for easier testing and use Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 39/44] app/test: enable testing init using EAL config lib Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 40/44] eal_cfg: add basic setters and getters Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 41/44] eal_cfg: add hugepage memory configuration Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 42/44] eal_cfg: support configuring lcores Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 43/44] eal_cfg: support device and driver lists Bruce Richardson
2026-04-29 16:58 ` [RFC PATCH 44/44] eal_cfg: add APIs for configuring remaining init settings Bruce Richardson
2026-04-29 21:40 ` [RFC PATCH 00/44] Allow intitializing EAL without argc/argv Stephen Hemminger
2026-04-29 22:04 ` Stephen Hemminger
2026-04-30 8:00 ` Bruce Richardson
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=20260429165845.2136843-10-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=techboard@dpdk.org \
/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