feat(tests): IPv6 fixes
[csit.git] / resources / libraries / python / Constants.py
1 # Copyright (c) 2024 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 """Constants used in CSIT.
15
16 "Constant" means a value that keeps its value since initialization. The value
17 does not need to be hard coded here, but can be read from environment variables.
18 """
19
20
21 import os
22
23
24 def get_str_from_env(env_var_names, default_value):
25     """Attempt to read string from environment variable, return that or default.
26
27     If environment variable exists, but is empty (and default is not),
28     empty string is returned.
29
30     Several environment variable names are examined, as CSIT currently supports
31     a mix of naming conventions.
32     Here "several" means there are hard coded prefixes to try,
33     and env_var_names itself can be single name, or a list or a tuple of names.
34
35     :param env_var_names: Base names of environment variable to attempt to read.
36     :param default_value: Value to return if the env var does not exist.
37     :type env_var_names: str, or list of str, or tuple of str
38     :type default_value: str
39     :returns: The value read, or default value.
40     :rtype: str
41     """
42     prefixes = ("FDIO_CSIT_", "CSIT_", "")
43     if not isinstance(env_var_names, (list, tuple)):
44         env_var_names = [env_var_names]
45     for name in env_var_names:
46         for prefix in prefixes:
47             value = os.environ.get(prefix + name, None)
48             if value is not None:
49                 return value
50     return default_value
51
52
53 def get_int_from_env(env_var_names, default_value):
54     """Attempt to read int from environment variable, return that or default.
55
56     String value is read, default is returned also if conversion fails.
57
58     :param env_var_names: Base names of environment variable to attempt to read.
59     :param default_value: Value to return if read or conversion fails.
60     :type env_var_names: str, or list of str, or tuple of str
61     :type default_value: int
62     :returns: The value read, or default value.
63     :rtype: int
64     """
65     env_str = get_str_from_env(env_var_names, "")
66     try:
67         return int(env_str)
68     except ValueError:
69         return default_value
70
71
72 def get_float_from_env(env_var_names, default_value):
73     """Attempt to read float from environment variable, return that or default.
74
75     String value is read, default is returned also if conversion fails.
76
77     :param env_var_names: Base names of environment variable to attempt to read.
78     :param default_value: Value to return if read or conversion fails.
79     :type env_var_names: str, or list of str, or tuple of str
80     :type default_value: float
81     :returns: The value read, or default value.
82     :rtype: float
83     """
84     env_str = get_str_from_env(env_var_names, "")
85     try:
86         return float(env_str)
87     except ValueError:
88         return default_value
89
90
91 def get_pessimistic_bool_from_env(env_var_names):
92     """Attempt to read bool from environment variable, assume False by default.
93
94     Conversion is lenient and pessimistic, only few strings are considered true.
95
96     :param env_var_names: Base names of environment variable to attempt to read.
97     :type env_var_names: str, or list of str, or tuple of str
98     :returns: The value read, or False.
99     :rtype: bool
100     """
101     env_str = get_str_from_env(env_var_names, "").lower()
102     return bool(env_str in ("true", "yes", "y", "1"))
103
104
105 def get_optimistic_bool_from_env(env_var_names):
106     """Attempt to read bool from environment variable, assume True by default.
107
108     Conversion is lenient and optimistic, only few strings are considered false.
109
110     :param env_var_names: Base names of environment variable to attempt to read.
111     :type env_var_names: str, or list of str, or tuple of str
112     :returns: The value read, or True.
113     :rtype: bool
114     """
115     env_str = get_str_from_env(env_var_names, "").lower()
116     return bool(env_str not in ("false", "no", "n", "0"))
117
118
119 class Constants:
120     """Constants used in CSIT."""
121
122     # Version for CSIT data model. See docs/model/.
123     MODEL_VERSION = "1.5.1"
124
125     # Global off-switch in case JSON export is large or slow.
126     EXPORT_JSON = get_optimistic_bool_from_env("EXPORT_JSON")
127
128     # OpenVPP testing directory location at topology nodes
129     REMOTE_FW_DIR = "/tmp/openvpp-testing"
130
131     # shell scripts location
132     RESOURCES_LIB_SH = "resources/libraries/bash"
133
134     # python scripts location
135     RESOURCES_LIB_PY = "resources/libraries/python"
136
137     # shell scripts location
138     RESOURCES_TOOLS = "resources/tools"
139
140     # Python API provider location
141     RESOURCES_PAPI_PROVIDER = "resources/tools/papi/vpp_papi_provider.py"
142
143     # Templates location
144     RESOURCES_TPL = "resources/templates"
145
146     # Kubernetes templates location
147     RESOURCES_TPL_K8S = "resources/templates/kubernetes"
148
149     # Container templates location
150     RESOURCES_TPL_CONTAINER = "resources/templates/container"
151
152     # VPP Communications Library templates location
153     RESOURCES_TPL_VCL = "resources/templates/vcl"
154
155     # VPP Communications Library templates location
156     RESOURCES_TPL_TELEMETRY = "resources/templates/telemetry"
157
158     # VPP Communications Library LD_PRELOAD library
159     VCL_LDPRELOAD_LIBRARY = "/usr/lib/x86_64-linux-gnu/libvcl_ldpreload.so"
160
161     # VPP service unit name
162     VPP_UNIT = "vpp"
163
164     # Number of system CPU cores.
165     CPU_CNT_SYSTEM = 1
166
167     # Number of vswitch main thread CPU cores.
168     CPU_CNT_MAIN = 1
169
170     # QEMU binary path
171     QEMU_BIN_PATH = "/usr/bin"
172
173     # QEMU VM kernel image path
174     QEMU_VM_KERNEL = "/opt/boot/vmlinuz"
175
176     # QEMU VM kernel initrd path
177     QEMU_VM_KERNEL_INITRD = "/opt/boot/initrd.img"
178
179     # QEMU VM nested image path
180     QEMU_VM_IMAGE = "/var/lib/vm/image.iso"
181
182     # QEMU VM DPDK path
183     QEMU_VM_DPDK = "/opt/dpdk-23.11"
184
185     # Docker container SUT image
186     DOCKER_SUT_IMAGE_UBUNTU = "csit_sut-ubuntu2204:local"
187
188     # Docker container arm SUT image
189     DOCKER_SUT_IMAGE_UBUNTU_ARM = "csit_sut-ubuntu2204:local"
190
191     # TRex install directory.
192     TREX_INSTALL_DIR = "/opt/trex-core-3.03"
193
194     # TRex pcap files directory.
195     TREX_PCAP_DIR = f"{TREX_INSTALL_DIR}/scripts/avl"
196
197     # TRex limit memory.
198     TREX_LIMIT_MEMORY = get_int_from_env("TREX_LIMIT_MEMORY", 8192)
199
200     # TRex limit memory in case multiple dual interfaces configurations.
201     TREX_LIMIT_MEMORY_MULTI = get_int_from_env("TREX_LIMIT_MEMORY_MULTI", 16384)
202
203     # TRex number of cores.
204     TREX_CORE_COUNT = get_int_from_env("TREX_CORE_COUNT", 16)
205
206     # TRex number of cores in case multiple dual interface configurations.
207     TREX_CORE_COUNT_MULTI = get_int_from_env("TREX_CORE_COUNT_MULTI", 8)
208
209     # TRex set number of RX/TX descriptors.
210     # Set to 0 to use default values.
211     TREX_TX_DESCRIPTORS_COUNT = get_int_from_env(
212         "TREX_TX_DESCRIPTORS_COUNT", 0
213     )
214
215     TREX_RX_DESCRIPTORS_COUNT = get_int_from_env(
216         "TREX_RX_DESCRIPTORS_COUNT", 0
217     )
218
219     # Trex force start regardless ports state.
220     TREX_SEND_FORCE = get_pessimistic_bool_from_env("TREX_SEND_FORCE")
221
222     # TRex extra commandline arguments.
223     TREX_EXTRA_CMDLINE = get_str_from_env(
224         "TREX_EXTRA_CMDLINE", "--mbuf-factor 32"
225     )
226
227     # TRex port driver default vfio-pci or set to igb_uio.
228     TREX_PORT_DRIVER = get_str_from_env(
229         "TREX_PORT_DRIVER", "vfio-pci"
230     )
231
232     # Graph node variant value
233     GRAPH_NODE_VARIANT = get_str_from_env("GRAPH_NODE_VARIANT", "")
234
235     # Default memory page size in case multiple configured in system
236     DEFAULT_HUGEPAGE_SIZE = get_str_from_env("DEFAULT_HUGEPAGE_SIZE", "2M")
237
238     # Sysctl kernel.core_pattern
239     KERNEL_CORE_PATTERN = "/tmp/%p-%u-%g-%s-%t-%h-%e.core"
240
241     # Core dump directory
242     CORE_DUMP_DIR = "/tmp"
243
244     # Perf stat events (comma separated).
245     PERF_STAT_EVENTS = get_str_from_env(
246         "PERF_STAT_EVENTS",
247         "cpu-clock,context-switches,cpu-migrations,page-faults,"
248         "cycles,instructions,branches,branch-misses,L1-icache-load-misses")
249
250     # Equivalent to ~0 used in vpp code
251     BITWISE_NON_ZERO = 0xffffffff
252
253     # Default path to VPP API socket.
254     SOCKSVR_PATH = "/run/vpp/api.sock"
255
256     # Default path to VPP CLI socket.
257     SOCKCLI_PATH = "/run/vpp/cli.sock"
258
259     # Default path to VPP API Stats socket.
260     SOCKSTAT_PATH = "/run/vpp/stats.sock"
261
262     # This MTU value is used to force VPP to fragment 1518B packet into two.
263     MTU_FOR_FRAGMENTATION = 1043
264
265     # Number of trials to execute in MRR test.
266     PERF_TRIAL_MULTIPLICITY = get_int_from_env("PERF_TRIAL_MULTIPLICITY", 10)
267
268     # Duration [s] of one trial in MRR test.
269     PERF_TRIAL_DURATION = get_float_from_env("PERF_TRIAL_DURATION", 1.0)
270
271     # Whether to use latency streams in main search trials.
272     PERF_USE_LATENCY = get_pessimistic_bool_from_env("PERF_USE_LATENCY")
273
274     # Duration of one latency-specific trial in NDRPDR test.
275     PERF_TRIAL_LATENCY_DURATION = get_float_from_env(
276         "PERF_TRIAL_LATENCY_DURATION", 5.0)
277
278     # For some testbeds TG takes longer than usual to start sending traffic.
279     # This constant [s] allows longer wait, without affecting
280     # the approximate duration. For example, use 0.098 for AWS.
281     PERF_TRIAL_STL_DELAY = get_float_from_env("PERF_TRIAL_STL_DELAY", 0.0)
282
283     # ASTF usually needs a different value for the delay.
284     PERF_TRIAL_ASTF_DELAY = get_float_from_env(
285         "PERF_TRIAL_ASTF_DELAY", 0.112
286     )
287
288     # Number of data frames in TPUT transaction, used both by TCP and UDP.
289     # The value should be 33 to keep historic continuity for UDP TPUT tests,
290     # but we are limited by TRex window of 48 KiB, so for 9000B tests
291     # it means we can send only 5 full data frames in a burst.
292     # https://github.com/cisco-system-traffic-generator/
293     # trex-core/blob/v2.88/src/44bsd/tcp_var.h#L896-L903
294     ASTF_N_DATA_FRAMES = get_int_from_env("ASTF_N_DATA_FRAMES", 5)
295
296     # Extended debug (incl. vpp packet trace, linux perf stat, ...).
297     # Full list is available as suite variable (__init__.robot) or is
298     # override by test.
299     EXTENDED_DEBUG = get_pessimistic_bool_from_env("EXTENDED_DEBUG")
300
301     # UUID string of DUT1 /tmp volume created outside of the
302     # DUT1 docker in case of vpp-device test. ${EMPTY} value means that
303     #  /tmp directory is inside the DUT1 docker.
304     DUT1_UUID = get_str_from_env("DUT1_UUID", "")
305
306     # Global "kill switch" for CRC checking during runtime.
307     FAIL_ON_CRC_MISMATCH = get_pessimistic_bool_from_env(
308         "FAIL_ON_CRC_MISMATCH"
309     )
310
311     # Default IP4 prefix length (if not defined in topology file)
312     DEFAULT_IP4_PREFIX_LENGTH = "24"
313
314     # Maximum number of interfaces in a data path
315     DATAPATH_INTERFACES_MAX = 100
316
317     # Mapping from NIC name to its bps limit.
318     NIC_NAME_TO_BPS_LIMIT = {
319         "Intel-X520-DA2": 10000000000,
320         "Intel-X710": 10000000000,
321         "Intel-XL710": 24500000000,
322         "Intel-XXV710": 24500000000,
323         "Intel-E810XXV": 24500000000,
324         "Intel-E822CQ": 24500000000,
325         "Intel-E823C": 24500000000,
326         "Intel-E810CQ": 100000000000,
327         "Mellanox-CX556A": 100000000000,
328         "Mellanox-CX6DX": 100000000000,
329         "Mellanox-CX7VEAT": 200000000000,
330         "Amazon-Nitro-50G": 10000000000,
331         "Amazon-Nitro-100G": 10000000000,
332         "Amazon-Nitro-200G": 16000000000,
333         "virtual": 100000000,
334     }
335
336     # Mapping from NIC name to its pps limit.
337     NIC_NAME_TO_PPS_LIMIT = {
338         "Intel-X520-DA2": 14880952,
339         "Intel-X710": 14880952,
340         "Intel-XL710": 18750000,
341         "Intel-XXV710": 18750000,
342         "Intel-E810XXV": 29000000,
343         "Intel-E822CQ": 29000000,
344         "Intel-E823C": 29000000,
345         "Intel-E810CQ": 58500000,
346         "Mellanox-CX556A": 148809523,
347         "Mellanox-CX6DX": 148809523,
348         "Mellanox-CX7VEAT": 297619046,
349         "Amazon-Nitro-50G": 1500000,
350         "Amazon-Nitro-100G": 3000000,
351         "Amazon-Nitro-200G": 6000000,
352         "virtual": 14880952,
353     }
354
355     # Suite file names use codes for NICs.
356     NIC_NAME_TO_CODE = {
357         "Intel-X520-DA2": "10ge2p1x520",
358         "Intel-X710": "10ge2p1x710",
359         "Intel-XL710": "40ge2p1xl710",
360         "Intel-XXV710": "25ge2p1xxv710",
361         "Intel-E810XXV": "25ge2p1e810xxv",
362         "Intel-E822CQ": "25ge2p1e822cq",
363         "Intel-E823C": "25ge2p1e823c",
364         "Intel-E810CQ": "100ge2p1e810cq",
365         "Amazon-Nitro-50G": "50ge1p1ena",
366         "Amazon-Nitro-100G": "100ge1p1ena",
367         "Amazon-Nitro-200G": "200ge1p1ena",
368         "Mellanox-CX556A": "100ge2p1cx556a",
369         "Mellanox-CX6DX": "100ge2p1cx6dx",
370         "Mellanox-CX7VEAT": "200ge2p1cx7veat",
371         "Mellanox-CX7VEAT": "200ge6p3cx7veat",
372         "virtual": "1ge1p82540em",
373     }
374     NIC_CODE_TO_NAME = {
375         "10ge2p1x520": "Intel-X520-DA2",
376         "10ge2p1x710": "Intel-X710",
377         "40ge2p1xl710": "Intel-XL710",
378         "25ge2p1xxv710": "Intel-XXV710",
379         "25ge2p1e810xxv": "Intel-E810XXV",
380         "25ge2p1e822cq": "Intel-E822CQ",
381         "25ge2p1e823c": "Intel-E823C",
382         "100ge2p1e810cq": "Intel-E810CQ",
383         "50ge1p1ena": "Amazon-Nitro-50G",
384         "100ge1p1ena": "Amazon-Nitro-100G",
385         "200ge1p1ena": "Amazon-Nitro-200G",
386         "100ge2p1cx556a": "Mellanox-CX556A",
387         "100ge2p1cx6dx": "Mellanox-CX6DX",
388         "200ge2p1cx7veat": "Mellanox-CX7VEAT",
389         "200ge6p3cx7veat": "Mellanox-CX7VEAT",
390         "1ge1p82540em": "virtual",
391     }
392
393     # Shortened lowercase NIC model name, useful for presentation.
394     NIC_CODE_TO_SHORT_NAME = {
395         "10ge2p1x520": "x520",
396         "10ge2p1x710": "x710",
397         "40ge2p1xl710": "xl710",
398         "25ge2p1xxv710": "xxv710",
399         "25ge2p1e810xxv": "e810xxv",
400         "25ge2p1e822cq": "e822cq",
401         "25ge2p1e823c": "e823c",
402         "100ge2p1e810cq": "e810cq",
403         "50ge1p1ena": "ena",
404         "100ge1p1ena": "ena100",
405         "200ge1p1ena": "ena200",
406         "100ge2p1cx556a": "cx556a",
407         "100ge2p1cx6dx": "cx6dx",
408         "200ge2p1cx7veat": "cx7veat",
409         "200ge6p3cx7veat": "cx7veat",
410         "1ge1p82540em": "82540em",
411     }
412
413     # Not each driver is supported by each NIC.
414     NIC_NAME_TO_DRIVER = {
415         "Intel-X520-DA2": ["vfio-pci", "af_xdp"],
416         "Intel-X710": ["vfio-pci", "avf", "af_xdp"],
417         "Intel-XL710": ["vfio-pci", "avf", "af_xdp"],
418         "Intel-XXV710": ["vfio-pci", "avf", "af_xdp"],
419         "Intel-E810XXV": ["vfio-pci", "avf", "af_xdp"],
420         "Intel-E822CQ": ["vfio-pci", "avf", "af_xdp"],
421         "Intel-E823C": ["vfio-pci", "avf", "af_xdp"],
422         "Intel-E810CQ": ["vfio-pci", "avf", "af_xdp"],
423         "Amazon-Nitro-50G": ["vfio-pci"],
424         "Amazon-Nitro-100G": ["vfio-pci"],
425         "Amazon-Nitro-200G": ["vfio-pci"],
426         "Mellanox-CX556A": ["rdma-core", "mlx5_core", "af_xdp"],
427         "Mellanox-CX6DX": ["rdma-core", "mlx5_core", "af_xdp"],
428         "Mellanox-CX7VEAT": ["rdma-core", "mlx5_core", "af_xdp"],
429         "virtual": ["vfio-pci"],
430     }
431
432     # Each driver needs different plugin to work.
433     NIC_DRIVER_TO_PLUGINS = {
434         "vfio-pci": "dpdk_plugin.so",
435         "avf": "avf_plugin.so",
436         "rdma-core": "rdma_plugin.so",
437         "mlx5_core": "dpdk_plugin.so",
438         "af_xdp": "af_xdp_plugin.so",
439     }
440
441     # Tags to differentiate tests for different NIC driver.
442     NIC_DRIVER_TO_TAG = {
443         "vfio-pci": "DRV_VFIO_PCI",
444         "avf": "DRV_AVF",
445         "rdma-core": "DRV_RDMA_CORE",
446         "mlx5_core": "DRV_MLX5_CORE",
447         "af_xdp": "DRV_AF_XDP",
448     }
449
450     # Suite names have to be different, add prefix.
451     NIC_DRIVER_TO_SUITE_PREFIX = {
452         "vfio-pci": "",
453         "avf": "avf-",
454         "rdma-core": "rdma-",
455         "mlx5_core": "mlx5-",
456         "af_xdp": "af-xdp-",
457     }
458
459     # Number of virtual functions of physical nic.
460     NIC_DRIVER_TO_VFS = {
461         "vfio-pci": "nic_vfs}= | 0",
462         "avf": "nic_vfs}= | 1",
463         "rdma-core": "nic_vfs}= | 0",
464         "mlx5_core": "nic_vfs}= | 0",
465         "af_xdp": "nic_vfs}= | 0",
466     }
467
468     # Number of physical interfaces of physical nic.
469     NIC_CODE_TO_PFS = {
470         "10ge2p1x520": "nic_pfs}= | 2",
471         "10ge2p1x710": "nic_pfs}= | 2",
472         "40ge2p1xl710": "nic_pfs}= | 2",
473         "25ge2p1xxv710": "nic_pfs}= | 2",
474         "25ge2p1e810xxv": "nic_pfs}= | 2",
475         "25ge2p1e822cq": "nic_pfs}= | 2",
476         "25ge2p1e823c": "nic_pfs}= | 2",
477         "100ge2p1e810cq": "nic_pfs}= | 2",
478         "50ge1p1ena": "nic_pfs}= | 2",
479         "100ge1p1ena": "nic_pfs}= | 2",
480         "200ge1p1ena": "nic_pfs}= | 2",
481         "100ge2p1cx556a": "nic_pfs}= | 2",
482         "100ge2p1cx6dx": "nic_pfs}= | 2",
483         "200ge2p1cx7veat": "nic_pfs}= | 2",
484         "200ge6p3cx7veat": "nic_pfs}= | 6",
485         "1ge1p82540em": "nic_pfs}= | 2",
486     }
487
488     NIC_CODE_TO_CORESCALE = {
489         "10ge2p1x520": 1,
490         "10ge2p1x710": 1,
491         "40ge2p1xl710": 1,
492         "25ge2p1xxv710": 1,
493         "25ge2p1e810xxv": 1,
494         "25ge2p1e822cq": 1,
495         "25ge2p1e823c": 1,
496         "100ge2p1e810cq": 1,
497         "50ge1p1ena": 1,
498         "100ge1p1ena": 1,
499         "200ge1p1ena": 1,
500         "100ge2p1cx556a": 1,
501         "100ge2p1cx6dx": 1,
502         "200ge2p1cx7veat": 1,
503         "200ge6p3cx7veat": 3,
504         "1ge1p82540em": 1,
505     }
506
507     # Not each driver is supported by each NIC.
508     DPDK_NIC_NAME_TO_DRIVER = {
509         "Intel-X520-DA2": ["vfio-pci"],
510         "Intel-X710": ["vfio-pci"],
511         "Intel-XL710": ["vfio-pci"],
512         "Intel-XXV710": ["vfio-pci"],
513         "Intel-E810XXV": ["vfio-pci"],
514         "Intel-E822CQ": ["vfio-pci"],
515         "Intel-E823C": ["vfio-pci"],
516         "Intel-E810CQ": ["vfio-pci"],
517         "Amazon-Nitro-50G": ["vfio-pci"],
518         "Amazon-Nitro-100G": ["vfio-pci"],
519         "Amazon-Nitro-200G": ["vfio-pci"],
520         "Mellanox-CX556A": ["mlx5_core"],
521         "Mellanox-CX6DX": ["mlx5_core"],
522         "Mellanox-CX7VEAT": ["mlx5_core"],
523         "virtual": ["vfio-pci"],
524     }
525
526     # Tags to differentiate tests for different NIC driver.
527     DPDK_NIC_DRIVER_TO_TAG = {
528         "vfio-pci": "DRV_VFIO_PCI",
529         "mlx5_core": "DRV_MLX5_CORE",
530     }
531
532     # Suite names have to be different, add prefix.
533     DPDK_NIC_DRIVER_TO_SUITE_PREFIX = {
534         "vfio-pci": "",
535         "mlx5_core": "mlx5-",
536     }
537
538     # Some identifiers constructed from suite names
539     # have to be independent of NIC driver used.
540     # In order to remove or reject the NIC driver part,
541     # it is useful to have a list of such prefixes precomputed.
542     FORBIDDEN_SUITE_PREFIX_LIST = [
543         prefix for prefix in NIC_DRIVER_TO_SUITE_PREFIX.values() if prefix
544     ]
545     FORBIDDEN_SUITE_PREFIX_LIST += [
546         prefix for prefix in DPDK_NIC_DRIVER_TO_SUITE_PREFIX.values() if prefix
547     ]
548
549     # TODO CSIT-1481: Crypto HW should be read from topology file instead.
550     NIC_NAME_TO_CRYPTO_HW = {
551         "Intel-E810CQ": "HW_4xxx",
552         "Intel-E822CQ": "HW_C4xxx",
553         "Intel-E823C": "HW_C4xxx",
554         "Intel-X710": "HW_DH895xcc",
555         "Intel-XL710": "HW_DH895xcc",
556     }
557
558     DEVICE_TYPE_TO_KEYWORD = {
559         "scapy": None
560     }
561
562     PERF_TYPE_TO_KEYWORD = {
563         "mrr": "Traffic should pass with maximum rate",
564         "ndrpdr": "Find NDR and PDR intervals using optimized search",
565         "soak": "Find critical load using PLRsearch",
566     }
567
568     PERF_TYPE_TO_SUITE_DOC_VER = {
569         "mrr": u'''fication:** In MaxReceivedRate tests TG sends traffic at \\
570 | ... | line rate and reports total received packets over trial period. \\''',
571         "ndrpdr": u'''rification:** TG finds and reports throughput NDR (Non \\
572 | ... | Drop Rate) with zero packet loss tolerance and throughput PDR \\
573 | ... | (Partial Drop Rate) with non-zero packet loss tolerance (LT) \\
574 | ... | expressed in percentage of packets transmitted. NDR and PDR are \\
575 | ... | discovered for different Ethernet L2 frame sizes using MLRsearch \\
576 | ... | library.''',
577         "soak": u'''rification:** TG sends traffic at dynamically computed \\
578 | ... | rate as PLRsearch algorithm gathers data and improves its estimate \\
579 | ... | of a rate at which a prescribed small fraction of packets \\
580 | ... | would be lost. After set time, the serarch stops \\
581 | ... | and the algorithm reports its current estimate. \\''',
582     }
583
584     PERF_TYPE_TO_TEMPLATE_DOC_VER = {
585         "mrr": u'''Measure MaxReceivedRate for ${frame_size}B frames \\
586 | | ... | using burst trials throughput test. \\''',
587         "ndrpdr": "Measure NDR and PDR values using MLRsearch algorithm.",
588         "soak": "Estimate critical rate using PLRsearch algorithm. \\",
589     }