perf: hoststack iperf3 test tuning
[csit.git] / resources / libraries / robot / shared / interfaces.robot
index 3d2b70d..1639488 100644 (file)
 | Library | resources.libraries.python.NodePath
 | Library | resources.libraries.python.VhostUser
 
+*** Variables ***
+| ${dpdk_no_tx_checksum_offload}= | ${True}
+
 *** Keywords ***
 | Set interfaces in path up
 | | [Documentation]
 | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set
 | | ... | maximal MTU.*
 | |
+| | FOR | ${dut} | IN | @{duts}
+| | | Set interfaces in path up on DUT | ${dut}
+| | END
+| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
+
+| Set interfaces in path up on DUT
+| | [Documentation]
+| | ... | *Set UP state on VPP interfaces in path on specified DUT node and
+| | ... | set maximal MTU.*
+| |
+| | ... | *Arguments:*
+| | ... | - dut - DUT node on which to set the interfaces up.
+| | ... | Type: string
+| |
+| | ... | *Example:*
+| |
+| | ... | \| Set interfaces in path up on DUT \| DUT1 \|
+| |
+| | [Arguments] | ${dut}
 # TODO: Rework KW to set all interfaces in path UP and set MTU (including
 # software interfaces. Run KW at the start phase of VPP setup to split
 # from other "functional" configuration. This will allow modularity of this
 # library
-| | FOR | ${dut} | IN | @{duts}
-| | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
-| | | ... | Variable Should Exist | ${${dut}_if1}
-| | | Run Keyword If | '${if1_status}' == 'PASS'
-| | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
-| | | ... | ELSE
-| | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
-| | | Run Keyword Unless | '${if1_status}' == 'PASS'
-| | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
-| | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
-| | | ... | Variable Should Exist | ${${dut}_if2}
-| | | Run Keyword If | '${if2_status}' == 'PASS'
-| | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2} | up
-| | | ... | ELSE
-| | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_1} | up
-| | | Run Keyword Unless | '${if2_status}' == 'PASS'
-| | | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_2} | up
-| | END
-| | FOR | ${dut} | IN | @{duts}
-| | | ${if1_status} | ${value}= | Run Keyword And Ignore Error
-| | | ... | Variable Should Exist | ${${dut}_if1}
-| | | Run Keyword If | '${if1_status}' == 'PASS'
-| | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
-| | | ... | ELSE
-| | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
-| | | Run Keyword Unless | '${if1_status}' == 'PASS'
-| | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
-| | | ${if2_status} | ${value}= | Run Keyword And Ignore Error
-| | | ... | Variable Should Exist | ${${dut}_if2}
-| | | Run Keyword If | '${if2_status}' == 'PASS'
-| | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2}
-| | | ... | ELSE
-| | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_1}
-| | | Run Keyword Unless | '${if2_status}' == 'PASS'
-| | | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_2}
-| | END
-| | All VPP Interfaces Ready Wait | ${nodes} | retries=${300}
+| | ${if1_status} | ${value}= | Run Keyword And Ignore Error
+| | ... | Variable Should Exist | ${${dut}_if1}
+| | Run Keyword If | '${if1_status}' == 'PASS'
+| | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1} | up
+| | ... | ELSE
+| | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_1} | up
+| | Run Keyword Unless | '${if1_status}' == 'PASS'
+| | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if1_2} | up
+| | ${if2_status} | ${value}= | Run Keyword And Ignore Error
+| | ... | Variable Should Exist | ${${dut}_if2}
+| | Run Keyword If | '${if2_status}' == 'PASS'
+| | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2} | up
+| | ... | ELSE
+| | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_1} | up
+| | Run Keyword Unless | '${if2_status}' == 'PASS'
+| | ... | Set Interface State | ${nodes['${dut}']} | ${${dut}_if2_2} | up
+| | ${if1_status} | ${value}= | Run Keyword And Ignore Error
+| | ... | Variable Should Exist | ${${dut}_if1}
+| | Run Keyword If | '${if1_status}' == 'PASS'
+| | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1}
+| | ... | ELSE
+| | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_1}
+| | Run Keyword Unless | '${if1_status}' == 'PASS'
+| | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if1_2}
+| | ${if2_status} | ${value}= | Run Keyword And Ignore Error
+| | ... | Variable Should Exist | ${${dut}_if2}
+| | Run Keyword If | '${if2_status}' == 'PASS'
+| | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2}
+| | ... | ELSE
+| | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_1}
+| | Run Keyword Unless | '${if2_status}' == 'PASS'
+| | ... | VPP Set Interface MTU | ${nodes['${dut}']} | ${${dut}_if2_2}
 
 | Set single interfaces in path up
 | | [Documentation]
 | |
 | | Add DPDK pci devices to all DUTs
 | | FOR | ${dut} | IN | @{duts}
