style(core): Clean up before large edits 17/42617/1
authorVratko Polak <[email protected]>
Tue, 1 Apr 2025 11:55:39 +0000 (13:55 +0200)
committerVratko Polak <[email protected]>
Tue, 1 Apr 2025 11:55:39 +0000 (13:55 +0200)
+ Apply black formatting to Constants.py file.
+ Sort performance action keywords alphabetically.

Change-Id: I91e3e08f638145adc964007763b3ca2799555877
Signed-off-by: Vratko Polak <[email protected]>
resources/libraries/python/Constants.py
resources/libraries/robot/performance/performance_actions.robot

index 6f56740..443bdfc 100644 (file)
@@ -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. \\",
     }
index de7c632..c7d7776 100644 (file)
@@ -26,9 +26,9 @@
 | | Run Keyword If | ${extended_debug}==${True}
 | | ... | Perf Stat On All DUTs | ${nodes} | cpu_list=${cpu_alloc_str}
 
-| Additional Statistics Action For trex-runtime
+| Additional Statistics Action For bpf-runtime
 | | [Documentation]
-| | ... | Additional Statistics Action for T-Rex telemetry counters with
+| | ... | Additional Statistics Action for linux bundle counters with
 | | ... | running traffic.
 | |
 | | ... | See documentation of the called keyword for required test variables.
@@ -58,7 +58,9 @@
 | | ... | duration_limit=${0.0}
 | | ... | ramp_up_duration=${ramp_up_duration}
 | | ... | ramp_up_rate=${ramp_up_rate}
-| | Sleep | 1s
+| | Run Telemetry On All DUTs
+| | ... | ${nodes} | profile=bpf_runtime.yaml
+| | ... | rate=${telemetry_rate} | export=${False}
 | | Stop traffic on tg
 
 | Additional Statistics Action For infra-warmup
 | | ... | ramp_up_duration=${ramp_up_duration}
 | | ... | ramp_up_rate=${ramp_up_rate}
 
-| Additional Statistics Action For vpp-runtime
+| Additional Statistics Action For noop
 | | [Documentation]
-| | ... | Additional Statistics Action for clear and show runtime counters with
+| | ... | Additional Statistics Action for no operation.
+| |
+| | No operation
+
+| Additional Statistics Action For perf-stat-runtime
+| | [Documentation]
+| | ... | Additional Statistics Action for linux bundle counters with
 | | ... | running traffic.
 | |
 | | ... | See documentation of the called keyword for required test variables.
 | | ${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
+| | ... | perf_stat_runtime_arm.yaml | perf_stat_runtime.yaml
 | | Send traffic on tg
 | | ... | duration=${-1}
 | | ... | rate=${runtime_rate}
 | | ... | ramp_up_rate=${ramp_up_rate}
 | | Run Telemetry On All DUTs
 | | ... | ${nodes} | profile=${profile}
-| | ... | rate=${telemetry_rate} | export=${telemetry_export}
+| | ... | rate=${telemetry_rate} | export=${False}
 | | Stop traffic on tg
 
-| Additional Statistics Action For bpf-runtime
+| Additional Statistics Action For trex-runtime
 | | [Documentation]
-| | ... | Additional Statistics Action for linux bundle counters with
+| | ... | Additional Statistics Action for T-Rex telemetry counters with
 | | ... | running traffic.
 | |
 | | ... | See documentation of the called keyword for required test variables.
 | | ... | duration_limit=${0.0}
 | | ... | ramp_up_duration=${ramp_up_duration}
 | | ... | ramp_up_rate=${ramp_up_rate}
-| | Run Telemetry On All DUTs
-| | ... | ${nodes} | profile=bpf_runtime.yaml
-| | ... | rate=${telemetry_rate} | export=${False}
+| | Sleep | 1s
 | | Stop traffic on tg
 
-| Additional Statistics Action For perf-stat-runtime
+| Additional Statistics Action For vpp-clear-stats
 | | [Documentation]
-| | ... | Additional Statistics Action for linux bundle counters with
+| | ... | Additional Statistics Action for clear VPP statistics.
+| |
+| | Run Telemetry On All DUTs
+| | ... | ${nodes} | profile=vppctl_clear_stats.yaml
+| | ... | export=${False}
+
+| Additional Statistics Action For vpp-enable-packettrace
+| | [Documentation]
+| | ... | Additional Statistics Action for enable VPP packet trace.
+| |
+| | Run Keyword If | ${extended_debug}==${True}
+| | ... | VPP Enable Traces On All DUTs | ${nodes} | fail_on_error=${False}
+
+| Additional Statistics Action For vpp-runtime
+| | [Documentation]
+| | ... | Additional Statistics Action for clear and show runtime counters with
 | | ... | running traffic.
 | |
 | | ... | See documentation of the called keyword for required test variables.
 | | ${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
+| | ... | vppctl_runtime_arm.yaml | vppctl_runtime.yaml
 | | Send traffic on tg
 | | ... | duration=${-1}
 | | ... | rate=${runtime_rate}
 | | ... | ramp_up_rate=${ramp_up_rate}
 | | Run Telemetry On All DUTs
 | | ... | ${nodes} | profile=${profile}
-| | ... | rate=${telemetry_rate} | export=${False}
+| | ... | rate=${telemetry_rate} | export=${telemetry_export}
 | | Stop traffic on tg
 
 | Additional Statistics Action For vpp-runtime-iperf3
 | | ... | rate=${telemetry_rate} | export=${telemetry_export}
 | | iPerf Client Stop Remote Exec | ${nodes['${iperf_client_node}']} | ${pids}
 
-| Additional Statistics Action For noop
-| | [Documentation]
-| | ... | Additional Statistics Action for no operation.
-| |
-| | No operation
-
-| Additional Statistics Action For vpp-clear-stats
-| | [Documentation]
-| | ... | Additional Statistics Action for clear VPP statistics.
-| |
-| | Run Telemetry On All DUTs
-| | ... | ${nodes} | profile=vppctl_clear_stats.yaml
-| | ... | export=${False}
-
-| Additional Statistics Action For vpp-enable-packettrace
-| | [Documentation]
-| | ... | Additional Statistics Action for enable VPP packet trace.
-| |
-| | Run Keyword If | ${extended_debug}==${True}
-| | ... | VPP Enable Traces On All DUTs | ${nodes} | fail_on_error=${False}
-
 | Additional Statistics Action For vpp-show-packettrace
 | | [Documentation]
 | | ... | Additional Statistics Action for show VPP packet trace.