aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/python/Constants.py4
-rw-r--r--resources/libraries/python/IPUtil.py6
-rw-r--r--resources/libraries/python/InterfaceUtil.py54
-rw-r--r--resources/libraries/python/TelemetryUtil.py9
-rw-r--r--resources/libraries/python/VppConfigGenerator.py3
-rw-r--r--resources/libraries/robot/hoststack/hoststack.robot9
-rw-r--r--resources/libraries/robot/performance/performance_actions.robot17
-rw-r--r--resources/libraries/robot/shared/default.robot3
-rw-r--r--resources/libraries/robot/shared/interfaces.robot6
9 files changed, 69 insertions, 42 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index 5ec3fcf377..8fb354fc8d 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 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:
@@ -428,7 +428,7 @@ class Constants:
# Each driver needs different plugin to work.
NIC_DRIVER_TO_PLUGINS = {
"vfio-pci": "dpdk_plugin.so",
- "avf": "avf_plugin.so",
+ "avf": "dev_iavf_plugin.so",
"rdma-core": "rdma_plugin.so",
"mlx5_core": "dpdk_plugin.so",
"af_xdp": "af_xdp_plugin.so",
diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py
index 309d8241ee..32f510c80b 100644
--- a/resources/libraries/python/IPUtil.py
+++ b/resources/libraries/python/IPUtil.py
@@ -1,5 +1,5 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
-# Copyright (c) 2024 PANTHEON.tech s.r.o.
+# Copyright (c) 2025 Cisco and/or its affiliates.
+# Copyright (c) 2025 PANTHEON.tech s.r.o.
# 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:
@@ -498,7 +498,7 @@ class IPUtil:
else:
cmd = f"ip addr show dev {interface}"
- cmd += u" | grep 'inet ' | awk -e '{print $2}'"
+ cmd += u" | grep 'inet ' | awk '{print $2}'"
cmd += f" | grep '{ip_addr_with_prefix}'"
_, stdout, _ = exec_cmd(node, cmd, timeout=5, sudo=True)
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index ff013307bc..7a0e37386b 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 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:
@@ -1261,32 +1261,37 @@ class InterfaceUtil:
the node.
"""
PapiSocketExecutor.run_cli_cmd(
- node, u"set logging class avf level debug"
+ node, u"set logging class dev level debug"
+ )
+ PapiSocketExecutor.run_cli_cmd(
+ node, u"set logging class iavf level debug"
)
- cmd = u"avf_create"
+ cmd = u"dev_attach"
vf_pci_addr = Topology.get_interface_pci_addr(node, if_key)
args = dict(
- pci_addr=InterfaceUtil.pci_to_int(vf_pci_addr),
- enable_elog=0,
- rxq_num=int(num_rx_queues) if num_rx_queues else 0,
- rxq_size=rxq_size,
- txq_size=txq_size
+ device_id=f"pci/{vf_pci_addr}",
+ driver_name="iavf",
)
- err_msg = f"Failed to create AVF interface on host {node[u'host']}"
+ err_msg = f"Failed to attach AVF driver on host {node[u'host']}"
+ with PapiSocketExecutor(node) as papi_exec:
+ reply = papi_exec.add(cmd, **args).get_reply(err_msg)
+ logger.debug(f"reply: {reply}")
+ dev_index = reply["dev_index"]
- # FIXME: Remove once the fw/driver is upgraded.
- for _ in range(10):
- with PapiSocketExecutor(node) as papi_exec:
- try:
- sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(
- err_msg
- )
- break
- except AssertionError:
- logger.error(err_msg)
- else:
- raise AssertionError(err_msg)
+ cmd = u"dev_create_port_if"
+ args = dict(
+ dev_index=dev_index,
+ intf_name="",
+ num_rx_queues=int(num_rx_queues) if num_rx_queues else 0,
+ rx_queue_size=rxq_size,
+ tx_queue_size=txq_size,
+ port_id=0,
+ )
+ err_msg = f"Failed to create AVF port on host {node[u'host']}"
+ with PapiSocketExecutor(node) as papi_exec:
+ sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
+ PapiSocketExecutor.run_cli_cmd(node, "show dev")
InterfaceUtil.add_eth_interface(
node, sw_if_index=sw_if_index, ifc_pfx=u"eth_avf",
@@ -1820,6 +1825,9 @@ class InterfaceUtil:
def init_generic_interface(node, ifc_key, numvfs=0, osi_layer=u"L2"):
"""Init PCI device. Bind to proper drivers. Optionally create NIC VFs.
+ When creating VFs, also set large enough MTU on PF.
+ As this is called in suite setup, we must allow jumbo here.
+
:param node: DUT node.
:param ifc_key: Interface key from topology file.
:param numvfs: Number of VIFs to initialize, 0 - disable the VIFs.
@@ -1859,6 +1867,10 @@ class InterfaceUtil:
if not numvfs:
if osi_layer == u"L2":
InterfaceUtil.set_linux_interface_promisc(node, pf_dev)
+ else:
+ # AVF VFs cannot read if limited by MTU on PF, ensure default here.
+ # TODO: Allow test-case specific PF initialization if possible.
+ InterfaceUtil.set_interface_mtu(node, [pf_pci_addr])
vf_ifc_keys = []
# Set MAC address and bind each virtual function to uio driver.
diff --git a/resources/libraries/python/TelemetryUtil.py b/resources/libraries/python/TelemetryUtil.py
index 63d0bf60a7..1dbb2d45a3 100644
--- a/resources/libraries/python/TelemetryUtil.py
+++ b/resources/libraries/python/TelemetryUtil.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2022 Cisco and/or its affiliates.
+# Copyright (c) 2025 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,7 +16,8 @@
from resources.libraries.python.model.ExportResult import append_telemetry
from resources.libraries.python.Constants import Constants
from resources.libraries.python.ssh import exec_cmd_no_error
-from resources.libraries.python.topology import NodeType
+from resources.libraries.python.topology import Topology, NodeType
+from resources.libraries.python.SysctlUtil import SysctlUtil
__all__ = ["TelemetryUtil"]
@@ -51,6 +52,10 @@ class TelemetryUtil:
cd_cmd += f"sh -c \"cd {Constants.REMOTE_FW_DIR}/"
cd_cmd += f"{Constants.RESOURCES_TOOLS}"
+ # Allow userspace to directly access perf counters on aarch64
+ if Topology.get_node_arch(node) == u"aarch64":
+ SysctlUtil.set_sysctl_value(node, u"kernel/perf_user_access", 1)
+
if spath:
bin_cmd = f"python3 -m telemetry --config {config} --hook {spath}\""
else:
diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py
index 971b82606f..ea523b7cb0 100644
--- a/resources/libraries/python/VppConfigGenerator.py
+++ b/resources/libraries/python/VppConfigGenerator.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 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:
@@ -790,7 +790,6 @@ class VppInitConfig:
vpp_config.add_unix_log()
vpp_config.add_unix_cli_listen()
vpp_config.add_unix_cli_no_pager()
- vpp_config.add_unix_gid()
vpp_config.add_unix_coredump()
vpp_config.add_socksvr(socket=Constants.SOCKSVR_PATH)
vpp_config.add_main_heap_size("2G")
diff --git a/resources/libraries/robot/hoststack/hoststack.robot b/resources/libraries/robot/hoststack/hoststack.robot
index ece1d8a1f4..d5cbd0bce0 100644
--- a/resources/libraries/robot/hoststack/hoststack.robot
+++ b/resources/libraries/robot/hoststack/hoststack.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 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:
@@ -458,7 +458,6 @@
| | | Run Keyword If
| | | ... | '${dut}' == 'DUT1' and ${vpp_nsim_attr}[output_nsim_enable]
| | | ... | ${dut}.Add Nsim poll main thread
-| | | Run keyword | ${dut}.Add api segment gid | testuser
| | | Run keyword | ${dut}.Add tcp congestion control algorithm
| | | ... | ${vpp_hoststack_attr}[tcp_cc_algo]
| | | Run keyword | ${dut}.Add session enable
@@ -649,13 +648,15 @@
| | FOR | ${action} | IN | @{stat_pre_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
-| | ${output}= | Run ab | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
+| | ${status} | ${message}= | Run Keyword And Ignore Error | Run ab
+| | ... | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
| | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total}
| | ... | ${listen_port}
| | FOR | ${action} | IN | @{stat_post_trial}
| | | Run Keyword | Additional Statistics Action For ${action}
| | END
-| | Set test message | ${output}
+| | Set test message | ${message}
+| | Run Keyword If | "${status}" != "PASS" | Fail | AB failed: ${message}
| Configure VPP startup configuration for NGINX
| | [Documentation]
diff --git a/resources/libraries/robot/performance/performance_actions.robot b/resources/libraries/robot/performance/performance_actions.robot
index d588bc9f83..de7c63200a 100644
--- a/resources/libraries/robot/performance/performance_actions.robot
+++ b/resources/libraries/robot/performance/performance_actions.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2025 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:
@@ -110,6 +110,9 @@
| | ${transaction_scale} = | Get Transaction Scale
| | ${transaction_type} = | Get Transaction Type
| | ${use_latency} = | Get Use Latency
+| | ${node_arch} = | Get Node Arch | ${nodes[u'DUT1']}
+| | ${profile} = | Set Variable If | "${node_arch}" == "aarch64"
+| | ... | vppctl_runtime_arm.yaml | vppctl_runtime.yaml
| | Send traffic on tg
| | ... | duration=${-1}
| | ... | rate=${runtime_rate}
@@ -126,7 +129,7 @@
| | ... | ramp_up_duration=${ramp_up_duration}
| | ... | ramp_up_rate=${ramp_up_rate}
| | Run Telemetry On All DUTs
-| | ... | ${nodes} | profile=vppctl_runtime.yaml
+| | ... | ${nodes} | profile=${profile}
| | ... | rate=${telemetry_rate} | export=${telemetry_export}
| | Stop traffic on tg
@@ -184,6 +187,9 @@
| | ${transaction_scale} = | Get Transaction Scale
| | ${transaction_type} = | Get Transaction Type
| | ${use_latency} = | Get Use Latency
+| | ${node_arch} = | Get Node Arch | ${nodes[u'DUT1']}
+| | ${profile} = | Set Variable If | "${node_arch}" == "aarch64"
+| | ... | perf_stat_runtime_arm.yaml | perf_stat_runtime.yaml
| | Send traffic on tg
| | ... | duration=${-1}
| | ... | rate=${runtime_rate}
@@ -200,7 +206,7 @@
| | ... | ramp_up_duration=${ramp_up_duration}
| | ... | ramp_up_rate=${ramp_up_rate}
| | Run Telemetry On All DUTs
-| | ... | ${nodes} | profile=perf_stat_runtime.yaml
+| | ... | ${nodes} | profile=${profile}
| | ... | rate=${telemetry_rate} | export=${False}
| | Stop traffic on tg
@@ -212,6 +218,9 @@
| | ... | See documentation of the called keyword for required test variables.
| |
| | ${runtime_duration} = | Get Runtime Duration
+| | ${node_arch} = | Get Node Arch | ${nodes['${iperf_server_node}']}
+| | ${profile} = | Set Variable If | "${node_arch}" == "aarch64"
+| | ... | vppctl_runtime_arm.yaml | vppctl_runtime.yaml
| | ${pids}= | iPerf Client Start Remote Exec
| | | ... | ${nodes['${iperf_client_node}']}
| | | ... | duration=${-1}
@@ -226,7 +235,7 @@
| | | ... | bind=${iperf_client_bind}
| | | ... | affinity=${iperf_client_affinity}
| | Run Telemetry On All DUTs
-| | ... | ${nodes} | profile=vppctl_runtime.yaml
+| | ... | ${nodes} | profile=${profile}
| | ... | rate=${telemetry_rate} | export=${telemetry_export}
| | iPerf Client Stop Remote Exec | ${nodes['${iperf_client_node}']} | ${pids}
diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot
index 2dc78941b3..094d277a11 100644
--- a/resources/libraries/robot/shared/default.robot
+++ b/resources/libraries/robot/shared/default.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 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:
@@ -149,7 +149,6 @@
| | | Run Keyword | ${dut}.Add Unix Log
| | | Run Keyword | ${dut}.Add Unix CLI Listen
| | | Run Keyword | ${dut}.Add Unix CLI No Pager
-| | | Run Keyword | ${dut}.Add Unix GID
| | | Run Keyword | ${dut}.Add API Segment Prefix | ${dut}
| | | Run Keyword | ${dut}.Add Unix Coredump
| | | Run Keyword | ${dut}.Add Socksvr | ${SOCKSVR_PATH}
diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot
index b4d6959d01..e994628ee6 100644
--- a/resources/libraries/robot/shared/interfaces.robot
+++ b/resources/libraries/robot/shared/interfaces.robot
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 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:
@@ -375,7 +375,7 @@
| Initialize layer avf on node
| | [Documentation]
-| | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF.
+| | ... | Initialize AVF (Intel) interfaces on DUT on NIC PF. Set MTU.
| |
| | ... | *Arguments:*
| | ... | - dut - DUT node. Type: string
@@ -408,6 +408,8 @@
| | | Set List Value | ${${dut}_vf${pf}_mac} | ${vf} | ${_mac}
| | | Set List Value | ${${dut}_vf${pf}_pci} | ${vf} | ${_pci}
| | | Set List Value | ${${dut}_vf${pf}_vlan} | ${vf} | ${_vlan}
+| | | VPP Set Interface MTU | ${nodes['${dut}']}
+| | | ... | ${${dut}_vf${pf}}[${vf}] | mtu=${recommended_mtu}
| | END
| Initialize layer af_xdp on node