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.
-
static
2.1.2. L3fwdTest suite¶
This module exists to start l3fwd on topology nodes.
-
class
resources.libraries.python.DPDK.L3fwdTest.
L3fwdTest
¶ Bases:
object
This class start l3fwd on topology nodes and check if properly started.
-
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.
-
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).
-
static
start_l3fwd_on_all_duts
(nodes, topology_info, phy_cores, rx_queues=None, jumbo_frames=False, rxd=None, txd=None)¶ Execute the l3fwd on all dut nodes.
- Parameters
nodes (dict) – All the nodes info from the topology file.
topology_info (dict) – All the info from the topology file.
phy_cores (int) – Number of physical cores to use.
rx_queues (int) – Number of RX queues.
jumbo_frames (bool) – Jumbo frames on/off.
rxd (int) – Number of RX descriptors.
txd (int) – Number of TX descriptors.
- Raises
RuntimeError – If bash return code is not 0.
-
static
2.1.3. TestpmdTest suite¶
This module exists to start testpmd on topology nodes.
-
class
resources.libraries.python.DPDK.TestpmdTest.
TestpmdTest
¶ Bases:
object
This class start testpmd on topology nodes and check if properly started.
-
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.
-
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 (int) – 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.
-
static
start_testpmd_on_all_duts
(nodes, topology_info, phy_cores, rx_queues=None, jumbo_frames=False, rxd=None, txd=None, nic_rxq_size=None, nic_txq_size=None)¶ Start the testpmd with M worker threads and rxqueues N and jumbo support frames on/off on all DUTs.
- Parameters
nodes (dict) – All the nodes info from the topology file.
topology_info (dict) – All the info from the topology file.
phy_cores (int) – Number of physical cores to use.
rx_queues (int) – Number of RX queues.
jumbo_frames (bool) – Jumbo frames on/off.
rxd (int) – Number of RX descriptors.
txd (int) – Number of TX descriptors.
nic_rxq_size (int) – RX queue size.
nic_txq_size (int) – TX queue size.
- Raises
RuntimeError – If bash return code is not 0.
-
static