diff options
Diffstat (limited to 'resources/libraries')
4 files changed, 291 insertions, 32 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py index 6de17d10d9..279f9a0e25 100644 --- a/resources/libraries/python/InterfaceUtil.py +++ b/resources/libraries/python/InterfaceUtil.py @@ -711,18 +711,18 @@ class InterfaceUtil(object): """Create VLAN sub-interface on node. :param node: Node to add VLAN subinterface on. - :param interface: Interface name on which create VLAN subinterface. + :param interface: Interface name or index on which create VLAN + subinterface. :param vlan: VLAN ID of the subinterface to be created. :type node: dict - :type interface: str + :type interface: str on int :type vlan: int :returns: Name and index of created subinterface. :rtype: tuple :raises RuntimeError: if it is unable to create VLAN subinterface on the - node. + node or interface cannot be converted. """ - iface_key = Topology.get_interface_by_name(node, interface) - sw_if_index = Topology.get_interface_sw_index(node, iface_key) + sw_if_index = InterfaceUtil.get_interface_index(node, interface) cmd = 'create_vlan_subif' args = dict(sw_if_index=sw_if_index, @@ -782,6 +782,33 @@ class InterfaceUtil(object): return sw_if_index @staticmethod + def set_vxlan_bypass(node, interface=None): + """Add the 'ip4-vxlan-bypass' graph node for a given interface. + + By adding the IPv4 vxlan-bypass graph node to an interface, the node + checks for and validate input vxlan packet and bypass ip4-lookup, + ip4-local, ip4-udp-lookup nodes to speedup vxlan packet forwarding. + This node will cause extra overhead to for non-vxlan packets which is + kept at a minimum. + + :param node: Node where to set VXLAN bypass. + :param interface: Numeric index or name string of a specific interface. + :type node: dict + :type interface: int or str + :raises RuntimeError: if it failed to set VXLAN bypass on interface. + """ + sw_if_index = InterfaceUtil.get_interface_index(node, interface) + + cmd = 'sw_interface_set_vxlan_bypass' + args = dict(is_ipv6=0, + sw_if_index=sw_if_index, + enable=1) + err_msg = 'Failed to set VXLAN bypass on interface on host {host}'.\ + format(host=node['host']) + with PapiSocketExecutor(node) as papi_exec: + papi_exec.add(cmd, **args).get_replies(err_msg) + + @staticmethod def vxlan_dump(node, interface=None): """Get VxLAN data for the given interface. diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py index ee387e1c4f..89acff73ae 100644 --- a/resources/libraries/python/autogen/Regenerator.py +++ b/resources/libraries/python/autogen/Regenerator.py @@ -73,7 +73,8 @@ class Regenerator(object): protocol_to_min_frame_size = { "ip4": 64, "ip6": 78, - "vxlan+ip4": 114 # What is the real minimum for latency stream? + "ethip4vxlan": 114, # What is the real minimum for latency stream? + "dot1qip4vxlan": 118 } min_frame_size_values = protocol_to_min_frame_size.values() diff --git a/resources/libraries/robot/performance/performance_configuration.robot b/resources/libraries/robot/performance/performance_configuration.robot index a000fa2fd7..b04f9d9f34 100644 --- a/resources/libraries/robot/performance/performance_configuration.robot +++ b/resources/libraries/robot/performance/performance_configuration.robot @@ -1619,8 +1619,8 @@ | | ... | | ... | *Note:* | | ... | Socket paths for VM are defined in following format: -| | ... | - /tmp/sock-\${VM_ID}-1 -| | ... | - /tmp/sock-\${VM_ID}-2 +| | ... | - /var/run/vpp/sock-\${VM_ID}-1 +| | ... | - /var/run/vpp/sock-\${VM_ID}-2 | | ... | | ... | *Example:* | | ... @@ -1629,24 +1629,27 @@ | | ... | | [Arguments] | ${dut} | ${nf_chain}=${1} | ${nf_nodes}=${1} | | ... -| | ${bd_id2}= | Evaluate | ${nf_nodes}+1 -| | Add interface to bridge domain | ${nodes['${dut}']} -| | ... | ${${dut}_if1} | ${1} -| | Add interface to bridge domain | ${nodes['${dut}']} -| | ... | ${${dut}_if2} | ${bd_id2} -| | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes}+1 +| | ${bd_id1}= | Evaluate | ${nf_nodes} * (${nf_chain} - 1) + ${nf_chain} +| | ${bd_id2}= | Evaluate | ${nf_nodes} * ${nf_chain} + ${nf_chain} +| | ${dut_str}= | Convert To Lowercase | ${dut} +| | Add interface to bridge domain +| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_1} +| | ... | ${bd_id1} +| | Add interface to bridge domain +| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${nf_chain}_2} +| | ... | ${bd_id2} +| | :FOR | ${nf_node} | IN RANGE | 1 | ${nf_nodes} + 1 | | | ${qemu_id}= | Evaluate | (${nf_chain} - ${1}) * ${nf_nodes} + ${nf_node} -| | | ${sock1}= | Set Variable | /var/run/vpp/sock-${qemu_id}-1 -| | | ${sock2}= | Set Variable | /var/run/vpp/sock-${qemu_id}-2 -| | | Configure vhost interfaces for L2BD forwarding | ${nodes['${dut}']} -| | | ... | ${sock1} | ${sock2} -| | | ... | ${dut}-vhost-${qemu_id}-if1 -| | | ... | ${dut}-vhost-${qemu_id}-if2 -| | | ${bd_id2}= | Evaluate | ${nf_node}+1 -| | | Add interface to bridge domain | ${nodes['${dut}']} -| | | ... | ${${dut}-vhost-${qemu_id}-if1} | ${nf_node} -| | | Add interface to bridge domain | ${nodes['${dut}']} -| | | ... | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2} +| | | Configure vhost interfaces for L2BD forwarding +| | | ... | ${nodes['${dut}']} +| | | ... | /var/run/vpp/sock-${qemu_id}-1 | /var/run/vpp/sock-${qemu_id}-2 +| | | ... | ${dut}-vhost-${qemu_id}-if1 | ${dut}-vhost-${qemu_id}-if2 +| | | ${bd_id1}= | Evaluate | ${qemu_id} + (${nf_chain} - 1) +| | | ${bd_id2}= | Evaluate | ${bd_id1} + 1 +| | | Add interface to bridge domain +| | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if1} | ${bd_id1} +| | | Add interface to bridge domain +| | | ... | ${nodes['${dut}']} | ${${dut}-vhost-${qemu_id}-if2} | ${bd_id2} | Initialize L2 bridge domains with Vhost-User | | [Documentation] @@ -1665,10 +1668,9 @@ | | ... | | [Arguments] | ${nf_chain}=${1} | ${nf_nodes}=${1} | | ... -| | ${duts}= | Get Matches | ${nodes} | DUT* | | :FOR | ${dut} | IN | @{duts} -| | | Initialize L2 bridge domains with Vhost-User on node | ${dut} -| | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes} +| | | Initialize L2 bridge domains with Vhost-User on node +| | | ... | ${dut} | nf_chain=${nf_chain} | nf_nodes=${nf_nodes} | Initialize L2 bridge domains for multiple chains with Vhost-User | | [Documentation] @@ -1676,6 +1678,7 @@ | | ... | with defined number of VNF nodes on all defined VPP nodes. Add each | | ... | Vhost-User interface into L2 bridge domains with learning enabled | | ... | with physical inteface or Vhost-User interface of another VM. +| | ... | Put all interfaces in path up. | | ... | | ... | *Arguments:* | | ... | - nf_chains - Number of chains of NFs. Type: integer @@ -1688,9 +1691,10 @@ | | ... | | [Arguments] | ${nf_chains}=${1} | ${nf_nodes}=${1} | | ... -| | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains}+1 -| | | Initialize L2 bridge domains with Vhost-User | nf_chain=${nf_chain} -| | | ... | nf_nodes=${nf_nodes} +| | Set interfaces in path up +| | :FOR | ${nf_chain} | IN RANGE | 1 | ${nf_chains} + 1 +| | | Initialize L2 bridge domains with Vhost-User +| | | ... | nf_chain=${nf_chain} | nf_nodes=${nf_nodes} | Initialize L2 bridge domain with VXLANoIPv4 in 3-node circular topology | | [Documentation] @@ -2058,6 +2062,17 @@ | | Add interface to bridge domain | ${dut2} | ${vhost_if2} | ${bd_id2} | | Add interface to bridge domain | ${dut2} | ${dut2_if2} | ${bd_id2} +| Add VLAN strip offload switch off +| | [Documentation] +| | ... | Add VLAN Strip Offload switch off on all PCI devices. +| | ... +| | :FOR | ${dut} | IN | @{duts} +| | | ${dut_str}= | Convert To Lowercase | ${dut} +| | | Run keyword | ${dut}.Add DPDK Dev Parameter | ${${dut_str}_if1_pci} +| | | ... | vlan-strip-offload | off +| | | Run keyword | ${dut}.Add DPDK Dev Parameter | ${${dut_str}_if2_pci} +| | | ... | vlan-strip-offload | off + | Add VLAN strip offload switch off between DUTs in 3-node single link topology | | [Documentation] | | ... | Add VLAN Strip Offload switch off on PCI devices between DUTs to VPP @@ -2897,7 +2912,7 @@ | | | ${acl} = | Run Keyword If | '${acl}' == '${EMPTY}' | | | ... | Set Variable | ipv4 ${acl_action} src ${subnet} | | | ... | ELSE -| | | ... | Catenate | SEPARATOR=, | ${acl} +| | | ... | Catenate | SEPARATOR=", " | ${acl} | | | ... | ipv4 ${acl_action} src ${subnet} | | Add Replace Acl Multi Entries | ${dut} | rules=${acl} | | @{acl_list} = | Create List | ${0} diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot index 5b6ebc743d..a3b4223c48 100644 --- a/resources/libraries/robot/shared/interfaces.robot +++ b/resources/libraries/robot/shared/interfaces.robot @@ -44,3 +44,219 @@ | | [Return] | ${vhost_dump} | | ... | | ${vhost_dump}= | Vhost User Dump | ${dut_node} + +| Initialize layer interface on node +| | [Documentation] +| | ... | Baseline interfaces variables to be created. +| | ... +| | ... | *Arguments:* +| | ... | - dut - DUT node. Type: string +| | ... | - count - Number of baseline interface variables. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize layer interface on node \| DUT1 \| 1 \| +| | ... +| | [Arguments] | ${dut} | ${count}=${1} +| | ... +| | ${dut_str}= | Convert To Lowercase | ${dut} +| | :FOR | ${id} | IN RANGE | 1 | ${count} + 1 +| | | Set Test Variable | ${${dut_str}_if_${id}_1} | ${${dut_str}_if1} +| | | Set Test Variable | ${${dut_str}_if_${id}_2} | ${${dut_str}_if2} + +| Initialize layer interface +| | [Documentation] +| | ... | Physical interfaces variables to be created on all DUTs. +| | ... +| | ... | *Arguments:* +| | ... | - count - Number of untagged interfaces variables. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize layer interface \| 1 \| +| | ... +| | [Arguments] | ${count}=${1} +| | ... +| | :FOR | ${dut} | IN | @{duts} +| | | Initialize layer interface on node | ${dut} | count=${count} +| | Set Test Variable | ${prev_layer} | if +| | Set interfaces in path up + +| Initialize layer bonding on node +| | [Documentation] +| | ... | Bonded interface and variables to be created on across east and +| | ... | west DUT's node interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - dut - DUT node. Type: string +| | ... | - bond_mode - Link bonding mode. Type: string +| | ... | - lb_mode - Load balance mode. Type: string +| | ... | - count - Number of bond interface variables. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize layer bonding on node \| DUT1 \| xor \| l34 \| 1 \| +| | ... +| | [Arguments] | ${dut} | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1} +| | ... +| | ${dut_str}= | Convert To Lowercase | ${dut} +| | ${if_index}= | VPP Create Bond Interface +| | ... | ${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 +| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_1} | ${if_index} +| | VPP Enslave Physical Interface +| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_2} | ${if_index} +| | :FOR | ${id} | IN RANGE | 1 | ${count} + 1 +| | | Set Test Variable | ${${dut_str}_bond_${id}_1} | ${if_index} +| | | Set Test Variable | ${${dut_str}_bond_${id}_2} | ${if_index} + +| Initialize layer bonding +| | [Documentation] +| | ... | Bonded interfaces and variables to be created on all DUT's interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - bond_mode - Link bonding mode. Type: string +| | ... | - lb_mode - Load balance mode. Type: string +| | ... | - count - Number of bond interface variables. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize layer bonding \| xor \| l34 \| 1 \| +| | ... +| | [Arguments] | ${bond_mode}=xor | ${lb_mode}=l34 | ${count}=${1} +| | ... +| | :FOR | ${dut} | IN | @{duts} +| | | Initialize layer bonding on node +| | | ... | ${dut} | bond_mode=${bond_mode} | lb_mode=${lb_mode} +| | | ... | count=${count} +| | Set Test Variable | ${prev_layer} | bond + +| Initialize layer dot1q on node +| | [Documentation] +| | ... | Dot1q interfaces and variables to be created on all DUT's node +| | ... | interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - dut - DUT node. Type: string +| | ... | - count - Number of tagged interfaces. Type: integer +| | ... | - create - Whether to create vlan subinterface for each chain. +| | ... | Type: boolean +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize layer dot1q on node \| DUT1 \| 1 \| True \| +| | ... +| | [Arguments] | ${dut} | ${count}=${1} | ${create}=${True} +| | ... +| | ${dut_str}= | Convert To Lowercase | ${dut} +| | :FOR | ${id} | IN RANGE | 1 | ${count} + 1 +| | | ${vlan_west}= | Evaluate | 100 + ${id} - 1 +| | | ${vlan_east}= | Evaluate | 200 + ${id} - 1 +| | | ${if1_name} | ${if1_index}= | Run Keyword Unless +| | | ... | ${create} and ${id} > ${1} +| | | ... | Create Vlan Subinterface +| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} +| | | ... | ${vlan_west} +| | | ${if2_name} | ${if2_index}= | Run Keyword Unless +| | | ... | ${create} and ${id} > ${1} +| | | ... | Create Vlan Subinterface +| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} +| | | ... | ${vlan_east} +| | | Run Keyword Unless | ${create} and ${id} > ${1} +| | | ... | Set Interface State | ${nodes['${dut}']} | ${if1_index} | up +| | | Run Keyword Unless | ${create} and ${id} > ${1} +| | | ... | Set Interface State | ${nodes['${dut}']} | ${if2_index} | up +| | | Set Test Variable | ${${dut_str}_dot1q_${id}_1} | ${if1_index} +| | | Set Test Variable | ${${dut_str}_dot1q_${id}_2} | ${if2_index} + +| Initialize layer dot1q +| | [Documentation] +| | ... | Dot1q interfaces and variables to be created on all DUT's interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - count - Number of tagged interfaces. Type: integer +| | ... | - create - Whether to create vlan for each chain. Type: boolean +| | ... +| | ... | \| Initialize layer dot1q \| 1 \| True \| +| | ... +| | [Arguments] | ${count}=${1} | ${create}=${True} +| | ... +| | :FOR | ${dut} | IN | @{duts} +| | | Initialize layer dot1q on node | ${dut} | count=${count} +| | | ... | create=${create} +| | Set Test Variable | ${prev_layer} | dot1q + +| Initialize layer ip4vxlan on node +| | [Documentation] +| | ... | Setup VXLANoIPv4 between TG and DUTs and DUT to DUT by connecting +| | ... | physical and vxlan interfaces on each DUT. All interfaces are brought +| | ... | up. IPv4 addresses with prefix /24 are configured on interfaces +| | ... | towards TG. VXLAN sub-interfaces has same IPv4 address as interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - dut - DUT node. Type: string +| | ... | - count - Number of vxlan interfaces. Type: integer +| | ... +| | ... | *Example:* +| | ... +| | ... | \| Initialize layer ip4vxlan on node \| DUT1 \| 1 \| +| | ... +| | [Arguments] | ${dut} | ${count}=${1} +| | ... +| | ${dut_str}= | Convert To Lowercase | ${dut} +| | Configure IP addresses on interfaces +| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_1} +| | ... | 172.16.0.1 | 24 +| | Configure IP addresses on interfaces +| | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_1_2} +| | ... | 172.26.0.1 | 24 +| | :FOR | ${id} | IN RANGE | 1 | ${count} + 1 +| | | ${subnet}= | Evaluate | ${id} - 1 +| | | ${vni}= | Evaluate | ${id} - 1 +| | | ${ip4vxlan_1}= | Create VXLAN interface +| | | ... | ${nodes['${dut}']} | ${vni} | 172.16.0.1 | 172.17.${subnet}.2 +| | | ${ip4vxlan_2}= | Create VXLAN interface +| | | ... | ${nodes['${dut}']} | ${vni} | 172.26.0.1 | 172.27.${subnet}.2 +| | | ${prev_mac}= | Set Variable If | '${dut}' == 'DUT1' +| | | ... | ${tg_if1_mac} | ${dut1_if2_mac} +| | | ${next_mac}= | Set Variable If | '${dut}' == 'DUT1' and ${duts_count} == 2 +| | | ... | ${dut2_if1_mac} | ${tg_if2_mac} +| | | VPP Add IP Neighbor +| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} +| | | ... | 172.16.${subnet}.2 | ${prev_mac} +| | | VPP Add IP Neighbor +| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} +| | | ... | 172.26.${subnet}.2 | ${next_mac} +| | | VPP Route Add +| | | ... | ${nodes['${dut}']} | 172.17.${subnet}.0 | 24 +| | | ... | gateway=172.16.${subnet}.2 +| | | ... | interface=${${dut_str}_${prev_layer}_${id}_1} +| | | VPP Route Add +| | | ... | ${nodes['${dut}']} | 172.27.${subnet}.0 | 24 +| | | ... | gateway=172.26.${subnet}.2 +| | | ... | interface=${${dut_str}_${prev_layer}_${id}_2} +| | | Set VXLAN Bypass +| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} +| | | Set VXLAN Bypass +| | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} +| | | Set Test Variable +| | | ... | ${${dut_str}_ip4vxlan_${id}_1} | ${ip4vxlan_1} +| | | Set Test Variable +| | | ... | ${${dut_str}_ip4vxlan_${id}_2} | ${ip4vxlan_2} + +| Initialize layer ip4vxlan +| | [Documentation] +| | ... | VXLAN interfaces and variables to be created on all DUT's interfaces. +| | ... +| | ... | *Arguments:* +| | ... | - count - Number of vxlan interfaces. Type: integer +| | ... +| | ... | \| Initialize layer ip4vxlan \| 1 \| +| | ... +| | [Arguments] | ${count}=${1} +| | ... +| | :FOR | ${dut} | IN | @{duts} +| | | Initialize layer ip4vxlan on node | ${dut} | count=${count} +| | Set Test Variable | ${prev_layer} | ip4vxlan |