@@ -29,8 +29,7 @@ nodes:
user: dtsuser
arch: x86_64
os: linux
- lcores: "" # use all the available logical cores
- use_first_core: false # tells DPDK to use any physical core
+ lcores: "" # use all available logical cores (Skips first core)
memory_channels: 4 # tells DPDK to use 4 memory channels
hugepages_2mb: # optional; if removed, will use system hugepage configuration
number_of: 256
@@ -246,6 +246,9 @@ def from_dict(
hugepage_config_dict["force_first_numa"] = False
hugepage_config = HugepageConfiguration(**hugepage_config_dict)
+ lcores = "1" if "lcores" not in d else d["lcores"] if "any" not in d["lcores"] else ""
+ use_first_core = "0" in lcores
+
# The calls here contain duplicated code which is here because Mypy doesn't
# properly support dictionary unpacking with TypedDicts
if "traffic_generator" in d:
@@ -256,8 +259,8 @@ def from_dict(
password=d.get("password"),
arch=Architecture(d["arch"]),
os=OS(d["os"]),
- lcores=d.get("lcores", "1"),
- use_first_core=d.get("use_first_core", False),
+ lcores=lcores,
+ use_first_core=use_first_core,
hugepages=hugepage_config,
ports=[PortConfig.from_dict(d["name"], port) for port in d["ports"]],
traffic_generator=TrafficGeneratorConfig.from_dict(d["traffic_generator"]),
@@ -270,8 +273,8 @@ def from_dict(
password=d.get("password"),
arch=Architecture(d["arch"]),
os=OS(d["os"]),
- lcores=d.get("lcores", "1"),
- use_first_core=d.get("use_first_core", False),
+ lcores=lcores,
+ use_first_core=use_first_core,
hugepages=hugepage_config,
ports=[PortConfig.from_dict(d["name"], port) for port in d["ports"]],
memory_channels=d.get("memory_channels", 1),
@@ -163,13 +163,9 @@
},
"lcores": {
"type": "string",
- "pattern": "^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+)))*)?$",
+ "pattern": "^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+)))*)?$|any",
"description": "Optional comma-separated list of logical cores to use, e.g.: 1,2,3,4,5,18-22. Defaults to 1. An empty string means use all lcores."
},
- "use_first_core": {
- "type": "boolean",
- "description": "Indicate whether DPDK should use the first physical core. It won't be used by default."
- },
"memory_channels": {
"type": "integer",
"description": "How many memory channels to use. Optional, defaults to 1."
@@ -86,6 +86,15 @@ def __init__(self, node_config: NodeConfiguration):
self.lcores, LogicalCoreList(self.config.lcores)
).filter()
+ if LogicalCore(lcore=0, core=0, socket=0, node=0) in self.lcores:
+ self._logger.info(
+ """
+ WARNING: First core being used;
+ using the first core is considered risky and should only
+ be done by advanced users.
+ """
+ )
+
self._other_sessions = []
self._init_ports()