X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=resources%2Flibraries%2Frobot%2Fshared%2Finterfaces.robot;h=0c669247d63f8683ace9f3152c82d7d9a0b35890;hb=HEAD;hp=1a7b32ea00a68a7b56a9d12485ea5b5fd2340d98;hpb=a275fa0062158d712152f542b7bc9ec40b5c5f31;p=csit.git diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot index 1a7b32ea00..b4d6959d01 100644 --- a/resources/libraries/robot/shared/interfaces.robot +++ b/resources/libraries/robot/shared/interfaces.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2024 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -16,13 +16,14 @@ | Library | resources.libraries.python.VhostUser *** Variables *** +| ${dpdk_enable_tcp_udp_checksum}= | ${False} | ${dpdk_no_tx_checksum_offload}= | ${True} *** Keywords *** | Set single interfaces in path up | | [Documentation] | | ... | *Set UP state on single physical VPP interfaces in path on all DUT -| | ... | nodes and set maximal MTU.* +| | ... | nodes.* | | | | ... | *Arguments:* | | ... | - pf - NIC physical function (physical port). @@ -41,8 +42,7 @@ | Set interfaces in path up | | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set -| | ... | maximal MTU.* +| | ... | *Set UP state on VPP interfaces in path on all DUT nodes.* | | | | ... | *Arguments:* | | ... | - validate - Validate interfaces are up. @@ -58,8 +58,7 @@ | Set interfaces in path up on node | | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on specified DUT node and -| | ... | set maximal MTU.* +| | ... | *Set UP state on VPP interfaces in path on specified DUT node.* | | | | ... | *Arguments:* | | ... | - dut - DUT node on which to set the interfaces up. @@ -77,8 +76,7 @@ | Set interfaces in path up on node on PF | | [Documentation] -| | ... | *Set UP state on VPP interfaces in path on specified DUT node and -| | ... | set maximal MTU.* +| | ... | *Set UP state on VPP interfaces in path on specified DUT node.* | | | | ... | *Arguments:* | | ... | - dut - DUT node on which to set the interfaces up. @@ -97,7 +95,6 @@ | | ${_id}= | Set Variable If | '${_chains}' == 'PASS' | _1 | ${EMPTY} | | FOR | ${if} | IN | @{${dut}_${int}${pf}${_id}} | | | Set Interface State | ${nodes['${dut}']} | ${if} | up -| | | VPP Set Interface MTU | ${nodes['${dut}']} | ${if} | | END | Pre-initialize layer driver @@ -137,13 +134,22 @@ | | Run Keyword If | ${index} >= 0 | Return From Keyword | | FOR | ${dut} | IN | @{duts} | | | Stop VPP Service | ${nodes['${dut}']} -| | | PCI Driver Unbind List | ${nodes['${dut}']} | @{${dut}_pf_pci} +| | | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci | +| | | ... | @{${dut}_pf_pci} | | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci} +| | | Run Keyword If | ${dpdk_enable_tcp_udp_checksum} +| | | ... | ${dut}.Add DPDK Enable TCP UDP Checksum | | | 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} +| | | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-100G' +| | | ... | ${dut}.Add DPDK Dev Default Devargs | +| | | ... | "normal_llq_hdr=1,enable_llq=1,control_path_poll_interval=0" +| | | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-200G' +| | | ... | ${dut}.Add DPDK Dev Default Devargs | +| | | ... | "normal_llq_hdr=1,enable_llq=1,control_path_poll_interval=0" | | | Run Keyword If | not ${jumbo} | | | ... | ${dut}.Add DPDK No Multi Seg | | | Run Keyword If | ${nic_rxq_size} > 0 @@ -154,10 +160,6 @@ | | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int} | | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT} | | END -| | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error -| | ... | Variable Should Exist | ${vlan_strip_off} -| | Run keyword If | '${_vlan_strip}' == 'PASS' and ${duts_count} == 2 -| | ... | Add DPDK VLAN strip offload switch off between DUTs | Pre-initialize layer avf on all DUTs | | [Documentation] @@ -172,6 +174,8 @@ | | FOR | ${dut} | IN | @{duts} | | | Set Interface State PCI | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | state=up +| | | Set Interface XDP off +| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | | | Set Interface Channels | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | num_queues=${rxq_count_int} | | | ... | channel=combined @@ -182,10 +186,10 @@ | | ... | Pre-initialize rdma-core driver. | | | | FOR | ${dut} | IN | @{duts} +| | | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} +| | | ... | mtu=${recommended_mtu} | | | Set Interface Flow Control | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off" -| | | Set PCI Parameter -| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD" | | END | Pre-initialize layer mlx5_core on all DUTs @@ -193,14 +197,28 @@ | | ... | Pre-initialize mlx5_core driver. | | | | FOR | ${dut} | IN | @{duts} -| | | Run Keyword If | ${jumbo} -| | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=9200 -| | | ... | ELSE -| | | ... | Set Interface MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1500 | | | Set Interface Flow Control | | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off" -| | | Set PCI Parameter -| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD" +| | END +| | ${index}= | Get Index From List | ${TEST TAGS} | DPDK +| | Run Keyword If | ${index} >= 0 | Return From Keyword +| | FOR | ${dut} | IN | @{duts} +| | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci} +| | | Run Keyword If | ${dpdk_enable_tcp_udp_checksum} +| | | ... | ${dut}.Add DPDK Enable TCP UDP Checksum +| | | 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 Dev Default RXQ | ${rxq_count_int} +| | | Run Keyword If | not ${jumbo} +| | | ... | ${dut}.Add DPDK No Multi Seg +| | | Run Keyword If | ${nic_rxq_size} > 0 +| | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size} +| | | Run Keyword If | ${nic_txq_size} > 0 +| | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size} +| | | Run Keyword If | '${crypto_type}' != '${None}' +| | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int} +| | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT} | | END | Initialize layer driver @@ -339,7 +357,7 @@ | Initialize layer vfio-pci on node | | [Documentation] | | ... | Initialize vfio-pci interfaces on DUT on NIC PF. -| | ... | Currently no operation. +| | ... | Currently just set MTU to the recommended value. | | | | ... | *Arguments:* | | ... | - dut - DUT node. Type: string @@ -351,7 +369,9 @@ | | | | [Arguments] | ${dut} | ${pf} | | -| | No operation +| | Set Interface State | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | down +| | VPP Set Interface MTU +| | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | mtu=${recommended_mtu} | Initialize layer avf on node | | [Documentation] @@ -439,9 +459,21 @@ | Initialize layer mlx5_core on node | | [Documentation] | | ... | Initialize mlx5_core interfaces on DUT on NIC PF. -| | ... | Currently no operation. +| | ... | Currently just set MTU to the recommended value. | | -| | No operation +| | ... | *Arguments:* +| | ... | - dut - DUT node. Type: string +| | ... | - pf - NIC physical function (physical port). Type: integer +| | +| | ... | *Example:* +| | +| | ... | \| Initialize layer rdma-core on node \| DUT1 \| 1 \| +| | +| | [Arguments] | ${dut} | ${pf} +| | +| | Set Interface State | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | down +| | VPP Set Interface MTU +| | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] | mtu=${recommended_mtu} | Initialize layer interface | | [Documentation] @@ -831,3 +863,23 @@ | | | | ${vhost_dump}= | Vhost User Dump | ${dut} | | Return From Keyword | ${vhost_dump} + +| Lower DUT1-DUT2 MTU For Fragmentation +| | [Documentation] | Set lower MTU on both ends of DUT1-DUT2 link. +| | +| | ... | This should force VPP to fragment (and reassembly) packets. +| | ... | Should be called after Initialize Layer Interface. +| | ... | Suite variables such as \${dut2_if1} should be defined by then. +| | +| | ... | As VPP (at least dpdk plugin) require interface to be down +| | ... | before MTU can be changed, interfaces are temporarily downed. +| | +| | # TODO: ip_reassembly_set to increase max_reassembly_length so jumbo passes. +| | Set Interface State | ${nodes['DUT1']} | ${dut1_if2} | down +| | Set Interface State | ${nodes['DUT2']} | ${dut2_if1} | down +| | VPP Set Interface MTU +| | ... | ${nodes['DUT1']} | ${dut1_if2} | ${MTU_FOR_FRAGMENTATION} +| | VPP Set Interface MTU +| | ... | ${nodes['DUT2']} | ${dut2_if1} | ${MTU_FOR_FRAGMENTATION} +| | Set Interface State | ${nodes['DUT1']} | ${dut1_if2} | up +| | Set Interface State | ${nodes['DUT2']} | ${dut2_if1} | up