X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fshared%2Finterfaces.robot;h=b33baaf214d7ca8a4eaa1cf4a14176b9fb71edd9;hb=refs%2Fchanges%2F45%2F34045%2F14;hp=7d27ac563c3f367f7255c6425995f3eff044920e;hpb=1c1d5cbe67254f0457d8f27acb32882eded47b67;p=csit.git diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot index 7d27ac563c..b33baaf214 100644 --- a/resources/libraries/robot/shared/interfaces.robot +++ b/resources/libraries/robot/shared/interfaces.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 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: @@ -44,10 +44,17 @@ | | ... | *Set UP state on VPP interfaces in path on all DUT nodes and set | | ... | maximal MTU.* | | +| | ... | *Arguments:* +| | ... | - validate - Validate interfaces are up. +| | ... | Type: boolean +| | +| | [Arguments] | ${validate}=${True} +| | | | FOR | ${dut} | IN | @{duts} | | | Set interfaces in path up on node | ${dut} | | END -| | All VPP Interfaces Ready Wait | ${nodes} | retries=${60} +| | Run Keyword If | ${validate} +| | ... | All VPP Interfaces Ready Wait | ${nodes} | retries=${60} | Set interfaces in path up on node | | [Documentation] @@ -109,6 +116,18 @@ | | | | Run Keyword | Pre-initialize layer ${driver} on all DUTs +| Pre-initialize layer tap on all DUTs +| | [Documentation] +| | ... | Pre-initialize tap driver. Currently no operation. +| | +| | No operation + +| Pre-initialize layer vhost on all DUTs +| | [Documentation] +| | ... | Pre-initialize vhost driver. Currently no operation. +| | +| | No operation + | Pre-initialize layer vfio-pci on all DUTs | | [Documentation] | | ... | Pre-initialize vfio-pci driver by adding related sections to startup @@ -117,6 +136,9 @@ | | ${index}= | Get Index From List | ${TEST TAGS} | DPDK | | Run Keyword If | ${index} >= 0 | Return From Keyword | | FOR | ${dut} | IN | @{duts} +| | | Stop VPP Service | ${nodes['${dut}']} +| | | 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_no_tx_checksum_offload} | | | ... | ${dut}.Add DPDK No Tx Checksum Offload @@ -130,7 +152,8 @@ | | | 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 | ${thr_count_int} +| | | ... | ${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} @@ -143,15 +166,30 @@ | | | | No operation +| Pre-initialize layer af_xdp on all DUTs +| | [Documentation] +| | ... | Pre-initialize af_xdp driver. +| | +| | FOR | ${dut} | IN | @{duts} +| | | Set Interface State PCI +| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | state=up +| | | Set Interface Channels +| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | num_queues=${rxq_count_int} +| | | ... | channel=combined +| | END + | Pre-initialize layer rdma-core on all DUTs | | [Documentation] | | ... | Pre-initialize rdma-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=1518 +| | FOR | ${dut} | IN | @{duts} | | | Set Interface Flow Control -| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off" -| | | Set PCI Parameter -| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD" +| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off" | | END | Pre-initialize layer mlx5_core on all DUTs @@ -162,11 +200,9 @@ | | | 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 MTU | ${nodes['${dut}']} | ${${dut}_pf_pci} | mtu=1518 | | | Set Interface Flow Control -| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rx="off" | tx="off" -| | | Set PCI Parameter -| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | key="68.w" | value="3BCD" +| | | ... | ${nodes['${dut}']} | ${${dut}_pf_pci} | rxf="off" | txf="off" | | END | Initialize layer driver @@ -177,18 +213,20 @@ | | ... | *Arguments:* | | ... | - driver - NIC driver used in test [vfio-pci|avf|rdma-core]. | | ... | Type: string +| | ... | - validate - Validate interfaces are up. +| | ... | Type: boolean | | | | ... | *Example:* | | | | ... | \| Initialize layer driver \| vfio-pci \| | | -| | [Arguments] | ${driver} +| | [Arguments] | ${driver} | ${validate}=${True} | | | | FOR | ${dut} | IN | @{duts} | | | Initialize layer driver on node | ${dut} | ${driver} | | END | | Set Test Variable | ${int} | vf -| | Set interfaces in path up +| | Set interfaces in path up | validate=${validate} | Initialize layer driver on node | | [Documentation] @@ -234,6 +272,72 @@ | | | Run Keyword | Initialize layer ${driver} on node | ${dut} | ${pf} | | END +| Initialize layer tap on node +| | [Documentation] +| | ... | Initialize tap interfaces on DUT. +| | +| | ... | *Arguments:* +| | ... | - dut - DUT node. +| | ... | Type: string +| | ... | - pf - TAP ID (logical port). +| | ... | Type: integer +| | +| | ... | *Example:* +| | +| | ... | \| Initialize layer tap on node \| DUT1 \| 0 \| +| | +| | [Arguments] | ${dut} | ${pf} +| | +| | Create Namespace +| | ... | ${nodes['${dut}']} | tap${${pf}-1}_namespace +| | ${tap_feature_mask}= | Create Tap feature mask | gso=${enable_gso} +| | ${_tap}= +| | ... | And Add Tap Interface | ${nodes['${dut}']} | tap${${pf}-1} +| | ... | host_namespace=tap${${pf}-1}_namespace +| | ... | num_rx_queues=${rxq_count_int} +| | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size} +| | ... | tap_feature_mask=${tap_feature_mask} +| | ${_mac}= +| | ... | Get Interface MAC | ${nodes['${dut}']} | tap${pf} +| | ${_tap}= | Create List | ${_tap} +| | ${_mac}= | Create List | ${_mac} +| | Vhost User Affinity +| | ... | ${nodes['${dut}']} | ${${dut}_pf${pf}}[0] +| | ... | skip_cnt=${${CPU_CNT_MAIN}+${CPU_CNT_SYSTEM}+${cpu_count_int}} +| | Set Test Variable +| | ... | ${${dut}_vf${pf}} | ${_tap} +| | Set Test Variable +| | ... | ${${dut}_vf${pf}_mac} | ${_mac} + +| Initialize layer vhost on node +| | [Documentation] +| | ... | Initialize vhost interfaces on DUT. +| | +| | ... | *Arguments:* +| | ... | - dut - DUT node. +| | ... | Type: string +| | ... | - pf - VHOST ID (logical port). +| | ... | Type: integer +| | +| | ... | *Example:* +| | +| | ... | \| Initialize layer vhost on node \| DUT1 \| 0 \| +| | +| | [Arguments] | ${dut} | ${pf} +| | +| | ${virtio_feature_mask}= | Create Virtio feature mask | gso=${enable_gso} +| | ${vhost}= | Vpp Create Vhost User Interface +| | ... | ${nodes['${dut}']} | /var/run/vpp/sock-${pf}-1 +| | ... | is_server=${True} | virtio_feature_mask=${virtio_feature_mask} +| | ${_mac}= +| | ... | Get Interface MAC | ${nodes['${dut}']} | vhost${pf} +| | ${_vhost}= | Create List | ${_vhost} +| | ${_mac}= | Create List | ${_mac} +| | Set Test Variable +| | ... | ${${dut}_vf${pf}} | ${_vhost} +| | Set Test Variable +| | ... | ${${dut}_vf${pf}_mac} | ${_mac} + | Initialize layer vfio-pci on node | | [Documentation] | | ... | Initialize vfio-pci interfaces on DUT on NIC PF. @@ -288,6 +392,32 @@ | | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan} | | END +| Initialize layer af_xdp on node +| | [Documentation] +| | ... | Initialize AF_XDP (eBPF) interfaces on DUT on NIC PF. +| | +| | ... | *Arguments:* +| | ... | - dut - DUT node. Type: string +| | ... | - pf - NIC physical function (physical port). Type: integer +| | +| | ... | *Example:* +| | +| | ... | \| Initialize layer af_xdp on node \| DUT1 \| 1 \| +| | +| | [Arguments] | ${dut} | ${pf} +| | +| | ${_af_xdp}= | VPP Create AF XDP Interface +| | ... | ${nodes['${dut}']} | ${${dut}_vf${pf}}[0] +| | ... | num_rx_queues=${65535} +| | ... | rxq_size=${nic_rxq_size} | txq_size=${nic_txq_size} +| | ${cpu_skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM}+${CPU_CNT_MAIN} +| | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+${cpu_count_int} +| | ${cpu_skip_cnt}= | Evaluate | ${cpu_skip_cnt}+(${pf}-${1})*${rxq_count_int} +| | Set Interface IRQs Affinity +| | ... | ${nodes['${dut}']} | ${_af_xdp} +| | ... | cpu_skip_cnt=${cpu_skip_cnt} | cpu_cnt=${rxq_count_int} +| | Set List Value | ${${dut}_vf${pf}} | 0 | ${_af_xdp} + | Initialize layer rdma-core on node | | [Documentation] | | ... | Initialize rdma-core (Mellanox VPP) interfaces on DUT on NIC PF. @@ -413,9 +543,9 @@ | | ... | ${nodes['${dut}']} | ${bond_mode} | load_balance=${lb_mode} | | ... | mac=00:00:00:01:01:01 | | Set Interface State | ${nodes['${dut}']} | ${if_index} | up -| | VPP Enslave Physical Interface +| | VPP Add Bond Member | | ... | ${nodes['${dut}']} | ${${dut}_${int}1_1} | ${if_index} -| | VPP Enslave Physical Interface +| | VPP Add Bond Member | | ... | ${nodes['${dut}']} | ${${dut}_${int}2_1} | ${if_index} | | FOR | ${id} | IN RANGE | 1 | ${count} + 1 | | | Set Test Variable | ${${dut}_bond1_${id}} | ${if_index} @@ -500,7 +630,7 @@ | | | ... | dut=${dut} | pf=${pf} | id=${id} | vlan_per_chain=${vlan_per_chain} | | | # First id results in non-None indices, after that _1_ are defined. | | | ${_dot1q}= | Set Variable If | '${_dot1q}' == '${NONE}' -| | | ... | ${${dut}_dot1q${pf}_1} | ${_dot1q} +| | | ... | ${${dut}_dot1q${pf}_1}[0] | ${_dot1q} | | | ${_dot1q}= | Create List | ${_dot1q} | | | Set Test Variable | ${${dut}_dot1q${pf}_${id}} | ${_dot1q} | | END @@ -529,7 +659,7 @@ | | [Arguments] | ${dut} | ${pf} | ${id} | ${vlan_per_chain}=${True} | | | | Return From Keyword If | ${id} != ${1} and not ${vlan_per_chain} -| | ... | ${NONE} | ${NONE} +| | ... | ${NONE} | | ${_default}= | Evaluate | ${pf} * ${100} + ${id} - ${1} | | ${_vlan}= | Get Variable Value | \${${dut}_pf${pf}_vlan} | | ${_vlan}= | Set Variable If | '${_vlan}[0]' != '${NONE}' @@ -659,8 +789,8 @@ | | ... | Type: string | | ... | - ${is_server} - Server side of connection (Optional). | | ... | Type: boolean -| | ... | - ${enable_gso} - Generic segmentation offloading (Optional). -| | ... | Type: boolean +| | ... | - ${virtio_feature_mask} - Enabled Virtio feature flags (Optional). +| | ... | Type: integer | | | | ... | _NOTE:_ This KW sets following test case variable: | | ... | - ${${vhost_if1}} - First Vhost-User interface. @@ -673,14 +803,14 @@ | | | | [Arguments] | ${dut_node} | ${sock1} | ${sock2} | ${vhost_if1}=vhost_if1 | | ... | ${vhost_if2}=vhost_if2 | ${is_server}=${False} -| | ... | ${enable_gso}=${False} +| | ... | ${virtio_feature_mask}=${None} | | | | ${vhost_1}= | Vpp Create Vhost User Interface | | ... | ${dut_node} | ${sock1} | is_server=${is_server} -| | ... | enable_gso=${enable_gso} +| | ... | virtio_feature_mask=${virtio_feature_mask} | | ${vhost_2}= | Vpp Create Vhost User Interface | | ... | ${dut_node} | ${sock2} | is_server=${is_server} -| | ... | enable_gso=${enable_gso} +| | ... | virtio_feature_mask=${virtio_feature_mask} | | ${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}