-| | | Run Keyword | ${dut}.Add DPDK No Tx Checksum Offload
+| | | Run Keyword If | ${dpdk_no_tx_checksum_offload}
+| | | ... | ${dut}.Add DPDK No Tx Checksum Offload
 | | | Run Keyword | ${dut}.Add DPDK Log Level | debug
 | | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci
 | | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int}
 | | ${if2_vlan}= | Get Interface Vlan | ${nodes['${dut}']} | ${${dut}_if2}
 | | Set Test Variable | ${${dut_str}_vlan1} | ${if1_vlan}
 | | Set Test Variable | ${${dut_str}_vlan2} | ${if2_vlan}
-| | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
-| | ... | ${${dut}_if1_vf0}
-| | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
-| | ... | ${${dut}_if2_vf0}
 | | ${dut_new_if1}= | VPP Create AVF Interface | ${nodes['${dut}']}
-| | ... | ${if1_pci} | ${rxq_count_int}
+| | ... | ${${dut}_if1_vf0} | ${rxq_count_int}
 | | ${dut_new_if1_mac}= | Get Interface MAC | ${nodes['${dut}']}
 | | ... | ${dut_new_if1}
 | | ${dut_new_if2}= | VPP Create AVF Interface | ${nodes['${dut}']}
-| | ... | ${if2_pci} | ${rxq_count_int}
+| | ... | ${${dut}_if2_vf0} | ${rxq_count_int}
 | | ${dut_new_if2_mac}= | Get Interface MAC | ${nodes['${dut}']}
 | | ... | ${dut_new_if2}
 | | Set Test Variable | ${${dut_str}_if1} | ${dut_new_if1}
 | | ${if2_vlan}= | Get Interface Vlan | ${nodes['${dut}']} | ${${dut}_if2}
 | | Set Test Variable | ${${dut_str}_vlan1} | ${if1_vlan}
 | | Set Test Variable | ${${dut_str}_vlan2} | ${if2_vlan}
-| | ${if1_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
-| | ... | ${${dut}_if1}
-| | ${if2_pci}= | Get Interface PCI Addr | ${nodes['${dut}']}
-| | ... | ${${dut}_if2}
 | | ${dut_new_if1}= | VPP Create Rdma Interface | ${nodes['${dut}']}
-| | ... | ${if1_pci} | ${rxq_count_int}
+| | ... | ${${dut}_if1} | ${rxq_count_int}
 | | ${dut_new_if1_mac}= | Get Interface MAC | ${nodes['${dut}']}
 | | ... | ${dut_new_if1}
 | | ${dut_new_if2}= | VPP Create Rdma Interface | ${nodes['${dut}']}
-| | ... | ${if2_pci} | ${rxq_count_int}
+| | ... | ${${dut}_if2} | ${rxq_count_int}
 | | ${dut_new_if2_mac}= | Get Interface MAC | ${nodes['${dut}']}
 | | ... | ${dut_new_if2}
 | | Set Test Variable | ${${dut_str}_if1} | ${dut_new_if1}
 | | ... | Type: string
 | | ... | - ${vhost_if2} - Name of the second Vhost-User interface (Optional).
 | | ... | Type: string
+| | ... | - ${is_server} - Server side of connection (Optional).
+| | ... | Type: boolean
+| | ... | - ${enable_gso} - Generic segmentation offloading (Optional).
+| | ... | Type: boolean
 | |
 | | ... | _NOTE:_ This KW sets following test case variable:
 | | ... | - ${${vhost_if1}} - First Vhost-User interface.
 | | ... | \| dut2_vhost_if2 \|
 | |
 | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1
-| | ... | ${vhost_if2}=vhost_if2
-| |
-| | ${vhost_1}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock1}
-| | ${vhost_2}= | Vpp Create Vhost User Interface | ${dut_node} | ${sock2}
+| | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False}
+| | ... | ${enable_gso}=${False}
+| |
+| | ${vhost_1}= | Vpp Create Vhost User Interface
+| | ... | ${dut_node} | ${sock1} | is_server=${is_server}
+| | ... | enable_gso=${enable_gso}
+| | ${vhost_2}= | Vpp Create Vhost User Interface
+| | ... | ${dut_node} | ${sock2} | is_server=${is_server}
+| | ... | enable_gso=${enable_gso}
 | | ${vhost_1_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_1}
 | | ${vhost_2_key}= | Get Interface By SW Index | ${dut_node} | ${vhost_2}
 | | ${vhost_1_mac}= | Get Interface MAC | ${dut_node} | ${vhost_1_key}