2.1. DPDK

2.1.1. DPDKTools suite

This module implements initialization and cleanup of DPDK framework.

class resources.libraries.python.DPDK.DPDKTools.DPDKTools

Bases: object

This class implements: - Initialization of DPDK environment, - Cleanup of DPDK environment.

static cleanup_dpdk_framework(node, if1, if2)

Cleanup the DPDK framework on the DUT node. Bind interfaces to default driver specified in topology.

Parameters
  • node (dict) – Will cleanup the DPDK on this node.

  • if1 (str) – DUT first interface name.

  • if2 (str) – DUT second interface name.

Raises

RuntimeError – If it fails to cleanup the dpdk.

static get_dpdk_version(node)

Log and return the installed DPDK version.

The logged string ends with newline, the returned one is stripped.

Parameters

node (dict) – Node from topology file.

Returns

Stripped DPDK version string.

Return type

str

Raises

RuntimeError – If command returns nonzero return code.

static initialize_dpdk_framework(node, if1, if2, nic_driver)

Initialize the DPDK framework on the DUT node. Bind interfaces to driver.

Parameters
  • node (dict) – DUT node.

  • if1 (str) – DUT first interface name.

  • if2 (str) – DUT second interface name.

  • nic_driver (str) – Interface driver.

Raises

RuntimeError – If it fails to bind the interfaces to driver.

static install_dpdk_framework(node)

Prepare the DPDK framework on the DUT node.

Parameters

node (dict) – Node from topology file.

Raises

RuntimeError – If command returns nonzero return code.

static install_dpdk_framework_on_all_duts(nodes)

Prepare the DPDK framework on all DUTs.

Parameters

nodes (dict) – Nodes from topology file.

2.1.2. L3fwdCheck suite

class resources.libraries.python.DPDK.L3fwdCheck.L3fwdCheck

Bases: object

Test the DPDK l3fwd is ready.

static check_l3fwd(node)

Execute the l3fwd check on the DUT node.

Parameters

node (dict) – DUT node.

Raises

RuntimeError – If the script “check_l3fwd.sh” fails.

2.1.3. L3fwdTest suite

This module exists to provide the l3fwd test for DPDK on topology nodes.

class resources.libraries.python.DPDK.L3fwdTest.L3fwdTest

Bases: object

Test the DPDK l3fwd performance.

static get_adj_mac(nodes, node, if1, if2)

Get adjacency MAC addresses of the DUT node.

Parameters
  • nodes (dict) – All the nodes info in the topology file.

  • node (dict) – DUT node.

  • if1 (str) – The test link interface 1.

  • if2 (str) – The test link interface 2.

Returns

Returns MAC addresses of adjacency DUT nodes and PCI addresses.

Return type

str

static patch_l3fwd(node, patch)

Patch l3fwd application and recompile.

Parameters
  • node (dict) – DUT node.

  • patch (str) – Patch to apply.

Raises

RuntimeError – Patching of l3fwd failed.

static start_l3fwd(nodes, node, if1, if2, lcores_list, nb_cores, queue_nums, jumbo_frames)

Execute the l3fwd on the dut_node.

Parameters
  • nodes (dict) – All the nodes info in the topology file.

  • node (dict) – DUT node.

  • if1 (str) – The test link interface 1.

  • if2 (str) – The test link interface 2.

  • lcores_list (str) – The lcore list string for the l3fwd routing

  • nb_cores (str) – The cores number for the forwarding

  • queue_nums (str) – The queues number for the NIC

  • jumbo_frames (bool) – Indication if the jumbo frames are used (True) or not (False).

2.1.4. TestpmdCheck suite

class resources.libraries.python.DPDK.TestpmdCheck.TestpmdCheck

Bases: object

Test the DPDK testpmd is ready.

static check_testpmd(node)

Execute the testpmd check on the DUT node.

Parameters

node (dict) – DUT node.

Raises

RuntimeError – If the script “check_testpmd.sh” fails.

2.1.5. TestpmdTest suite

This module implements functionality which sets L2 forwarding for DPDK on DUT nodes.

class resources.libraries.python.DPDK.TestpmdTest.TestpmdTest

Bases: object

Setup the DPDK for testpmd performance test.

static start_testpmd(node, if1, if2, lcores_list, nb_cores, queue_nums, jumbo_frames, rxq_size=1024, txq_size=1024)

Execute the testpmd on the DUT node.

Parameters
  • node (dict) – DUT node.

  • if1 (str) – The test link interface 1.

  • if2 (str) – The test link interface 2.

  • lcores_list (str) – The DPDK run cores.

  • nb_cores (str) – The cores number for the forwarding.

  • queue_nums (str) – The queues number for the NIC.

  • jumbo_frames (bool) – Indication if the jumbo frames are used (True) or not (False).

  • rxq_size (int) – RXQ size. Default=1024.

  • txq_size (int) – TXQ size. Default=1024.

Raises

RuntimeError – If the script “run_testpmd.sh” fails.