From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: techboard@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: [RFC PATCH 00/44] Allow intitializing EAL without argc/argv
Date: Wed, 29 Apr 2026 17:57:52 +0100 [thread overview]
Message-ID: <20260429165845.2136843-1-bruce.richardson@intel.com> (raw)
The ultimate end goal of this RFC is, as stated in the title, to move
away from argc/argv as the sole means of configuring EAL on init. This
set therefore looks to:
* rework EAL so that we have a generic EAL init function taking a
struct-based configuration
* provide a rough *example* of how that might be used to create a new
set of C APIs to be used by apps to initialize EAL without having to
create dummy argc/argv pairs. [A side benefit of this is that it
makes it a lot easier to initialize EAL from other languages like Rust
or Python too, because arrays of C strings are not the most
user-friendly for a foreign interface]
Therefore this set can be considered in 3 parts:
Part 1: Struct rework.
Largely for legacy reasons, we have a number of different structs and
arrays holding eal configuration, without having clear guides as to why
certain fields are stored where. The first ~30 patches rework the
existing structs - rte_config, internal_config, lcore_config etc.
into three defined-purpose structs:
- eal_platform_info - contains the raw HW info for the system, details
of CPUs and hugepage mounts. This is initialized on first use - even
before EAL init is called - and is then immutable, since our HW should
not change much underneath us. Its early availability means that it
can be used to sanity check the contents of the other structs as they
are being built up.
- eal_user_cfg - contains the config settings passed in by the user. For
existing rte_eal_init, this is built up in the arg parse stage, and
it's contents verified against the platform info, e.g. to check core
masks are valid etc. Once argument parsing is completed, is also
immutable.
- runtime_cfg - basically all the runtime settings that need to be there
for DPDK to run, or which change over time. Largely combined content
of the old rte_config, internal_config and lcore_config structs. This
is initialized from the other two structs by eal initialization and
can be modified by EAL at any time.
Part 2: Cleanup and Split EAL init
With the 3 structs clearly separated by purpose, we can then do some
cleanup of the code, before - in patches 35 & 36 - splitting EAL into
two and providing an *internal* struct-based alternative API for
initializing DPDK. The old rte_eal_init function still exists, just the
contents of it after the argument parsing are put into a new, static
eal_runtime_init() function, which take the argparse output (user_cfg
struct). Patch 36, adds a thin internal-API wrapper around this static,
which is necessary to take care of things like the run-once flag. [This
wrapper should never be the public API, since the struct will change and
therefore be an ABI break. It's designed to be used by other wrapper
libs which provide a stable ABI for config]
Part 3: Prototype of an eal_cfg library
Once we have the internal C API to init eal using a struct
rte_eal_user_cfg, we can create new libraries which provide alternate
ways to build up the user_cfg and initialize DPDK. Patches 37-44 have a
rough example of such a library.
- The lib allows a user to create an opaque rte_eal_user_cfg struct,
which can then be modified by APIs to get/set various parameters
before calling rte_cfg_eal_init().
- An alternative way to do things (not prototyped), may be to have a
library that creates an eal_user_cfg struct based on the contents of
an ini file using the configfile library.
[Both these options could be used in parallel. Note too that both have
no ABI implications for adding new flags, or making old ones no-ops!]
Bruce Richardson (44):
eal: define new functionally distinct config structs
eal: move memory request fields to user config
eal: move NUMA request fields to user config
eal: move hugepage policy fields to user config
eal: move process policy fields to user config
eal: move advanced user config options to user cfg struct
eal: move hugepage size info to platform info struct
telemetry: make cpuset init parameter const
eal: move runtime state to appropriate structure
eal: record details of all cpus in platform info
eal: use platform info for lcore lookups
eal: add RTE_CPU_FFS macro
eal: store lcore configuration in runtime data
eal: cleanup CPU init function
eal: move numa node information to platform info struct
eal: move lcore role and count to runtime state
eal: make lcore role a field in lcore config struct
eal: move main lcore setting to runtime config struct
eal: move iova mode and process type to runtime cfg
eal: move memory config pointer to runtime state struct
eal: remove rte_config structure
eal: separate runtime state update from arg parsing
eal: move devopt_list staging list into user_cfg
eal: separate plugin paths from loaded plugin objects
eal: simplify internal driver path iteration APIs
eal: move trace config into user config struct
eal: record service cores in user config struct
eal: store user-provided lcore info in user config struct
eal: clarify docs on params taking lcore IDs
eal: remove internal config reset function
eal: move functions setting runtime state
eal: initialize platform info on first use
eal: remove duplicated scan of sysfs for hugepage details
eal: add utilities for working with user config struct
eal: split EAL init into two stages
eal: provide hooks for init with externally supplied config
eal_cfg: add new library to programmatically init DPDK
eal_cfg: configure defaults for easier testing and use
app/test: enable testing init using EAL config lib
eal_cfg: add basic setters and getters
eal_cfg: add hugepage memory configuration
eal_cfg: support configuring lcores
eal_cfg: support device and driver lists
eal_cfg: add APIs for configuring remaining init settings
app/test/meson.build | 1 +
app/test/process.h | 4 +-
app/test/test.c | 14 +-
app/test/test.h | 1 +
app/test/test_eal_cfg.c | 1323 +++++++++++++++++++++
doc/api/doxy-api-index.md | 1 +
doc/api/doxy-api.conf.in | 1 +
doc/guides/linux_gsg/eal_args.include.rst | 38 +-
doc/guides/prog_guide/eal_cfg_lib.rst | 23 +
doc/guides/prog_guide/index.rst | 1 +
lib/eal/common/eal_common_bus.c | 4 +-
lib/eal/common/eal_common_config.c | 221 +++-
lib/eal/common/eal_common_dynmem.c | 66 +-
lib/eal/common/eal_common_fbarray.c | 10 +-
lib/eal/common/eal_common_launch.c | 25 +-
lib/eal/common/eal_common_lcore.c | 230 ++--
lib/eal/common/eal_common_mcfg.c | 44 +-
lib/eal/common/eal_common_memalloc.c | 5 +-
lib/eal/common/eal_common_memory.c | 104 +-
lib/eal/common/eal_common_memzone.c | 24 +-
lib/eal/common/eal_common_options.c | 823 +++++--------
lib/eal/common/eal_common_proc.c | 43 +-
lib/eal/common/eal_common_tailqs.c | 6 +-
lib/eal/common/eal_common_thread.c | 81 +-
lib/eal/common/eal_common_timer.c | 2 +-
lib/eal/common/eal_common_trace.c | 30 +-
lib/eal/common/eal_common_trace_utils.c | 104 --
lib/eal/common/eal_hugepages.h | 8 +
lib/eal/common/eal_internal_cfg.h | 376 +++++-
lib/eal/common/eal_memcfg.h | 3 +
lib/eal/common/eal_option_list.h | 6 +-
lib/eal/common/eal_options.h | 7 +-
lib/eal/common/eal_private.h | 108 +-
lib/eal/common/eal_trace.h | 11 -
lib/eal/common/malloc_elem.c | 15 +-
lib/eal/common/malloc_heap.c | 41 +-
lib/eal/common/malloc_mp.c | 2 +-
lib/eal/common/rte_malloc.c | 14 +-
lib/eal/common/rte_service.c | 17 +-
lib/eal/freebsd/eal.c | 271 +++--
lib/eal/freebsd/eal_hugepage_info.c | 71 +-
lib/eal/freebsd/eal_lcore.c | 16 +-
lib/eal/freebsd/eal_memory.c | 46 +-
lib/eal/freebsd/include/rte_os.h | 2 +
lib/eal/include/rte_eal.h | 35 +-
lib/eal/include/rte_memzone.h | 10 +-
lib/eal/include/rte_tailq.h | 2 +-
lib/eal/linux/eal.c | 280 +++--
lib/eal/linux/eal_hugepage_info.c | 219 ++--
lib/eal/linux/eal_lcore.c | 13 +
lib/eal/linux/eal_memalloc.c | 168 ++-
lib/eal/linux/eal_memory.c | 153 ++-
lib/eal/linux/eal_timer_hpet.c | 21 +-
lib/eal/linux/eal_vfio.c | 11 +-
lib/eal/linux/include/rte_os.h | 10 +
lib/eal/unix/eal_unix_thread.c | 11 +-
lib/eal/windows/eal.c | 177 ++-
lib/eal/windows/eal_hugepages.c | 60 +-
lib/eal/windows/eal_lcore.c | 6 +
lib/eal/windows/eal_memalloc.c | 37 +-
lib/eal/windows/eal_memory.c | 14 +-
lib/eal/windows/eal_thread.c | 11 +-
lib/eal/windows/eal_windows.h | 8 -
lib/eal/windows/include/rte_os.h | 1 +
lib/eal/windows/include/sched.h | 10 +
lib/eal_cfg/eal_cfg.c | 918 ++++++++++++++
lib/eal_cfg/meson.build | 6 +
lib/eal_cfg/rte_eal_cfg.h | 903 ++++++++++++++
lib/meson.build | 1 +
lib/telemetry/telemetry.c | 4 +-
lib/telemetry/telemetry_internal.h | 2 +-
71 files changed, 5450 insertions(+), 1884 deletions(-)
create mode 100644 app/test/test_eal_cfg.c
create mode 100644 doc/guides/prog_guide/eal_cfg_lib.rst
create mode 100644 lib/eal_cfg/eal_cfg.c
create mode 100644 lib/eal_cfg/meson.build
create mode 100644 lib/eal_cfg/rte_eal_cfg.h
--
2.51.0
next reply other threads:[~2026-04-29 16:58 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 16:57 Bruce Richardson [this message]
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
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-1-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