dpdk - DPDK Environments
DPDK environment.
- class DPDKBuildInfo
Bases:
object
Various versions and other information about a DPDK build.
- dpdk_version
The DPDK version that was built.
- Type:
str | None
- compiler_version
The version of the compiler used to build DPDK.
- Type:
str | None
- __init__(dpdk_version: str | None, compiler_version: str | None) None
- class DPDKBuildEnvironment
Bases:
object
Class handling a DPDK build environment.
- __init__(config: framework.config.test_run.DPDKPrecompiledBuildConfiguration | framework.config.test_run.DPDKUncompiledBuildConfiguration, node: Node)
DPDK build environment class constructor.
- setup()
Set up the DPDK build on the target node.
DPDK setup includes setting all internals needed for the build, the copying of DPDK sources and then building DPDK or using the exist ones from the dpdk_location. The drivers are bound to those that DPDK needs.
- teardown() None
Teardown the DPDK build on the target node.
Removes the DPDK tree and/or build directory/tarball depending on the configuration.
- build_dpdk_app(app_name: str, **meson_dpdk_args: str | bool) PurePath
Build one or all DPDK apps.
Requires DPDK to be already built on the SUT node.
- Parameters:
app_name (str) – The name of the DPDK app to build. When app_name is
all
, build all example apps.meson_dpdk_args (str | bool) – The arguments found in
meson_options.txt
in root DPDK directory. Do not use-D
with them.
- Returns:
The directory path of the built app. If building all apps, return the path to the examples directory (where all apps reside).
- Return type:
PurePath
- property remote_dpdk_tree_path: str | pathlib.PurePath
The remote DPDK tree path.
- property remote_dpdk_build_dir: str | pathlib.PurePath
The remote DPDK build dir path.
- property dpdk_version: str | None
Last built DPDK version.
- get_dpdk_build_info() DPDKBuildInfo
Get additional DPDK build information.
- Returns:
The DPDK build information,
- Return type:
- class DPDKRuntimeEnvironment
Bases:
object
Class handling a DPDK runtime environment.
- __init__(config: DPDKRuntimeConfiguration, node: Node, build_env: DPDKBuildEnvironment)
DPDK environment constructor.
- Parameters:
config (DPDKRuntimeConfiguration) – The configuration of DPDK.
node (Node) – The target node to manage a DPDK environment.
build_env (DPDKBuildEnvironment) – The DPDK build environment.
- setup(ports: Iterable[Port])
Set up the DPDK runtime on the target node.
- teardown(ports: Iterable[Port]) None
Reset DPDK variables and bind port driver to the OS driver.
- run_dpdk_app(app_path: PurePath, eal_params: EalParams, timeout: float = 30) CommandResult
Run DPDK application on the remote node.
The application is not run interactively - the command that starts the application is executed and then the call waits for it to finish execution.
- Parameters:
app_path (PurePath) – The remote path to the DPDK application.
eal_params (EalParams) – EAL parameters to run the DPDK application with.
timeout (float) – Wait at most this long in seconds for command execution to complete.
- Returns:
The result of the DPDK app execution.
- Return type:
- bind_ports_to_driver(ports: Iterable[Port], for_dpdk: bool = True) None
Bind all ports on the SUT to a driver.
- Parameters:
ports (Iterable[Port]) – The ports to act on.
for_dpdk (bool) – If
True
, binds ports to os_driver_for_dpdk. IfFalse
, binds to os_driver.
- property devbind_script_path: PurePath
The path to the dpdk-devbind.py script on the node.
- filter_lcores(filter_specifier: framework.testbed_model.cpu.LogicalCoreCount | framework.testbed_model.cpu.LogicalCoreList, ascending: bool = True) list[framework.testbed_model.cpu.LogicalCore]
Filter the node’s logical cores that DTS can use.
Logical cores that DTS can use are the ones that are present on the node, but filtered according to the test run configuration. The filter_specifier will filter cores from those logical cores.
- Parameters:
filter_specifier (framework.testbed_model.cpu.LogicalCoreCount | framework.testbed_model.cpu.LogicalCoreList) – Two different filters can be used, one that specifies the number of logical cores per core, cores per socket and the number of sockets, and another one that specifies a logical core list.
ascending (bool) – If
True
, use cores with the lowest numerical id first and continue in ascending order. IfFalse
, start with the highest id and continue in descending order. This ordering affects which sockets to consider first as well.
- Returns:
The filtered logical cores.
- Return type:
- kill_cleanup_dpdk_apps() None
Kill all dpdk applications on the SUT, then clean up hugepages.
- get_virtual_devices() Iterable[VirtualDevice]
The available DPDK virtual devices.