diff options
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/Constants.py | 90 | ||||
-rw-r--r-- | resources/libraries/python/DMAUtil.py | 2 | ||||
-rw-r--r-- | resources/libraries/python/model/parse.py | 14 |
3 files changed, 44 insertions, 62 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py index 6f56740cdf..443bdfc646 100644 --- a/resources/libraries/python/Constants.py +++ b/resources/libraries/python/Constants.py @@ -211,13 +211,9 @@ class Constants: # TRex set number of RX/TX descriptors. # Set to 0 to use default values. - TREX_TX_DESCRIPTORS_COUNT = get_int_from_env( - "TREX_TX_DESCRIPTORS_COUNT", 0 - ) + TREX_TX_DESCRIPTORS_COUNT = get_int_from_env("TREX_TX_DESCRIPTORS_COUNT", 0) - TREX_RX_DESCRIPTORS_COUNT = get_int_from_env( - "TREX_RX_DESCRIPTORS_COUNT", 0 - ) + TREX_RX_DESCRIPTORS_COUNT = get_int_from_env("TREX_RX_DESCRIPTORS_COUNT", 0) # Trex force start regardless ports state. TREX_SEND_FORCE = get_pessimistic_bool_from_env("TREX_SEND_FORCE") @@ -228,9 +224,7 @@ class Constants: ) # TRex port driver default vfio-pci or set to igb_uio. - TREX_PORT_DRIVER = get_str_from_env( - "TREX_PORT_DRIVER", "vfio-pci" - ) + TREX_PORT_DRIVER = get_str_from_env("TREX_PORT_DRIVER", "vfio-pci") # Graph node variant value GRAPH_NODE_VARIANT = get_str_from_env("GRAPH_NODE_VARIANT", "") @@ -248,10 +242,11 @@ class Constants: PERF_STAT_EVENTS = get_str_from_env( "PERF_STAT_EVENTS", "cpu-clock,context-switches,cpu-migrations,page-faults," - "cycles,instructions,branches,branch-misses,L1-icache-load-misses") + "cycles,instructions,branches,branch-misses,L1-icache-load-misses", + ) # Equivalent to ~0 used in vpp code - BITWISE_NON_ZERO = 0xffffffff + BITWISE_NON_ZERO = 0xFFFFFFFF # Default path to VPP API socket. SOCKSVR_PATH = "/run/vpp/api.sock" @@ -276,7 +271,8 @@ class Constants: # Duration of one latency-specific trial in NDRPDR test. PERF_TRIAL_LATENCY_DURATION = get_float_from_env( - "PERF_TRIAL_LATENCY_DURATION", 5.0) + "PERF_TRIAL_LATENCY_DURATION", 5.0 + ) # For some testbeds TG takes longer than usual to start sending traffic. # This constant [s] allows longer wait, without affecting @@ -284,9 +280,7 @@ class Constants: PERF_TRIAL_STL_DELAY = get_float_from_env("PERF_TRIAL_STL_DELAY", 0.0) # ASTF usually needs a different value for the delay. - PERF_TRIAL_ASTF_DELAY = get_float_from_env( - "PERF_TRIAL_ASTF_DELAY", 0.112 - ) + PERF_TRIAL_ASTF_DELAY = get_float_from_env("PERF_TRIAL_ASTF_DELAY", 0.112) # Number of data frames in TPUT transaction, used both by TCP and UDP. # The value should be 33 to keep historic continuity for UDP TPUT tests, @@ -307,9 +301,7 @@ class Constants: DUT1_UUID = get_str_from_env("DUT1_UUID", "") # Global "kill switch" for CRC checking during runtime. - FAIL_ON_CRC_MISMATCH = get_pessimistic_bool_from_env( - "FAIL_ON_CRC_MISMATCH" - ) + FAIL_ON_CRC_MISMATCH = get_pessimistic_bool_from_env("FAIL_ON_CRC_MISMATCH") # Default IP4 prefix length (if not defined in topology file) DEFAULT_IP4_PREFIX_LENGTH = "24" @@ -389,7 +381,7 @@ class Constants: "100ge2p1cx6dx": "Mellanox-CX6DX", "200ge2p1cx7veat": "Mellanox-CX7VEAT", "200ge6p3cx7veat": "Mellanox-CX7VEAT", - "100ge2p1a063":"Cavium-A063-100G", + "100ge2p1a063": "Cavium-A063-100G", "1ge1p82540em": "virtual", } @@ -446,68 +438,58 @@ class Constants: "Intel-X710": { "vfio-pci": "dpdk_plugin.so", "avf": "dev_iavf_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Intel-XL710": { "vfio-pci": "dpdk_plugin.so", "avf": "dev_iavf_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Intel-XXV710": { "vfio-pci": "dpdk_plugin.so", "avf": "dev_iavf_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Intel-E810XXV": { "vfio-pci": "dpdk_plugin.so", "avf": "dev_iavf_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Intel-E822CQ": { "vfio-pci": "dpdk_plugin.so", "avf": "dev_iavf_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Intel-E823C": { "vfio-pci": "dpdk_plugin.so", "avf": "dev_iavf_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Intel-E810CQ": { "vfio-pci": "dpdk_plugin.so", "avf": "dev_iavf_plugin.so", - "af_xdp": "af_xdp_plugin.so" - }, - "Amazon-Nitro-50G": { - "vfio-pci": "dpdk_plugin.so" - }, - "Amazon-Nitro-100G": { - "vfio-pci": "dpdk_plugin.so" - }, - "Amazon-Nitro-200G": { - "vfio-pci": "dpdk_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, + "Amazon-Nitro-50G": {"vfio-pci": "dpdk_plugin.so"}, + "Amazon-Nitro-100G": {"vfio-pci": "dpdk_plugin.so"}, + "Amazon-Nitro-200G": {"vfio-pci": "dpdk_plugin.so"}, "Mellanox-CX556A": { "rdma-core": "rdma_plugin.so", "mlx5_core": "dpdk_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Mellanox-CX6DX": { "rdma-core": "rdma_plugin.so", "mlx5_core": "dpdk_plugin.so", - "af_xdp": "af_xdp_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, "Mellanox-CX7VEAT": { "rdma-core": "rdma_plugin.so", "mlx5_core": "dpdk_plugin.so", - "af_xdp": "af_xdp_plugin.so" - }, - "Cavium-A063-100G": { - "vfio-pci": "dev_octeon_plugin.so" - }, - "virtual": { - "vfio-pci": "dpdk_plugin.so" + "af_xdp": "af_xdp_plugin.so", }, + "Cavium-A063-100G": {"vfio-pci": "dev_octeon_plugin.so"}, + "virtual": {"vfio-pci": "dpdk_plugin.so"}, } # Tags to differentiate tests for different NIC driver. @@ -627,9 +609,7 @@ class Constants: "Intel-XL710": "HW_DH895xcc", } - DEVICE_TYPE_TO_KEYWORD = { - "scapy": None - } + DEVICE_TYPE_TO_KEYWORD = {"scapy": None} PERF_TYPE_TO_KEYWORD = { "mrr": "Traffic should pass with maximum rate", @@ -638,24 +618,24 @@ class Constants: } PERF_TYPE_TO_SUITE_DOC_VER = { - "mrr": u'''fication:** In MaxReceivedRate tests TG sends traffic at \\ -| ... | line rate and reports total received packets over trial period. \\''', - "ndrpdr": u'''rification:** TG finds and reports throughput NDR (Non \\ + "mrr": """fication:** In MaxReceivedRate tests TG sends traffic at \\ +| ... | line rate and reports total received packets over trial period. \\""", + "ndrpdr": """rification:** TG finds and reports throughput NDR (Non \\ | ... | Drop Rate) with zero packet loss tolerance and throughput PDR \\ | ... | (Partial Drop Rate) with non-zero packet loss tolerance (LT) \\ | ... | expressed in percentage of packets transmitted. NDR and PDR are \\ | ... | discovered for different Ethernet L2 frame sizes using MLRsearch \\ -| ... | library.''', - "soak": u'''rification:** TG sends traffic at dynamically computed \\ +| ... | library.""", + "soak": """rification:** TG sends traffic at dynamically computed \\ | ... | rate as PLRsearch algorithm gathers data and improves its estimate \\ | ... | of a rate at which a prescribed small fraction of packets \\ | ... | would be lost. After set time, the serarch stops \\ -| ... | and the algorithm reports its current estimate. \\''', +| ... | and the algorithm reports its current estimate. \\""", } PERF_TYPE_TO_TEMPLATE_DOC_VER = { - "mrr": u'''Measure MaxReceivedRate for ${frame_size}B frames \\ -| | ... | using burst trials throughput test. \\''', + "mrr": """Measure MaxReceivedRate for ${frame_size}B frames \\ +| | ... | using burst trials throughput test. \\""", "ndrpdr": "Measure NDR and PDR values using MLRsearch algorithm.", "soak": "Estimate critical rate using PLRsearch algorithm. \\", } diff --git a/resources/libraries/python/DMAUtil.py b/resources/libraries/python/DMAUtil.py index cce60ed7a6..4dfb3cc040 100644 --- a/resources/libraries/python/DMAUtil.py +++ b/resources/libraries/python/DMAUtil.py @@ -137,7 +137,7 @@ class DMAUtil: f" --name={dma_name}_{i} " \ f" --max-batch-size={max_batch_size} " \ f" --max-transfer-size={max_transfer_size} " \ - f" --driver=idxd" + f" --driver=user" exec_cmd_no_error( node, cmd, sudo=True, diff --git a/resources/libraries/python/model/parse.py b/resources/libraries/python/model/parse.py index 1e0aebfe18..6f4505262e 100644 --- a/resources/libraries/python/model/parse.py +++ b/resources/libraries/python/model/parse.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: @@ -93,19 +93,21 @@ def parse(dirpath: str, fake_value: float = 1.0) -> Dict[str, List[float]]: result_object = data["result"] result_type = result_object["type"] if result_type == "mrr": - results[name] = result_object["receive_rate"]["rate"]["values"] + result_list = result_object["receive_rate"]["rate"]["values"] elif result_type == "ndrpdr": - results[name] = [result_object["pdr"]["lower"]["rate"]["value"]] + result_list = [result_object["pdr"]["lower"]["rate"]["value"]] elif result_type == "soak": - results[name] = [ + result_list = [ result_object["critical_rate"]["lower"]["rate"]["value"] ] elif result_type == "reconf": - results[name] = [result_object["loss"]["time"]["value"]] + result_list = [result_object["loss"]["time"]["value"]] elif result_type == "hoststack": - results[name] = [result_object["bandwidth"]["value"]] + result_list = [result_object["bandwidth"]["value"]] else: raise RuntimeError(f"Unknown result type: {result_type}") + # Negative values from csit/issues/3983 need to be ignored. + results[name] = [float(val) for val in result_list if val >= 0] results = {test_id: results[test_id] for test_id in sorted(results)} with open(resultpath, "wt", encoding="utf8") as file_out: json.dump(results, file_out, indent=1, separators=(", ", ": ")) |