From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v3 35/39] eal: initialize platform info on first use
Date: Thu, 26 Nov 2026 18:14:08 +0000 [thread overview]
Message-ID: <20261126181414.124094-36-bruce.richardson@intel.com> (raw)
In-Reply-To: <20261126181414.124094-1-bruce.richardson@intel.com>
The platform information should be made available as early in the init
process as possible, since it should be fixed and not depend on any
application or user provided data. Therefore, rework the hugepage info
so that the basic HP info only is stored in the platform info struct,
and things like lock fd's are found in the runtime state struct.
Then start enhancing the get_platform_info structure so that it is
initialized on first use, rather than having it initialized as part of
the normal flow of rte_eal_init(). The objective is to have the platform
info, both cpu and memory, fully available when processing the user
configuration parameters, in order to properly validate them. Note that
this may defer some error conditions to later, because hugepage scanning
failures, for example, need not be an error when scanning the platform
info, if we later discover the app is being run with --no-huge flag.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/eal/common/eal_common_config.c | 50 +++++++++---
lib/eal/common/eal_common_dynmem.c | 27 ++++---
lib/eal/common/eal_common_lcore.c | 13 +++-
lib/eal/common/eal_hugepages.h | 8 ++
lib/eal/common/eal_internal_cfg.h | 15 +++-
lib/eal/common/eal_private.h | 18 ++++-
lib/eal/freebsd/eal.c | 23 ++++--
lib/eal/freebsd/eal_hugepage_info.c | 60 ++++++++++----
lib/eal/freebsd/eal_memory.c | 15 ++--
lib/eal/linux/eal.c | 28 ++++---
lib/eal/linux/eal_hugepage_info.c | 117 ++++++++++++++++++++++++----
lib/eal/linux/eal_memalloc.c | 24 +++---
lib/eal/linux/eal_memory.c | 59 +++++++-------
lib/eal/windows/eal.c | 24 +++---
lib/eal/windows/eal_hugepages.c | 35 ++++++++-
lib/eal/windows/eal_memalloc.c | 11 +--
lib/eal/windows/eal_windows.h | 8 --
17 files changed, 377 insertions(+), 158 deletions(-)
diff --git a/lib/eal/common/eal_common_config.c b/lib/eal/common/eal_common_config.c
index 2eb7646e90..110921ae93 100644
--- a/lib/eal/common/eal_common_config.c
+++ b/lib/eal/common/eal_common_config.c
@@ -10,6 +10,7 @@
#include "eal_internal_cfg.h"
#include "eal_private.h"
#include "eal_filesystem.h"
+#include "eal_hugepages.h"
#include "eal_memcfg.h"
/* early configuration structure, when memory config is not mmapped */
@@ -28,15 +29,6 @@ static char runtime_dir[UNIX_PATH_MAX];
/* user-provided EAL configuration */
static struct eal_user_cfg eal_user_cfg;
-/* platform-discovered and runtime EAL state */
-static struct eal_platform_info eal_platform_info = {
- .hugepage_info = {
- [0] = {.lock_descriptor = -1 },
- [1] = {.lock_descriptor = -1 },
- [2] = {.lock_descriptor = -1 }
- }
-};
-
/* internal runtime configuration */
static struct eal_runtime_state eal_runtime_state = {
.mem_config = &early_mem_config,
@@ -76,9 +68,42 @@ eal_get_user_configuration(void)
}
/* Return a pointer to the platform state structure */
-struct eal_platform_info *
+const struct eal_platform_info *
eal_get_platform_info(void)
{
+ /* platform-discovered and runtime EAL state */
+ static struct eal_platform_info eal_platform_info;
+ static rte_spinlock_t init_lock = RTE_SPINLOCK_INITIALIZER;
+ static RTE_ATOMIC(bool) initialized;
+
+ if (unlikely(!rte_atomic_load_explicit(&initialized, rte_memory_order_acquire))) {
+ struct eal_platform_info discovered_info = { 0 };
+
+ rte_spinlock_lock(&init_lock);
+ if (rte_atomic_load_explicit(&initialized, rte_memory_order_relaxed)) {
+ rte_spinlock_unlock(&init_lock);
+ return &eal_platform_info;
+ }
+ if (rte_eal_cpu_init(&discovered_info) < 0) {
+ EAL_LOG(ERR, "Failed to initialise CPU information");
+ goto fail;
+ }
+ if (eal_get_platform_hp_info(&discovered_info) < 0) {
+ EAL_LOG(ERR, "Failed to get platform hugepage information");
+ goto fail;
+ }
+ eal_platform_info = discovered_info;
+ rte_atomic_store_explicit(&initialized, true, rte_memory_order_release);
+ rte_spinlock_unlock(&init_lock);
+ return &eal_platform_info;
+
+fail:
+ free(discovered_info.cpu_info);
+ free(discovered_info.numa_nodes);
+ rte_spinlock_unlock(&init_lock);
+ return NULL;
+ }
+
return &eal_platform_info;
}
@@ -212,6 +237,9 @@ eal_apply_runtime_state(void)
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
struct eal_runtime_state *runtime_state = eal_get_runtime_state();
+ for (unsigned int i = 0; i < MAX_HUGEPAGE_SIZES; i++)
+ runtime_state->hugepage_info[i].lock_descriptor = -1;
+
if (eal_apply_lcore_config() < 0)
return -1;
@@ -283,7 +311,7 @@ eal_apply_hugepage_mem_sz_limits(void)
for (i = 0; i < platform_info->num_hugepage_sizes; i++) {
unsigned int j;
- const uint64_t pagesz = platform_info->hugepage_info[i].hugepage_sz;
+ const uint64_t pagesz = platform_info->hugepage_sizes[i].size;
uint64_t limit;
/* assign default limits */
diff --git a/lib/eal/common/eal_common_dynmem.c b/lib/eal/common/eal_common_dynmem.c
index f9b275dbeb..229cd8201e 100644
--- a/lib/eal/common/eal_common_dynmem.c
+++ b/lib/eal/common/eal_common_dynmem.c
@@ -34,7 +34,6 @@ eal_dynmem_memseg_lists_init(void)
size_t mem_va_len, mem_va_page_sz;
unsigned int n_memtypes, cur_type;
void *mem_va_addr = NULL;
- struct eal_platform_info *platform_info = eal_get_platform_info();
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
@@ -58,7 +57,7 @@ eal_dynmem_memseg_lists_init(void)
*/
/* maximum number of memtypes we're ever going to get */
- n_memtypes = platform_info->num_hugepage_sizes * rte_socket_count();
+ n_memtypes = runtime_state->num_hugepage_sizes * rte_socket_count();
/* can we fit all memtypes into the memseg lists? */
if (n_memtypes > RTE_MAX_MEMSEG_LISTS) {
@@ -69,12 +68,12 @@ eal_dynmem_memseg_lists_init(void)
/* populate mem types */
cur_type = 0;
- for (hpi_idx = 0; hpi_idx < (int) platform_info->num_hugepage_sizes;
+ for (hpi_idx = 0; hpi_idx < (int) runtime_state->num_hugepage_sizes;
hpi_idx++) {
- struct hugepage_info *hpi;
+ const struct hugepage_info *hpi;
uint64_t hugepage_sz;
- hpi = &platform_info->hugepage_info[hpi_idx];
+ hpi = &runtime_state->hugepage_info[hpi_idx];
hugepage_sz = hpi->hugepage_sz;
for (i = 0; i < (int) rte_socket_count(); i++, cur_type++) {
@@ -231,13 +230,13 @@ eal_dynmem_hugepage_init(void)
struct hugepage_info used_hp[MAX_HUGEPAGE_SIZES];
uint64_t memory[RTE_MAX_NUMA_NODES];
int hp_sz_idx, socket_id;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
memset(used_hp, 0, sizeof(used_hp));
for (hp_sz_idx = 0;
- hp_sz_idx < (int) platform_info->num_hugepage_sizes;
+ hp_sz_idx < (int) runtime_state->num_hugepage_sizes;
hp_sz_idx++) {
#ifndef RTE_ARCH_64
struct hugepage_info dummy;
@@ -245,7 +244,7 @@ eal_dynmem_hugepage_init(void)
#endif
/* also initialize used_hp hugepage sizes in used_hp */
struct hugepage_info *hpi;
- hpi = &platform_info->hugepage_info[hp_sz_idx];
+ hpi = &runtime_state->hugepage_info[hp_sz_idx];
used_hp[hp_sz_idx].hugepage_sz = hpi->hugepage_sz;
#ifndef RTE_ARCH_64
@@ -273,12 +272,12 @@ eal_dynmem_hugepage_init(void)
/* calculate final number of pages */
if (eal_dynmem_calc_num_pages_per_socket(memory,
- platform_info->hugepage_info, used_hp,
- platform_info->num_hugepage_sizes) < 0)
+ runtime_state->hugepage_info, used_hp,
+ runtime_state->num_hugepage_sizes) < 0)
return -1;
for (hp_sz_idx = 0;
- hp_sz_idx < (int)platform_info->num_hugepage_sizes;
+ hp_sz_idx < (int)runtime_state->num_hugepage_sizes;
hp_sz_idx++) {
for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES;
socket_id++) {
@@ -357,10 +356,10 @@ get_socket_mem_size(int socket)
{
uint64_t size = 0;
unsigned int i;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
- for (i = 0; i < platform_info->num_hugepage_sizes; i++) {
- struct hugepage_info *hpi = &platform_info->hugepage_info[i];
+ for (i = 0; i < runtime_state->num_hugepage_sizes; i++) {
+ struct hugepage_info *hpi = &runtime_state->hugepage_info[i];
size += hpi->hugepage_sz * hpi->num_pages[socket];
}
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index de603b2ff3..842230e729 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -175,12 +175,16 @@ socket_id_cmp(const void *a, const void *b)
* structure.
*/
int
-rte_eal_cpu_init(void)
+rte_eal_cpu_init(struct eal_platform_info *platform_info)
{
- struct eal_platform_info *platform_info = eal_get_platform_info();
int *lcore_to_socket_id;
size_t nb_detected_cpus = 0;
+ if (eal_create_cpu_map() < 0) {
+ EAL_LOG(ERR, "Failed to create CPU map");
+ return -1;
+ }
+
/* allocate cpu_info for all CPUs visible to the OS */
platform_info->cpu_count = eal_cpu_max();
platform_info->cpu_info = calloc(platform_info->cpu_count,
@@ -193,6 +197,7 @@ rte_eal_cpu_init(void)
if (lcore_to_socket_id == NULL) {
EAL_LOG(ERR, "Cannot allocate lcore_to_socket_id array");
free(platform_info->cpu_info);
+ platform_info->cpu_info = NULL;
return -1;
}
@@ -214,8 +219,9 @@ rte_eal_cpu_init(void)
if (nb_detected_cpus == 0) {
EAL_LOG(ERR, "No CPUs detected for platform topology");
- free(platform_info->cpu_info);
free(lcore_to_socket_id);
+ free(platform_info->cpu_info);
+ platform_info->cpu_info = NULL;
return -1;
}
@@ -230,6 +236,7 @@ rte_eal_cpu_init(void)
EAL_LOG(ERR, "Cannot allocate numa_nodes array");
free(lcore_to_socket_id);
free(platform_info->cpu_info);
+ platform_info->cpu_info = NULL;
return -1;
}
diff --git a/lib/eal/common/eal_hugepages.h b/lib/eal/common/eal_hugepages.h
index 1b560d3379..b30ff12f2d 100644
--- a/lib/eal/common/eal_hugepages.h
+++ b/lib/eal/common/eal_hugepages.h
@@ -11,6 +11,8 @@
#define MAX_HUGEPAGE_PATH PATH_MAX
+struct eal_platform_info;
+
/**
* Structure used to store information about hugepages that we mapped
* through the files in hugetlbfs.
@@ -25,6 +27,12 @@ struct hugepage_file {
char filepath[MAX_HUGEPAGE_PATH]; /**< path to backing file on filesystem */
};
+/**
+ * Discover hugepage sizes and mounts available on this platform and populate
+ * the hugepage_sizes[] fields of the provided platform_info struct.
+ */
+int eal_get_platform_hp_info(struct eal_platform_info *platform_info);
+
/**
* Read the information on what hugepages are available for the EAL to use,
* clearing out any unused ones.
diff --git a/lib/eal/common/eal_internal_cfg.h b/lib/eal/common/eal_internal_cfg.h
index d101a60413..7d23568d7b 100644
--- a/lib/eal/common/eal_internal_cfg.h
+++ b/lib/eal/common/eal_internal_cfg.h
@@ -164,6 +164,14 @@ struct eal_cpu_info {
unsigned int core_id; /**< physical core number on its NUMA node */
};
+struct hp_sizes {
+ uint64_t size; /**< hugepage size in bytes */
+ char dir[PATH_MAX]; /**< dir where hugetlbfs is mounted for this size */
+ uint32_t total_pages; /**< total hugepages of this size across all NUMA nodes */
+ uint32_t max_pages[RTE_MAX_NUMA_NODES];
+ /**< maximum hugepages of this size available on each NUMA node */
+};
+
/**
* Discovered information about the system hardware.
* Immutable after discovery.
@@ -174,7 +182,7 @@ struct eal_platform_info {
uint32_t numa_node_count; /**< number of detected NUMA nodes */
uint32_t *numa_nodes; /**< sorted list of detected NUMA node IDs */
uint8_t num_hugepage_sizes; /**< how many sizes on this system */
- struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES];
+ struct hp_sizes hugepage_sizes[MAX_HUGEPAGE_SIZES];
};
/**
@@ -222,12 +230,15 @@ struct eal_runtime_state {
uint32_t lcore_count; /**< Number of active lcore IDs (role != ROLE_OFF). */
struct lcore_cfg lcore_cfg[RTE_MAX_LCORE];
RTE_BITSET_DECLARE(core_indices, RTE_MAX_LCORE); /**< currently allocated core_indices */
+
+ uint32_t num_hugepage_sizes; /**< how many sizes stored in hugepage_info[] */
+ struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES];
struct rte_mem_config *mem_config; /**< pointer to memory config (in shared memory) */
struct eal_solib_list loaded_plugins; /**< all plugins loaded by eal_plugins_init() */
};
+const struct eal_platform_info *eal_get_platform_info(void);
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);
#endif /* EAL_INTERNAL_CFG_H */
diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h
index edda0289fa..7de94cc300 100644
--- a/lib/eal/common/eal_private.h
+++ b/lib/eal/common/eal_private.h
@@ -95,10 +95,12 @@ int rte_eal_memzone_init(void);
* Parse /proc/cpuinfo to get the number of physical and logical
* processors on the machine.
*
+ * @param platform_info
+ * Platform info struct to populate with CPU topology.
* @return
* 0 on success, negative on error
*/
-int rte_eal_cpu_init(void);
+int rte_eal_cpu_init(struct eal_platform_info *platform_info);
/**
* Check for architecture supported MMU.
@@ -753,6 +755,20 @@ int eal_asprintf(char **buffer, const char *format, ...);
eal_asprintf(buffer, format, ##__VA_ARGS__)
#endif
+/**
+ * Create a map of processors and cores on the system.
+ *
+ * @return
+ * 0 on success, (-1) on failure and rte_errno is set.
+ */
+#ifdef RTE_EXEC_ENV_WINDOWS
+int eal_create_cpu_map(void);
+#else
+/* non-Windows platforms do not require CPU map creation, define stub fn */
+static inline int
+eal_create_cpu_map(void) { return 0; }
+#endif
+
#define EAL_LOG(level, ...) \
RTE_LOG_LINE(level, EAL, "" __VA_ARGS__)
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 47efe2f4b4..e4a69e4edf 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -321,10 +321,11 @@ eal_get_hugepage_mem_size(void)
{
uint64_t size = 0;
unsigned i, j;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ const struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
for (i = 0; i < platform_info->num_hugepage_sizes; i++) {
- struct hugepage_info *hpi = &platform_info->hugepage_info[i];
+ struct hugepage_info *hpi = &runtime_state->hugepage_info[i];
if (strnlen(hpi->hugedir, sizeof(hpi->hugedir)) != 0) {
for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
size += hpi->hugepage_sz * hpi->num_pages[j];
@@ -402,6 +403,18 @@ rte_eal_init(int argc, char **argv)
bool has_phys_addr;
enum rte_iova_mode iova_mode;
+ /*
+ * platform_info is lazily initialized on first use, and that
+ * initialization can fail (CPU/NUMA/hugepage detection). Almost
+ * everything below depends on a valid platform_info, so confirm it
+ * is available before doing anything else.
+ */
+ if (eal_get_platform_info() == NULL) {
+ rte_eal_init_alert("Cannot get platform information.");
+ rte_errno = ENOTSUP;
+ return -1;
+ }
+
/* first check if we have been run before */
if (!rte_atomic_compare_exchange_strong_explicit(&run_once, &has_run, 1,
rte_memory_order_relaxed, rte_memory_order_relaxed)) {
@@ -443,12 +456,6 @@ rte_eal_init(int argc, char **argv)
goto err_out;
}
- if (rte_eal_cpu_init() < 0) {
- rte_eal_init_alert("Cannot detect lcores.");
- rte_errno = ENOTSUP;
- goto err_out;
- }
-
if (eal_parse_args() < 0) {
rte_eal_init_alert("Error parsing command-line arguments.");
rte_errno = EINVAL;
diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c
index b4859f9bb0..2b731f2b3c 100644
--- a/lib/eal/freebsd/eal_hugepage_info.c
+++ b/lib/eal/freebsd/eal_hugepage_info.c
@@ -51,22 +51,53 @@ create_shared_memory(const char *filename, const size_t mem_size)
/*
* No hugepage support on freebsd, but we dummy it, using contigmem driver
*/
+int
+eal_get_platform_hp_info(struct eal_platform_info *platform_info)
+{
+ size_t sysctl_size;
+ int num_buffers, error;
+ int64_t buffer_size;
+
+ sysctl_size = sizeof(num_buffers);
+ error = sysctlbyname("hw.contigmem.num_buffers", &num_buffers,
+ &sysctl_size, NULL, 0);
+ if (error != 0) {
+ EAL_LOG(ERR, "could not read sysctl hw.contigmem.num_buffers");
+ return -1;
+ }
+
+ sysctl_size = sizeof(buffer_size);
+ error = sysctlbyname("hw.contigmem.buffer_size", &buffer_size,
+ &sysctl_size, NULL, 0);
+ if (error != 0) {
+ EAL_LOG(ERR, "could not read sysctl hw.contigmem.buffer_size");
+ return -1;
+ }
+
+ platform_info->num_hugepage_sizes = 1;
+ platform_info->hugepage_sizes[0].size = buffer_size;
+ strlcpy(platform_info->hugepage_sizes[0].dir, CONTIGMEM_DEV,
+ sizeof(platform_info->hugepage_sizes[0].dir));
+ platform_info->hugepage_sizes[0].max_pages[0] = num_buffers;
+ platform_info->hugepage_sizes[0].total_pages = num_buffers;
+
+ return 0;
+}
+
int
eal_hugepage_info_init(void)
{
size_t sysctl_size;
int num_buffers, fd, error;
int64_t buffer_size = 0;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
/* re-use the linux "internal config" structure for our memory data */
- struct hugepage_info *hpi = &platform_info->hugepage_info[0];
+ struct hugepage_info *hpi = &runtime_state->hugepage_info[0];
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
struct hugepage_info *tmp_hpi;
unsigned int i;
- platform_info->num_hugepage_sizes = 1;
-
sysctl_size = sizeof(num_buffers);
error = sysctlbyname("hw.contigmem.num_buffers", &num_buffers,
&sysctl_size, NULL, 0);
@@ -114,29 +145,30 @@ eal_hugepage_info_init(void)
hpi->hugepage_sz = buffer_size;
hpi->num_pages[0] = num_buffers;
hpi->lock_descriptor = fd;
+ runtime_state->num_hugepage_sizes = 1;
/* for no shared files mode, do not create shared memory config */
if (user_cfg->no_shconf)
return 0;
tmp_hpi = create_shared_memory(eal_hugepage_info_path(),
- sizeof(platform_info->hugepage_info));
+ sizeof(runtime_state->hugepage_info));
if (tmp_hpi == NULL ) {
EAL_LOG(ERR, "Failed to create shared memory!");
return -1;
}
- memcpy(tmp_hpi, hpi, sizeof(platform_info->hugepage_info));
+ memcpy(tmp_hpi, hpi, sizeof(runtime_state->hugepage_info));
/* we've copied file descriptors along with everything else, but they
* will be invalid in secondary process, so overwrite them
*/
- for (i = 0; i < RTE_DIM(platform_info->hugepage_info); i++) {
+ for (i = 0; i < RTE_DIM(runtime_state->hugepage_info); i++) {
struct hugepage_info *tmp = &tmp_hpi[i];
tmp->lock_descriptor = -1;
}
- if (munmap(tmp_hpi, sizeof(platform_info->hugepage_info)) < 0) {
+ if (munmap(tmp_hpi, sizeof(runtime_state->hugepage_info)) < 0) {
EAL_LOG(ERR, "Failed to unmap shared memory!");
return -1;
}
@@ -148,23 +180,23 @@ eal_hugepage_info_init(void)
int
eal_hugepage_info_read(void)
{
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
- struct hugepage_info *hpi = &platform_info->hugepage_info[0];
+ struct hugepage_info *hpi = &runtime_state->hugepage_info[0];
struct hugepage_info *tmp_hpi;
- platform_info->num_hugepage_sizes = 1;
+ runtime_state->num_hugepage_sizes = 1;
tmp_hpi = open_shared_memory(eal_hugepage_info_path(),
- sizeof(platform_info->hugepage_info));
+ sizeof(runtime_state->hugepage_info));
if (tmp_hpi == NULL) {
EAL_LOG(ERR, "Failed to open shared memory!");
return -1;
}
- memcpy(hpi, tmp_hpi, sizeof(platform_info->hugepage_info));
+ memcpy(hpi, tmp_hpi, sizeof(runtime_state->hugepage_info));
- if (munmap(tmp_hpi, sizeof(platform_info->hugepage_info)) < 0) {
+ if (munmap(tmp_hpi, sizeof(runtime_state->hugepage_info)) < 0) {
EAL_LOG(ERR, "Failed to unmap shared memory!");
return -1;
}
diff --git a/lib/eal/freebsd/eal_memory.c b/lib/eal/freebsd/eal_memory.c
index 2466987e03..b8d23a1dc8 100644
--- a/lib/eal/freebsd/eal_memory.c
+++ b/lib/eal/freebsd/eal_memory.c
@@ -72,7 +72,8 @@ rte_eal_hugepage_init(void)
void *addr;
unsigned int i, j, seg_idx = 0;
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ const struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
/* get pointer to global configuration */
mcfg = eal_get_mcfg();
@@ -118,7 +119,7 @@ rte_eal_hugepage_init(void)
uint64_t page_sz, mem_needed;
unsigned int n_pages, max_pages;
- hpi = &platform_info->hugepage_info[i];
+ hpi = &runtime_state->hugepage_info[i];
page_sz = hpi->hugepage_sz;
max_pages = hpi->num_pages[0];
mem_needed = RTE_ALIGN_CEIL(user_cfg->memory - total_mem,
@@ -288,12 +289,13 @@ attach_segment(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
int
rte_eal_hugepage_attach(void)
{
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ const struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
struct hugepage_info *hpi;
int fd_hugepage = -1;
unsigned int i;
- hpi = &platform_info->hugepage_info[0];
+ hpi = &runtime_state->hugepage_info[0];
for (i = 0; i < platform_info->num_hugepage_sizes; i++) {
const struct hugepage_info *cur_hpi = &hpi[i];
@@ -356,7 +358,8 @@ memseg_primary_init(void)
int hpi_idx, msl_idx = 0;
struct rte_memseg_list *msl;
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ const struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
/* no-huge does not need this at all */
if (user_cfg->no_hugetlbfs)
@@ -375,7 +378,7 @@ memseg_primary_init(void)
uint64_t hugepage_sz;
unsigned int n_segs;
- hpi = &platform_info->hugepage_info[hpi_idx];
+ hpi = &runtime_state->hugepage_info[hpi_idx];
hugepage_sz = hpi->hugepage_sz;
/* no NUMA support on FreeBSD */
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 03e26584d6..6824e0f06b 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -403,18 +403,18 @@ eal_mem_config_init(void)
static void
eal_hugedirs_unlock(void)
{
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
int i;
for (i = 0; i < MAX_HUGEPAGE_SIZES; i++)
{
/* skip uninitialized */
- if (platform_info->hugepage_info[i].lock_descriptor < 0)
+ if (runtime_state->hugepage_info[i].lock_descriptor < 0)
continue;
/* unlock hugepage file */
- flock(platform_info->hugepage_info[i].lock_descriptor, LOCK_UN);
- close(platform_info->hugepage_info[i].lock_descriptor);
+ flock(runtime_state->hugepage_info[i].lock_descriptor, LOCK_UN);
+ close(runtime_state->hugepage_info[i].lock_descriptor);
/* reset the field */
- platform_info->hugepage_info[i].lock_descriptor = -1;
+ runtime_state->hugepage_info[i].lock_descriptor = -1;
}
}
@@ -562,6 +562,18 @@ rte_eal_init(int argc, char **argv)
struct eal_user_cfg *user_cfg = eal_get_user_configuration();
struct eal_runtime_state *runtime_state = eal_get_runtime_state();
+ /*
+ * platform_info is lazily initialized on first use, and that
+ * initialization can fail (CPU/NUMA/hugepage detection). Almost
+ * everything below depends on a valid platform_info, so confirm it
+ * is available before doing anything else.
+ */
+ if (eal_get_platform_info() == NULL) {
+ rte_eal_init_alert("Cannot get platform information.");
+ rte_errno = ENOTSUP;
+ return -1;
+ }
+
/* first check if we have been run before */
if (!rte_atomic_compare_exchange_strong_explicit(&run_once, &has_run, 1,
rte_memory_order_relaxed, rte_memory_order_relaxed)) {
@@ -603,12 +615,6 @@ rte_eal_init(int argc, char **argv)
goto err_out;
}
- if (rte_eal_cpu_init() < 0) {
- rte_eal_init_alert("Cannot detect lcores.");
- rte_errno = ENOTSUP;
- goto err_out;
- }
-
if (eal_parse_args() < 0) {
rte_eal_init_alert("Error parsing command line arguments.");
rte_errno = EINVAL;
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index f35446cdc9..bbea6959d5 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -395,6 +395,82 @@ compare_hpi(const void *a, const void *b)
return hpi_b->hugepage_sz - hpi_a->hugepage_sz;
}
+static int
+compare_hp_sizes(const void *a, const void *b)
+{
+ const struct hp_sizes *ha = a;
+ const struct hp_sizes *hb = b;
+
+ if (hb->size > ha->size)
+ return 1;
+ if (hb->size < ha->size)
+ return -1;
+ return 0;
+}
+
+int
+eal_get_platform_hp_info(struct eal_platform_info *platform_info)
+{
+ static const char dirent_start_text[] = "hugepages-";
+ const size_t dirent_start_len = sizeof(dirent_start_text) - 1;
+ unsigned int num_sizes = 0;
+ DIR *dir;
+ struct dirent *dirent;
+
+ dir = opendir(sys_dir_path);
+ if (dir == NULL) {
+ /* if we are using no-huge, unavailabiltity of hugepages may not be a problem,
+ * so just log a warning and return 0 hugepage sizes.
+ */
+ EAL_LOG(WARNING, "Cannot open directory %s to read system hugepage info",
+ sys_dir_path);
+ return 0;
+ }
+
+ for (dirent = readdir(dir); dirent != NULL; dirent = readdir(dir)) {
+ struct hp_sizes *hps;
+ uint64_t sz;
+ unsigned int i;
+
+ if (strncmp(dirent->d_name, dirent_start_text,
+ dirent_start_len) != 0)
+ continue;
+
+ if (num_sizes >= MAX_HUGEPAGE_SIZES)
+ break;
+
+ sz = rte_str_to_size(&dirent->d_name[dirent_start_len]);
+ hps = &platform_info->hugepage_sizes[num_sizes];
+ hps->size = sz;
+
+ /* fill per-socket page counts; fall back to socket 0 total */
+ hps->total_pages = 0;
+ for (i = 0; i < platform_info->numa_node_count; i++) {
+ int socket = (int)platform_info->numa_nodes[i];
+ hps->max_pages[socket] = get_num_hugepages_on_node(dirent->d_name,
+ socket, sz);
+ hps->total_pages += hps->max_pages[socket];
+ }
+ if (hps->total_pages == 0) {
+ hps->max_pages[0] = get_num_hugepages(dirent->d_name, sz, 0);
+ hps->total_pages = hps->max_pages[0];
+ }
+
+ if (get_hugepage_dir(sz, hps->dir, sizeof(hps->dir)) < 0)
+ hps->dir[0] = '\0';
+
+ num_sizes++;
+ }
+ closedir(dir);
+
+ /* sort largest to smallest, matching hugepage_info ordering */
+ qsort(&platform_info->hugepage_sizes[0], num_sizes,
+ sizeof(platform_info->hugepage_sizes[0]), compare_hp_sizes);
+
+ platform_info->num_hugepage_sizes = num_sizes;
+ return 0;
+}
+
static void
calc_num_pages(struct hugepage_info *hpi, struct dirent *dirent,
unsigned int reusable_pages)
@@ -453,7 +529,7 @@ hugepage_info_init(void)
unsigned int reusable_pages;
DIR *dir;
struct dirent *dirent;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
dir = opendir(sys_dir_path);
@@ -474,7 +550,7 @@ hugepage_info_init(void)
if (num_sizes >= MAX_HUGEPAGE_SIZES)
break;
- hpi = &platform_info->hugepage_info[num_sizes];
+ hpi = &runtime_state->hugepage_info[num_sizes];
hpi->hugepage_sz =
rte_str_to_size(&dirent->d_name[dirent_start_len]);
@@ -545,17 +621,17 @@ hugepage_info_init(void)
if (dirent != NULL)
return -1;
- platform_info->num_hugepage_sizes = num_sizes;
+ runtime_state->num_hugepage_sizes = num_sizes;
/* sort the page directory entries by size, largest to smallest */
- qsort(&platform_info->hugepage_info[0], num_sizes,
- sizeof(platform_info->hugepage_info[0]), compare_hpi);
+ qsort(&runtime_state->hugepage_info[0], num_sizes,
+ sizeof(runtime_state->hugepage_info[0]), compare_hpi);
/* now we have all info, check we have at least one valid size */
for (i = 0; i < num_sizes; i++) {
/* pages may no longer all be on socket 0, so check all */
unsigned int j, num_pages = 0;
- struct hugepage_info *hpi = &platform_info->hugepage_info[i];
+ struct hugepage_info *hpi = &runtime_state->hugepage_info[i];
for (j = 0; j < RTE_MAX_NUMA_NODES; j++)
num_pages += hpi->num_pages[j];
@@ -577,7 +653,7 @@ eal_hugepage_info_init(void)
{
struct hugepage_info *hpi, *tmp_hpi;
unsigned int i;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
if (hugepage_info_init() < 0)
@@ -587,26 +663,26 @@ eal_hugepage_info_init(void)
if (user_cfg->no_shconf)
return 0;
- hpi = &platform_info->hugepage_info[0];
+ hpi = &runtime_state->hugepage_info[0];
tmp_hpi = create_shared_memory(eal_hugepage_info_path(),
- sizeof(platform_info->hugepage_info));
+ sizeof(runtime_state->hugepage_info));
if (tmp_hpi == NULL) {
EAL_LOG(ERR, "Failed to create shared memory!");
return -1;
}
- memcpy(tmp_hpi, hpi, sizeof(platform_info->hugepage_info));
+ memcpy(tmp_hpi, hpi, sizeof(runtime_state->hugepage_info));
/* we've copied file descriptors along with everything else, but they
* will be invalid in secondary process, so overwrite them
*/
- for (i = 0; i < RTE_DIM(platform_info->hugepage_info); i++) {
+ for (i = 0; i < RTE_DIM(runtime_state->hugepage_info); i++) {
struct hugepage_info *tmp = &tmp_hpi[i];
tmp->lock_descriptor = -1;
}
- if (munmap(tmp_hpi, sizeof(platform_info->hugepage_info)) < 0) {
+ if (munmap(tmp_hpi, sizeof(runtime_state->hugepage_info)) < 0) {
EAL_LOG(ERR, "Failed to unmap shared memory!");
return -1;
}
@@ -615,22 +691,29 @@ eal_hugepage_info_init(void)
int eal_hugepage_info_read(void)
{
- struct eal_platform_info *platform_info = eal_get_platform_info();
- struct hugepage_info *hpi = &platform_info->hugepage_info[0];
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
+ struct hugepage_info *hpi = &runtime_state->hugepage_info[0];
struct hugepage_info *tmp_hpi;
tmp_hpi = open_shared_memory(eal_hugepage_info_path(),
- sizeof(platform_info->hugepage_info));
+ sizeof(runtime_state->hugepage_info));
if (tmp_hpi == NULL) {
EAL_LOG(ERR, "Failed to open shared memory!");
return -1;
}
- memcpy(hpi, tmp_hpi, sizeof(platform_info->hugepage_info));
+ memcpy(hpi, tmp_hpi, sizeof(runtime_state->hugepage_info));
- if (munmap(tmp_hpi, sizeof(platform_info->hugepage_info)) < 0) {
+ if (munmap(tmp_hpi, sizeof(runtime_state->hugepage_info)) < 0) {
EAL_LOG(ERR, "Failed to unmap shared memory!");
return -1;
}
+
+ /* count valid entries copied from primary process */
+ for (unsigned int i = 0; i < MAX_HUGEPAGE_SIZES; i++) {
+ if (runtime_state->hugepage_info[i].hugepage_sz == 0)
+ break;
+ runtime_state->num_hugepage_sizes = i + 1;
+ }
return 0;
}
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 3e693d4705..3819d12d71 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -972,7 +972,7 @@ eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms, int n_segs, size_t page_sz,
struct alloc_walk_param wa;
struct hugepage_info *hi = NULL;
const 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();
memset(&wa, 0, sizeof(wa));
@@ -980,10 +980,10 @@ eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms, int n_segs, size_t page_sz,
if (user_cfg->legacy_mem)
return -1;
- for (i = 0; i < (int) RTE_DIM(platform_info->hugepage_info); i++) {
+ for (i = 0; i < (int) RTE_DIM(runtime_state->hugepage_info); i++) {
if (page_sz ==
- platform_info->hugepage_info[i].hugepage_sz) {
- hi = &platform_info->hugepage_info[i];
+ runtime_state->hugepage_info[i].hugepage_sz) {
+ hi = &runtime_state->hugepage_info[i];
break;
}
}
@@ -1041,7 +1041,7 @@ eal_memalloc_free_seg_bulk(struct rte_memseg **ms, int n_segs)
{
int seg, ret = 0;
const 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();
/* dynamic free not supported in legacy mode */
if (user_cfg->legacy_mem)
@@ -1062,13 +1062,13 @@ eal_memalloc_free_seg_bulk(struct rte_memseg **ms, int n_segs)
memset(&wa, 0, sizeof(wa));
- for (i = 0; i < (int)RTE_DIM(platform_info->hugepage_info);
+ for (i = 0; i < (int)RTE_DIM(runtime_state->hugepage_info);
i++) {
- hi = &platform_info->hugepage_info[i];
+ hi = &runtime_state->hugepage_info[i];
if (cur->hugepage_sz == hi->hugepage_sz)
break;
}
- if (i == (int)RTE_DIM(platform_info->hugepage_info)) {
+ if (i == (int)RTE_DIM(runtime_state->hugepage_info)) {
EAL_LOG(ERR, "Can't find relevant hugepage_info entry");
ret = -1;
continue;
@@ -1332,7 +1332,7 @@ sync_walk(const struct rte_memseg_list *msl, void *arg __rte_unused)
{
struct rte_mem_config *mcfg = eal_get_mcfg();
struct rte_memseg_list *primary_msl, *local_msl;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
struct hugepage_info *hi = NULL;
unsigned int i;
int msl_idx;
@@ -1344,12 +1344,12 @@ sync_walk(const struct rte_memseg_list *msl, void *arg __rte_unused)
primary_msl = &mcfg->memsegs[msl_idx];
local_msl = &local_memsegs[msl_idx];
- for (i = 0; i < RTE_DIM(platform_info->hugepage_info); i++) {
+ for (i = 0; i < RTE_DIM(runtime_state->hugepage_info); i++) {
uint64_t cur_sz =
- platform_info->hugepage_info[i].hugepage_sz;
+ runtime_state->hugepage_info[i].hugepage_sz;
uint64_t msl_sz = primary_msl->page_sz;
if (msl_sz == cur_sz) {
- hi = &platform_info->hugepage_info[i];
+ hi = &runtime_state->hugepage_info[i];
break;
}
}
diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 41d0cf79c0..2f2ed5621b 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -598,13 +598,13 @@ unlink_hugepage_files(struct hugepage_file *hugepg_tbl,
{
unsigned socket, size;
int page, nrpages = 0;
- const struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
/* get total number of hugepages */
for (size = 0; size < num_hp_info; size++)
for (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++)
nrpages +=
- platform_info->hugepage_info[size].num_pages[socket];
+ runtime_state->hugepage_info[size].num_pages[socket];
for (page = 0; page < nrpages; page++) {
struct hugepage_file *hp = &hugepg_tbl[page];
@@ -628,12 +628,12 @@ unmap_unneeded_hugepages(struct hugepage_file *hugepg_tbl,
{
unsigned socket, size;
int page, nrpages = 0;
- const struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
/* get total number of hugepages */
for (size = 0; size < num_hp_info; size++)
for (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++)
- nrpages += platform_info->hugepage_info[size].num_pages[socket];
+ nrpages += runtime_state->hugepage_info[size].num_pages[socket];
for (size = 0; size < num_hp_info; size++) {
for (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++) {
@@ -847,7 +847,7 @@ memseg_list_free(struct rte_memseg_list *msl)
static int __rte_unused
prealloc_segments(struct hugepage_file *hugepages, int n_pages)
{
- const struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
struct rte_mem_config *mcfg = eal_get_mcfg();
int cur_page, seg_start_page, end_seg, new_memseg;
unsigned int hpi_idx, socket, i;
@@ -867,10 +867,10 @@ prealloc_segments(struct hugepage_file *hugepages, int n_pages)
/* we cannot know how many page sizes and sockets we have discovered, so
* loop over all of them
*/
- for (hpi_idx = 0; hpi_idx < platform_info->num_hugepage_sizes;
+ for (hpi_idx = 0; hpi_idx < runtime_state->num_hugepage_sizes;
hpi_idx++) {
uint64_t page_sz =
- platform_info->hugepage_info[hpi_idx].hugepage_sz;
+ runtime_state->hugepage_info[hpi_idx].hugepage_sz;
for (i = 0; i < rte_socket_count(); i++) {
struct rte_memseg_list *msl;
@@ -1075,10 +1075,10 @@ eal_get_hugepage_mem_size(void)
{
uint64_t size = 0;
unsigned i, j;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
- for (i = 0; i < platform_info->num_hugepage_sizes; i++) {
- struct hugepage_info *hpi = &platform_info->hugepage_info[i];
+ for (i = 0; i < runtime_state->num_hugepage_sizes; i++) {
+ struct hugepage_info *hpi = &runtime_state->hugepage_info[i];
if (strnlen(hpi->hugedir, sizeof(hpi->hugedir)) != 0) {
for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
size += hpi->hugepage_sz * hpi->num_pages[j];
@@ -1133,7 +1133,7 @@ eal_legacy_hugepage_init(void)
struct rte_mem_config *mcfg;
struct hugepage_file *hugepage = NULL, *tmp_hp = NULL;
struct hugepage_info used_hp[MAX_HUGEPAGE_SIZES];
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
struct eal_user_cfg *user_cfg = eal_get_user_configuration();
uint64_t memory[RTE_MAX_NUMA_NODES];
@@ -1250,11 +1250,11 @@ eal_legacy_hugepage_init(void)
/* calculate total number of hugepages available. at this point we haven't
* yet started sorting them so they all are on socket 0 */
- for (i = 0; i < (int) platform_info->num_hugepage_sizes; i++) {
+ for (i = 0; i < (int) runtime_state->num_hugepage_sizes; i++) {
/* meanwhile, also initialize used_hp hugepage sizes in used_hp */
- used_hp[i].hugepage_sz = platform_info->hugepage_info[i].hugepage_sz;
+ used_hp[i].hugepage_sz = runtime_state->hugepage_info[i].hugepage_sz;
- nr_hugepages += platform_info->hugepage_info[i].num_pages[0];
+ nr_hugepages += runtime_state->hugepage_info[i].num_pages[0];
}
/*
@@ -1278,7 +1278,7 @@ eal_legacy_hugepage_init(void)
memory[i] = user_cfg->numa_mem[i];
/* map all hugepages and sort them */
- for (i = 0; i < (int)platform_info->num_hugepage_sizes; i++) {
+ for (i = 0; i < (int)runtime_state->num_hugepage_sizes; i++) {
unsigned pages_old, pages_new;
struct hugepage_info *hpi;
@@ -1287,7 +1287,7 @@ eal_legacy_hugepage_init(void)
* we just map all hugepages available to the system
* all hugepages are still located on socket 0
*/
- hpi = &platform_info->hugepage_info[i];
+ hpi = &runtime_state->hugepage_info[i];
if (hpi->num_pages[0] == 0)
continue;
@@ -1350,9 +1350,9 @@ eal_legacy_hugepage_init(void)
/* clean out the numbers of pages */
- for (i = 0; i < (int) platform_info->num_hugepage_sizes; i++)
+ for (i = 0; i < (int) runtime_state->num_hugepage_sizes; i++)
for (j = 0; j < RTE_MAX_NUMA_NODES; j++)
- platform_info->hugepage_info[i].num_pages[j] = 0;
+ runtime_state->hugepage_info[i].num_pages[j] = 0;
/* get hugepages for each socket */
for (i = 0; i < nr_hugefiles; i++) {
@@ -1360,11 +1360,11 @@ eal_legacy_hugepage_init(void)
/* find a hugepage info with right size and increment num_pages */
const int nb_hpsizes = RTE_MIN(MAX_HUGEPAGE_SIZES,
- (int)platform_info->num_hugepage_sizes);
+ (int)runtime_state->num_hugepage_sizes);
for (j = 0; j < nb_hpsizes; j++) {
if (tmp_hp[i].size ==
- platform_info->hugepage_info[j].hugepage_sz) {
- platform_info->hugepage_info[j].num_pages[socket]++;
+ runtime_state->hugepage_info[j].hugepage_sz) {
+ runtime_state->hugepage_info[j].num_pages[socket]++;
}
}
}
@@ -1375,15 +1375,15 @@ eal_legacy_hugepage_init(void)
/* calculate final number of pages */
nr_hugepages = eal_dynmem_calc_num_pages_per_socket(memory,
- platform_info->hugepage_info, used_hp,
- platform_info->num_hugepage_sizes);
+ runtime_state->hugepage_info, used_hp,
+ runtime_state->num_hugepage_sizes);
/* error if not enough memory available */
if (nr_hugepages < 0)
goto fail;
/* reporting in! */
- for (i = 0; i < (int) platform_info->num_hugepage_sizes; i++) {
+ for (i = 0; i < (int) runtime_state->num_hugepage_sizes; i++) {
for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
if (used_hp[i].num_pages[j] > 0) {
EAL_LOG(DEBUG,
@@ -1412,7 +1412,7 @@ eal_legacy_hugepage_init(void)
* also, sets final_va to NULL on pages that were unmapped.
*/
if (unmap_unneeded_hugepages(tmp_hp, used_hp,
- platform_info->num_hugepage_sizes) < 0) {
+ runtime_state->num_hugepage_sizes) < 0) {
EAL_LOG(ERR, "Unmapping and locking hugepages failed!");
goto fail;
}
@@ -1447,7 +1447,7 @@ eal_legacy_hugepage_init(void)
/* free the hugepage backing files */
if (user_cfg->hugepage_file.unlink_before_mapping &&
- unlink_hugepage_files(tmp_hp, platform_info->num_hugepage_sizes) < 0) {
+ unlink_hugepage_files(tmp_hp, runtime_state->num_hugepage_sizes) < 0) {
EAL_LOG(ERR, "Unlinking hugepage files failed!");
goto fail;
}
@@ -1701,7 +1701,6 @@ memseg_primary_init_32(void)
unsigned int socket_id, i;
struct rte_memseg_list *msl;
uint64_t extra_mem_per_socket, total_extra_mem, total_requested_mem;
- struct eal_platform_info *platform_info = eal_get_platform_info();
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
@@ -1768,7 +1767,7 @@ memseg_primary_init_32(void)
/* create memseg lists */
for (i = 0; i < rte_socket_count(); i++) {
- int hp_sizes = (int) platform_info->num_hugepage_sizes;
+ int hp_sizes = (int) runtime_state->num_hugepage_sizes;
uint64_t max_socket_mem, cur_socket_mem;
unsigned int main_lcore_socket;
bool skip;
@@ -1813,9 +1812,9 @@ memseg_primary_init_32(void)
uint64_t max_pagesz_mem, cur_pagesz_mem = 0;
uint64_t hugepage_sz;
uint64_t pagesz_mem_limit;
- struct hugepage_info *hpi;
+ const struct hugepage_info *hpi;
- hpi = &platform_info->hugepage_info[hpi_idx];
+ hpi = &runtime_state->hugepage_info[hpi_idx];
hugepage_sz = hpi->hugepage_sz;
/* check if pages are actually available */
diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
index 37e43c9a62..f1a159bf48 100644
--- a/lib/eal/windows/eal.c
+++ b/lib/eal/windows/eal.c
@@ -165,6 +165,18 @@ rte_eal_init(int argc, char **argv)
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
char thread_name[RTE_THREAD_NAME_SIZE];
+ /*
+ * platform_info is lazily initialized on first use, and that
+ * initialization can fail (CPU/NUMA/hugepage detection). Almost
+ * everything below depends on a valid platform_info, so confirm it
+ * is available before doing anything else.
+ */
+ if (eal_get_platform_info() == NULL) {
+ rte_eal_init_alert("Cannot get platform information.");
+ rte_errno = ENOTSUP;
+ return -1;
+ }
+
/* clone argv to report out later in telemetry */
eal_save_args(argc, argv);
@@ -184,12 +196,6 @@ rte_eal_init(int argc, char **argv)
eal_log_init(NULL);
- if (eal_create_cpu_map() < 0) {
- rte_eal_init_alert("Cannot discover CPU and NUMA.");
- /* rte_errno is set */
- goto err_out;
- }
-
/* verify if DPDK supported on architecture MMU */
if (!eal_mmu_supported()) {
rte_eal_init_alert("Unsupported MMU type.");
@@ -197,12 +203,6 @@ rte_eal_init(int argc, char **argv)
goto err_out;
}
- if (rte_eal_cpu_init() < 0) {
- rte_eal_init_alert("Cannot detect lcores.");
- rte_errno = ENOTSUP;
- goto err_out;
- }
-
if (eal_parse_args() < 0) {
rte_eal_init_alert("Invalid command line arguments.");
rte_errno = EINVAL;
diff --git a/lib/eal/windows/eal_hugepages.c b/lib/eal/windows/eal_hugepages.c
index 4e9e958c65..fa19b7b77c 100644
--- a/lib/eal/windows/eal_hugepages.c
+++ b/lib/eal/windows/eal_hugepages.c
@@ -62,11 +62,9 @@ hugepage_info_init(void)
struct hugepage_info *hpi;
unsigned int socket_id;
int ret = 0;
- struct eal_platform_info *platform_info = eal_get_platform_info();
+ struct eal_runtime_state *runtime_state = eal_get_runtime_state();
- /* Only one hugepage size available on Windows. */
- platform_info->num_hugepage_sizes = 1;
- hpi = &platform_info->hugepage_info[0];
+ hpi = &runtime_state->hugepage_info[0];
hpi->hugepage_sz = GetLargePageMinimum();
if (hpi->hugepage_sz == 0)
@@ -96,10 +94,39 @@ hugepage_info_init(void)
/* No hugepage filesystem on Windows. */
hpi->lock_descriptor = -1;
memset(hpi->hugedir, 0, sizeof(hpi->hugedir));
+ runtime_state->num_hugepage_sizes = 1;
return ret;
}
+int
+eal_get_platform_hp_info(struct eal_platform_info *platform_info)
+{
+ size_t hp_sz;
+ unsigned int socket_id;
+
+ hp_sz = GetLargePageMinimum();
+ if (hp_sz == 0)
+ return -ENOTSUP;
+
+ for (socket_id = 0; socket_id < platform_info->numa_node_count; socket_id++) {
+ ULONGLONG bytes;
+ unsigned int numa_node;
+
+ numa_node = eal_socket_numa_node(socket_id);
+ if (GetNumaAvailableMemoryNodeEx(numa_node, &bytes)) {
+ platform_info->hugepage_sizes[0].max_pages[socket_id] = bytes / hp_sz;
+ platform_info->hugepage_sizes[0].total_pages += bytes / hp_sz;
+ }
+ }
+
+ platform_info->num_hugepage_sizes = 1;
+ platform_info->hugepage_sizes[0].size = hp_sz;
+ platform_info->hugepage_sizes[0].dir[0] = '\0'; /* no hugetlbfs on Windows */
+
+ return 0;
+}
+
int
eal_hugepage_info_init(void)
{
diff --git a/lib/eal/windows/eal_memalloc.c b/lib/eal/windows/eal_memalloc.c
index b45002621b..8a2d3966ba 100644
--- a/lib/eal/windows/eal_memalloc.c
+++ b/lib/eal/windows/eal_memalloc.c
@@ -320,6 +320,7 @@ eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms, int n_segs,
struct alloc_walk_param wa;
const struct hugepage_info *hi = NULL;
const struct eal_platform_info *platform_info = eal_get_platform_info();
+ const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
if (user_cfg->legacy_mem) {
@@ -328,7 +329,7 @@ eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms, int n_segs,
}
for (i = 0; i < platform_info->num_hugepage_sizes; i++) {
- const struct hugepage_info *hpi = &platform_info->hugepage_info[i];
+ const struct hugepage_info *hpi = &runtime_state->hugepage_info[i];
if (page_sz == hpi->hugepage_sz) {
hi = hpi;
break;
@@ -372,7 +373,7 @@ int
eal_memalloc_free_seg_bulk(struct rte_memseg **ms, int n_segs)
{
int seg, ret = 0;
- const struct eal_platform_info *platform_info = eal_get_platform_info();
+ const struct eal_runtime_state *runtime_state = eal_get_runtime_state();
const struct eal_user_cfg *user_cfg = eal_get_user_configuration();
/* dynamic free not supported in legacy mode */
@@ -395,12 +396,12 @@ eal_memalloc_free_seg_bulk(struct rte_memseg **ms, int n_segs)
memset(&wa, 0, sizeof(wa));
- for (i = 0; i < RTE_DIM(platform_info->hugepage_info); i++) {
- hi = &platform_info->hugepage_info[i];
+ for (i = 0; i < RTE_DIM(runtime_state->hugepage_info); i++) {
+ hi = &runtime_state->hugepage_info[i];
if (cur->hugepage_sz == hi->hugepage_sz)
break;
}
- if (i == RTE_DIM(platform_info->hugepage_info)) {
+ if (i == RTE_DIM(runtime_state->hugepage_info)) {
EAL_LOG(ERR, "Can't find relevant hugepage_info entry");
ret = -1;
continue;
diff --git a/lib/eal/windows/eal_windows.h b/lib/eal/windows/eal_windows.h
index 91cf15eaaa..64662e957a 100644
--- a/lib/eal/windows/eal_windows.h
+++ b/lib/eal/windows/eal_windows.h
@@ -29,14 +29,6 @@
#define EAL_LOG_STUB() \
EAL_LOG(DEBUG, "Windows: %s() is a stub", __func__)
-/**
- * Create a map of processors and cores on the system.
- *
- * @return
- * 0 on success, (-1) on failure and rte_errno is set.
- */
-int eal_create_cpu_map(void);
-
/**
* Get system NUMA node number for a socket ID.
*
--
2.55.0
next prev parent reply other threads:[~2026-11-26 18:19 UTC|newest]
Thread overview: 176+ 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 ` [RFC PATCH 09/44] eal: move runtime state to appropriate structure Bruce Richardson
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
2026-07-21 9:45 ` [PATCH 00/39] Rework EAL configuration Bruce Richardson
2026-07-21 9:45 ` [PATCH 01/39] telemetry: make cpuset init parameter const Bruce Richardson
2026-07-21 9:45 ` [PATCH 02/39] argparse: check for range overflow in CPU lists Bruce Richardson
2026-07-21 9:45 ` [PATCH 03/39] eal: define new functionally distinct config structs Bruce Richardson
2026-07-27 18:03 ` Stephen Hemminger
2026-08-18 13:36 ` Bruce Richardson
2026-07-21 9:45 ` [PATCH 04/39] eal: move memory request fields to user config Bruce Richardson
2026-07-21 9:45 ` [PATCH 05/39] eal: move NUMA " Bruce Richardson
2026-07-21 9:45 ` [PATCH 06/39] eal: move hugepage policy " Bruce Richardson
2026-07-21 9:45 ` [PATCH 07/39] eal: move process " Bruce Richardson
2026-07-21 9:45 ` [PATCH 08/39] eal: move hugepage limit fields to new config structs Bruce Richardson
2026-07-21 9:45 ` [PATCH 09/39] eal: move advanced user config options to user cfg struct Bruce Richardson
2026-07-21 9:45 ` [PATCH 10/39] eal: move hugepage size info to platform info struct Bruce Richardson
2026-07-21 9:45 ` [PATCH 11/39] eal: move runtime state to appropriate structure Bruce Richardson
2026-07-21 9:45 ` [PATCH 12/39] eal: record details of all cpus in platform info Bruce Richardson
2026-07-21 9:45 ` [PATCH 13/39] eal: use platform info for lcore lookups Bruce Richardson
2026-07-21 9:45 ` [PATCH 14/39] eal: add macro for lowest set CPU bit in a set Bruce Richardson
2026-07-21 9:45 ` [PATCH 15/39] eal: store lcore configuration in runtime data Bruce Richardson
2026-07-21 9:45 ` [PATCH 16/39] eal: move core indices bitset to runtime state Bruce Richardson
2026-07-21 9:45 ` [PATCH 17/39] eal: cleanup CPU init function Bruce Richardson
2026-07-21 9:45 ` [PATCH 18/39] eal: move NUMA node information to platform info struct Bruce Richardson
2026-07-21 9:45 ` [PATCH 19/39] eal: move lcore role and count to runtime state Bruce Richardson
2026-07-21 9:45 ` [PATCH 20/39] eal: make lcore role a field in lcore config struct Bruce Richardson
2026-07-21 9:45 ` [PATCH 21/39] eal: move main lcore setting to runtime " Bruce Richardson
2026-07-21 9:45 ` [PATCH 22/39] eal: move IOVA mode and process type to runtime cfg Bruce Richardson
2026-07-21 9:45 ` [PATCH 23/39] eal: move memory config pointer to runtime state struct Bruce Richardson
2026-07-21 9:45 ` [PATCH 24/39] eal: remove rte_config structure Bruce Richardson
2026-07-21 9:45 ` [PATCH 25/39] eal: separate runtime state update from arg parsing Bruce Richardson
2026-07-21 9:45 ` [PATCH 26/39] eal: move device options staging list into user cfg Bruce Richardson
2026-07-21 9:45 ` [PATCH 27/39] eal: separate plugin paths from loaded plugin objects Bruce Richardson
2026-07-21 9:45 ` [PATCH 28/39] eal: simplify internal driver path iteration APIs Bruce Richardson
2026-07-21 9:45 ` [PATCH 29/39] eal: move trace config into user config struct Bruce Richardson
2026-07-21 9:45 ` [PATCH 30/39] eal: record service cores in " Bruce Richardson
2026-07-21 9:45 ` [PATCH 31/39] eal: store user-provided lcore info " Bruce Richardson
2026-07-21 9:45 ` [PATCH 32/39] eal: clarify docs on params taking lcore IDs Bruce Richardson
2026-07-21 9:45 ` [PATCH 33/39] eal: remove internal config reset function Bruce Richardson
2026-07-21 9:45 ` [PATCH 34/39] eal: move functions setting runtime state Bruce Richardson
2026-07-21 9:45 ` [PATCH 35/39] eal: initialize platform info on first use Bruce Richardson
2026-07-21 9:45 ` [PATCH 36/39] eal: remove duplicated scan of sysfs for hugepage details Bruce Richardson
2026-07-21 9:45 ` [PATCH 37/39] eal: add utilities for working with user config struct Bruce Richardson
2026-07-21 9:45 ` [PATCH 38/39] eal: split EAL init into two stages Bruce Richardson
2026-07-21 9:45 ` [PATCH 39/39] eal: provide hooks for init with externally supplied config Bruce Richardson
2026-07-27 23:30 ` [PATCH 00/39] Rework EAL configuration Stephen Hemminger
2026-08-18 13:41 ` Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 " Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 01/39] telemetry: make cpuset init parameter const Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 02/39] argparse: check for range overflow in CPU lists Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 03/39] eal: define new functionally distinct config structs Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 04/39] eal: move memory request fields to user config Bruce Richardson
2026-12-01 11:20 ` Konstantin Ananyev
2026-12-01 11:34 ` Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 05/39] eal: move NUMA " Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 06/39] eal: move hugepage policy " Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 07/39] eal: move process " Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 08/39] eal: move hugepage limit fields to new config structs Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 09/39] eal: move advanced user config options to user cfg struct Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 10/39] eal: move hugepage size info to platform info struct Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 11/39] eal: move runtime state to appropriate structure Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 12/39] eal: record details of all cpus in platform info Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 13/39] eal: use platform info for lcore lookups Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 14/39] eal: add macro for lowest set CPU bit in a set Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 15/39] eal: store lcore configuration in runtime data Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 16/39] eal: move core indices bitset to runtime state Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 17/39] eal: cleanup CPU init function Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 18/39] eal: move NUMA node information to platform info struct Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 19/39] eal: move lcore role and count to runtime state Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 20/39] eal: make lcore role a field in lcore config struct Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 21/39] eal: move main lcore setting to runtime " Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 22/39] eal: move IOVA mode and process type to runtime cfg Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 23/39] eal: move memory config pointer to runtime state struct Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 24/39] eal: remove rte_config structure Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 25/39] eal: separate runtime state update from arg parsing Bruce Richardson
2026-11-26 18:13 ` [PATCH v3 26/39] eal: move device options staging list into user cfg Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 27/39] eal: separate plugin paths from loaded plugin objects Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 28/39] eal: simplify internal driver path iteration APIs Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 29/39] eal: move trace config into user config struct Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 30/39] eal: record service cores in " Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 31/39] eal: store user-provided lcore info " Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 32/39] eal: clarify docs on params taking lcore IDs Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 33/39] eal: remove internal config reset function Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 34/39] eal: move functions setting runtime state Bruce Richardson
2026-11-26 18:14 ` Bruce Richardson [this message]
2026-11-26 18:14 ` [PATCH v3 36/39] eal: remove duplicated scan of sysfs for hugepage details Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 37/39] eal: add utilities for working with user config struct Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 38/39] eal: split EAL init into two stages Bruce Richardson
2026-11-26 18:14 ` [PATCH v3 39/39] eal: provide hooks for init with externally supplied config Bruce Richardson
2026-08-18 13:32 ` [PATCH v2 00/39] Rework EAL configuration Bruce Richardson
2026-08-18 13:32 ` [PATCH v2 01/39] telemetry: make cpuset init parameter const Bruce Richardson
2026-08-18 13:32 ` [PATCH v2 02/39] argparse: check for range overflow in CPU lists Bruce Richardson
2026-08-18 13:32 ` [PATCH v2 03/39] eal: define new functionally distinct config structs Bruce Richardson
2026-08-18 13:32 ` [PATCH v2 04/39] eal: move memory request fields to user config Bruce Richardson
2026-08-18 13:32 ` [PATCH v2 05/39] eal: move NUMA " Bruce Richardson
2026-08-18 13:32 ` [PATCH v2 06/39] eal: move hugepage policy " Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 07/39] eal: move process " Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 08/39] eal: move hugepage limit fields to new config structs Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 09/39] eal: move advanced user config options to user cfg struct Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 10/39] eal: move hugepage size info to platform info struct Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 11/39] eal: move runtime state to appropriate structure Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 12/39] eal: record details of all cpus in platform info Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 13/39] eal: use platform info for lcore lookups Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 14/39] eal: add macro for lowest set CPU bit in a set Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 15/39] eal: store lcore configuration in runtime data Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 16/39] eal: move core indices bitset to runtime state Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 17/39] eal: cleanup CPU init function Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 18/39] eal: move NUMA node information to platform info struct Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 19/39] eal: move lcore role and count to runtime state Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 20/39] eal: make lcore role a field in lcore config struct Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 21/39] eal: move main lcore setting to runtime " Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 22/39] eal: move IOVA mode and process type to runtime cfg Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 23/39] eal: move memory config pointer to runtime state struct Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 24/39] eal: remove rte_config structure Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 25/39] eal: separate runtime state update from arg parsing Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 26/39] eal: move device options staging list into user cfg Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 27/39] eal: separate plugin paths from loaded plugin objects Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 28/39] eal: simplify internal driver path iteration APIs Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 29/39] eal: move trace config into user config struct Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 30/39] eal: record service cores in " Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 31/39] eal: store user-provided lcore info " Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 32/39] eal: clarify docs on params taking lcore IDs Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 33/39] eal: remove internal config reset function Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 34/39] eal: move functions setting runtime state Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 35/39] eal: initialize platform info on first use Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 36/39] eal: remove duplicated scan of sysfs for hugepage details Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 37/39] eal: add utilities for working with user config struct Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 38/39] eal: split EAL init into two stages Bruce Richardson
2026-08-18 13:33 ` [PATCH v2 39/39] eal: provide hooks for init with externally supplied config 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=20261126181414.124094-36-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@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