[PATCH v5 3/3] doc: provide examples of using lcores EAL parameter
Bruce Richardson
bruce.richardson at intel.com
Tue May 27 17:29:13 CEST 2025
The "--lcores" EAL parameter has a very powerful syntax that can be used
to provide precise control over lcore mappings. The docs however, only
provided a minimal description of what it can do. Augment the docs by
providing some examples of use of the option, and what the resulting
core mappings would be.
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
---
doc/guides/linux_gsg/eal_args.include.rst | 32 +++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/doc/guides/linux_gsg/eal_args.include.rst b/doc/guides/linux_gsg/eal_args.include.rst
index 01fe6a3006..2fc03594e5 100644
--- a/doc/guides/linux_gsg/eal_args.include.rst
+++ b/doc/guides/linux_gsg/eal_args.include.rst
@@ -23,6 +23,38 @@ Lcore-related options
The grouping ``()`` can be omitted for single element group.
The ``@`` can be omitted if cpus and lcores have the same value.
+ Examples:
+
+ ``--lcores=1-3``: Run threads on physical CPUs 1, 2 and 3,
+ with each thread having the same lcore id as the physical CPU id.
+
+ ``--lcores=1@(1,2)``: Run a single thread with lcore id 1,
+ but with that thread bound to both physical CPUs 1 and 2,
+ so it can run on either, as determined by the operating system.
+
+ ``--lcores=1 at 31,2 at 32,3 at 33``: Run threads having internal lcore ids of 1, 2 and 3,
+ but with the threads being bound to physical CPUs 31, 32 and 33 respectively.
+
+ ``--lcores='(1-3)@(31-33)'``: Run three threads with lcore ids 1, 2 and 3.
+ Unlike the previous example above,
+ each of these threads is not bound to one specific physical CPU,
+ but rather, all three threads are instead bound to the three physical CPUs 31, 32 and 33.
+ This means that each of the three threads can move between the physical CPUs 31-33,
+ as decided by the OS as the application runs.
+
+ ``--lcores='(1-3)@20'``: Run three threads, with lcore ids 1, 2 and 3,
+ where all three threads are bound to (can only run on) physical CPU 20.
+
+.. Note::
+ Binding multiple DPDK lcores to a single physical CPU can cause problems with poor performance
+ or deadlock when using DPDK rings or memory pools or spinlocks.
+ Such a configuration should only be used with care.
+
+.. Note::
+ As shown in the examples above, and depending on the shell in use,
+ it is sometimes necessary to enclose the lcores parameter value in quotes,
+ for example, when the parameter value starts with a ``(`` character.
+
.. Note::
At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can
be used.
--
2.48.1
More information about the dev
mailing list