[PATCH v7 00/13] Simplify running with high-numbered CPUs
Bruce Richardson
bruce.richardson at intel.com
Wed Jul 23 18:19:58 CEST 2025
The ultimate of this patchset is to make it easier to run on systems
with large numbers of cores, by simplifying the process of using core
numbers >RTE_MAX_LCORE. The new EAL args "--lcores-remapped", also
shortened to just "-L", and "--lcoreid-base", are added to DPDK to
support this. However, in order to enable the addition of these new
flags, the first 10 patches of this set do cleanups, for reasons
explained below.
When processing cmdline arguments in DPDK, we always do so with very
little context. So, for example, when processing the "-l" flag, we have
no idea whether there will be later a --proc-type=secondary flag. We
have all sorts of post-arg-processing checks in place to try and catch
these scenarios.
To improve this situation, this patchset tries to simplify the handling
of argument processing, by explicitly doing an initial pass to collate
all arguments into a structure. Thereafter, the actual arg parsing is
done in a fixed order, meaning that e.g. when processing the
--main-lcore flag, we have already processed the service core flags. We
also can far quicker and easier check for conflicting options, since
they can all be checked for NULL/non-NULL in the arg structure
immediately after the struct has been populated.
To do the initial argument gathering, this RFC uses the existing
argparse library in DPDK. With recent changes, and a few additional
patches at the start of this set, this library now meets our needs for
EAL argument parsing and allows us to not need to do direct getopt
argument processing inside EAL at all.
An additional benefit of this work is that the argument parsing for EAL
is much more centralised into common options and the options list file.
This single list with ifdefs makes it clear to the viewer what options
are common across OS's, vs what are unix-only or linux-only.
Once the cleanup and rework is done, adding the new options for
remapping cores becomes a lot simpler, since we can very easily check
for scenarios like multi-process and handle those appropriately.
V7:
* expand the scope of the patchset beyond just cleanup to add in the
extra 3 patches for -L and --lcoreid-base option.
V6:
* Rebase to apply cleanly on latest main
V5:
* Resubmit of V4, which didn't get sent correctly, or picked up correctly
in patchwork.
V4:
* Updated patch 5 to auto-generate the arg struct definition from the same
list of defines used to construct the argument list.
V3:
* Added 3 new initial patches, one for minor build-system addition, and two
for functionality in argparse to allow the user-callback help function to
be maintained as we move to argparse.
* Added doc updates in the first EAL patch adding the long options
* Fixed ASAN issues by adding a patch to properly clean up EAL init - both
memory allocations and fixing the run-once flag
* Put ifdefs around the linux-only or unix-only options in EAL patch 2
* Updated args to handle numa-mem and numa-limit as equivalent socket-mem
and socket-limit
Bruce Richardson (13):
build: add define for the OS environment name
argparse: export function to print help text for object
argparse: allow user-override of help printing
argparse: add documentation on supported value types
eal: add long options for each short option
eal: define the EAL parameters in argparse format
eal: gather EAL args before processing
eal: ensure proper cleanup on EAL init failure
eal: combine parameter validation checks
eal: simplify handling of conflicting cmdline options
argparse: add support for parsing core lists
eal: simplify running CPUs with ids above max lcores
eal: add warnings about ignored options
app/test/test_argparse.c | 188 +++
config/meson.build | 1 +
doc/guides/contributing/design.rst | 2 +-
doc/guides/linux_gsg/eal_args.include.rst | 66 +-
doc/guides/prog_guide/argparse_lib.rst | 121 +-
doc/guides/rel_notes/release_25_11.rst | 16 +
lib/argparse/rte_argparse.c | 109 +-
lib/argparse/rte_argparse.h | 23 +-
lib/eal/common/eal_common_memory.c | 3 +-
lib/eal/common/eal_common_options.c | 1344 ++++++++++++---------
lib/eal/common/eal_option_list.h | 92 ++
lib/eal/common/eal_options.h | 102 +-
lib/eal/common/eal_private.h | 11 +
lib/eal/freebsd/eal.c | 245 +---
lib/eal/linux/eal.c | 470 +------
lib/eal/linux/eal_memory.c | 2 +-
lib/eal/meson.build | 2 +-
lib/eal/windows/eal.c | 156 +--
lib/meson.build | 1 +
19 files changed, 1500 insertions(+), 1454 deletions(-)
create mode 100644 lib/eal/common/eal_option_list.h
--
2.48.1
More information about the dev
mailing list