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.

get_app(app_name: str) PurePath

Retrieve path for a DPDK app.

property remote_dpdk_tree_path: 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:

DPDKBuildInfo

class DPDKRuntimeEnvironment

Bases: object

Class handling a DPDK runtime environment.

__init__(config: DPDKRuntimeConfiguration, node: Node, build_env: framework.remote_session.dpdk.DPDKBuildEnvironment | None = None)

DPDK environment constructor.

Parameters:
setup()

Set up the DPDK runtime on the target node.

teardown() 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:

CommandResult

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. If False, 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:

list[framework.testbed_model.cpu.LogicalCore]

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.