CSIT-1097: Edit dpdk suites for new rate and jumbo
[csit.git] / resources / libraries / robot / performance / performance_utils.robot
1 # Copyright (c) 2018 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 *** Settings ***
15 | Library | Collections
16 | Library | resources.libraries.python.topology.Topology
17 | Library | resources.libraries.python.NodePath
18 | Library | resources.libraries.python.DpdkUtil
19 | Library | resources.libraries.python.InterfaceUtil
20 | Library | resources.libraries.python.KubernetesUtils
21 | Library | resources.libraries.python.VhostUser
22 | Library | resources.libraries.python.TrafficGenerator
23 | Library | resources.libraries.python.TrafficGenerator.OptimizedSearch
24 | Library | resources.libraries.python.TrafficGenerator.TGDropRateSearchImpl
25 | Library | resources.libraries.python.Trace
26 | Resource | resources/libraries/robot/shared/default.robot
27 | Resource | resources/libraries/robot/shared/interfaces.robot
28 | Resource | resources/libraries/robot/shared/counters.robot
29 | Resource | resources/libraries/robot/shared/container.robot
30 | Resource | resources/libraries/robot/shared/memif.robot
31 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
32 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
33 | Resource | resources/libraries/robot/ip/ip4.robot
34 | Resource | resources/libraries/robot/ip/ip6.robot
35 | Resource | resources/libraries/robot/vm/qemu.robot
36 | Resource | resources/libraries/robot/l2/tagging.robot
37 | Documentation | Performance suite keywords - utilities to find and verify NDR
38 | ... | and PDR.
39
40 *** Keywords ***
41 | Get Max Rate And Jumbo
42 | | [Documentation]
43 | | ... | Argument framesize can be either integer in case of a single packet
44 | | ... | in stream, or IMIX string defining mix of packets.
45 | | ... | For jumbo frames detection, the maximal packet size is relevant.
46 | | ... | For maximal transmit rate, the average packet size is relevant.
47 | | ... | In both cases, encapsulation overhead (if any) has effect.
48 | | ... | The maximal rate is computed from line limit bandwidth,
49 | | ... | but NICs also have an independent limit in packet rate.
50 | | ... | For some NICs, the limit is not reachable (bps limit is stricter),
51 | | ... | in those cases None is used (meaning no limiting).
52 | | ...
53 | | ... | This keyword returns computed maximal unidirectional transmit rate
54 | | ... | and jumbo boolean (some suites need that).
55 | | ...
56 | | ... | *Arguments:*
57 | | ... | - bps_limit - Line rate limit in bps. Type: integer
58 | | ... | - framesize - Framesize in bytes or IMIX. Type: integer or string
59 | | ... | - overhead - Overhead in bytes. Default: 0. Type: integer
60 | | ... | - pps_limit - NIC limit rate value in pps. Type: integer or None
61 | | ...
62 | | ... | *Returns:*
63 | | ... | - 2-tuple, consisting of:
64 | | ... |   - Calculated unidirectional maximal transmit rate.
65 | | ... |     Type: integer or float
66 | | ... |   - Jumbo boolean, true if jumbo packet support has to be enabled.
67 | | ... |     Type: boolean
68 | | ...
69 | | ... | *Example:*
70 | | ...
71 | | ... | \| Get Max Rate And Jumbo | \${10000000} \| IMIX_v4_1 \
72 | | ... | \| overhead=\${40} \| pps_limit=\${18750000} \|
73 | | ...
74 | | [Arguments] | ${bps_limit} | ${framesize}
75 | | ... | ${overhead}=${0} | ${pps_limit}=${None}
76 | | ...
77 | | ${avg_size} = | Set Variable If | '${framesize}' == 'IMIX_v4_1'
78 | | ... | ${353.83333} | ${framesize}
79 | | ${max_size} = | Set Variable If | '${framesize}' == 'IMIX_v4_1'
80 | | ... | ${1518} | ${framesize}
81 | | # swo := size_with_overhead
82 | | ${avg_swo} = | Evaluate | ${avg_size} + ${overhead}
83 | | ${max_swo} = | Evaluate | ${max_size} + ${overhead}
84 | | ${jumbo} = | Set Variable If | ${max_swo} < 1522
85 | | ... | ${False} | ${True}
86 | | # For testing None see: https://groups.google.com/\
87 | | #                       forum/#!topic/robotframework-users/XntFz0ocD9E
88 | | ${limit_set} = | Set Variable | ${pps_limit != None}
89 | | ${rate} = | Evaluate | (${bps_limit}/((${avg_swo}+20)*8)).__trunc__()
90 | | ${max_rate} = | Set Variable If | ${limit_set} and ${rate} > ${pps_limit}
91 | | ... | ${pps_limit} | ${rate}
92 | | Return From Keyword | ${max_rate} | ${jumbo}
93
94 | Get Max Rate And Jumbo And Handle Multi Seg
95 | | [Documentation]
96 | | ... | This keyword adds correct multi seg configuration,
97 | | ... | then returns the result of Get Max Rate And Jumbo keyword.
98 | | ...
99 | | ... | See Documentation of Get Max Rate And Jumbo for more details.
100 | | ...
101 | | ... | *Arguments:*
102 | | ... | - bps_limit - Line rate limit in bps. Type: integer
103 | | ... | - framesize - Framesize in bytes. Type: integer or string
104 | | ... | - overhead - Overhead in bytes. Default: 0. Type: integer
105 | | ... | - pps_limit - NIC limit rate value in pps. Type: integer or None
106 | | ...
107 | | ... | *Returns:*
108 | | ... | - 2-tuple, consisting of:
109 | | ... |   - Calculated unidirectional maximal transmit rate.
110 | | ... |     Type: integer or float
111 | | ... |   - Jumbo boolean, true if jumbo packet support has to be enabled.
112 | | ... |     Type: boolean
113 | | ...
114 | | ... | *Example:*
115 | | ...
116 | | ... | \| Get Max Rate And Jumbo And Handle Multi Seg | \${10000000} \
117 | | ... | \| IMIX_v4_1 \| overhead=\${40} \| pps_limit=\${18750000} \|
118 | | ...
119 | | [Arguments] | ${bps_limit} | ${framesize}
120 | | ... | ${overhead}=${0} | ${pps_limit}=${None}
121 | | ...
122 | | ${max_rate} | ${jumbo} = | Get Max Rate And Jumbo
123 | | ... | ${bps_limit} | ${framesize} | ${overhead} | ${pps_limit}
124 | | Run Keyword If | not ${jumbo} | Add no multi seg to all DUTs
125 | | Return From Keyword | ${max_rate} | ${jumbo}
126
127 | Calculate pps
128 | | [Documentation]
129 | | ... | Calculate pps for given rate and L2 frame size,
130 | | ... | additional 20B are added to L2 frame size as padding.
131 | | ...
132 | | ... | FIXME: Migrate callers to Get Max Rate And Jumbo
133 | | ...
134 | | ... | *Arguments*
135 | | ... | - bps - Rate in bps. Type: integer
136 | | ... | - framesize - L2 frame size in Bytes. Type: integer
137 | | ...
138 | | ... | *Return*
139 | | ... | - Calculated pps. Type: integer
140 | | ...
141 | | ... | *Example:*
142 | | ...
143 | | ... | \| Calculate pps \| 10000000000 \| 64 \|
144 | | ...
145 | | [Arguments] | ${bps} | ${framesize}
146 | | ...
147 | | ${framesize}= | Get Frame Size | ${framesize}
148 | | ${ret}= | Evaluate | (${bps}/((${framesize}+20)*8)).__trunc__()
149 | | Return From Keyword | ${ret}
150
151 | Get Frame Size
152 | | [Documentation]
153 | | ... | Framesize can be either integer in case of a single packet
154 | | ... | in stream, or set of packets in case of IMIX type or simmilar.
155 | | ... | This keyword returns average framesize.
156 | | ...
157 | | ... | FIXME: Migrate callers to Get Max Rate And Jumbo
158 | | ...
159 | | ... | *Arguments:*
160 | | ... | - framesize - Framesize. Type: integer or string
161 | | ...
162 | | ... | *Example:*
163 | | ...
164 | | ... | \| Get Frame Size \| IMIX_v4_1 \|
165 | | ...
166 | | [Arguments] | ${framesize}
167 | | ...
168 | | Return From Keyword If | '${framesize}' == 'IMIX_v4_1' | ${353.83333}
169 | | Return From Keyword | ${framesize}
170
171 | Find NDR using linear search and pps
172 | | [Documentation]
173 | | ... | Find throughput by using RFC2544 linear search with non drop rate.
174 | | ...
175 | | ... | *Arguments:*
176 | | ... | - framesize - L2 Frame Size [B]. Type: integer
177 | | ... | - start_rate - Initial start rate [pps]. Type: float
178 | | ... | - step_rate - Step of linear search [pps]. Type: float
179 | | ... | - topology_type - Topology type. Type: string
180 | | ... | - min_rate - Lower limit of search [pps]. Type: float
181 | | ... | - max_rate - Upper limit of search [pps]. Type: float
182 | | ...
183 | | ... | *Return:*
184 | | ... | - No value returned
185 | | ...
186 | | ... | *Example:*
187 | | ...
188 | | ... | \| Find NDR using linear search and pps \| 64 \| 5000000 \
189 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \|
190 | | ...
191 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
192 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
193 | | ...
194 | | ${duration}= | Set Variable | ${perf_trial_duration}
195 | | Set Duration | ${duration}
196 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
197 | | Set Search Linear Step | ${step_rate}
198 | | Set Search Frame Size | ${framesize}
199 | | Set Search Rate Type pps
200 | | Linear Search | ${start_rate} | ${topology_type}
201 | | ${rate_per_stream} | ${lat}= | Verify Search Result
202 | | ${tmp}= | Create List | 100%NDR | ${lat}
203 | | ${latency}= | Create List | ${tmp}
204 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
205 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
206 | | ... | ${framesize} | ${topology_type}
207 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
208 | | Append To List | ${latency} | ${tmp}
209 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
210 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
211 | | ... | ${framesize} | ${topology_type}
212 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
213 | | Append To List | ${latency} | ${tmp}
214 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
215 | | ... | ${latency}
216 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
217 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
218
219 | Find PDR using linear search and pps
220 | | [Documentation]
221 | | ... | Find throughput by using RFC2544 linear search with partial drop rate
222 | | ... | with PDR threshold and type specified by parameter.
223 | | ...
224 | | ... | *Arguments:*
225 | | ... | - framesize - L2 Frame Size [B]. Type: integer
226 | | ... | - start_rate - Initial start rate [pps]. Type: float
227 | | ... | - step_rate - Step of linear search [pps]. Type: float
228 | | ... | - topology_type - Topology type. Type: string
229 | | ... | - min_rate - Lower limit of search [pps]. Type: float
230 | | ... | - max_rate - Upper limit of search [pps]. Type: float
231 | | ... | - loss_acceptance - Accepted loss during search. Type: float
232 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
233 | | ...
234 | | ... | *Example:*
235 | | ...
236 | | ... | \| Find PDR using linear search and pps \| 64 \| 5000000 \
237 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 0.5 \| percentage \|
238 | | ...
239 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
240 | | ... | ${topology_type} | ${min_rate} | ${max_rate}
241 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
242 | | ...
243 | | ${duration}= | Set Variable | ${perf_trial_duration}
244 | | Set Duration | ${duration}
245 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
246 | | Set Search Linear Step | ${step_rate}
247 | | Set Search Frame Size | ${framesize}
248 | | Set Search Rate Type pps
249 | | Set Loss Acceptance | ${loss_acceptance}
250 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
251 | | ... | Set Loss Acceptance Type Percentage
252 | | Linear Search | ${start_rate} | ${topology_type}
253 | | ${rate_per_stream} | ${lat}= | Verify Search Result
254 | | ${tmp}= | Create List | 100%PDR | ${lat}
255 | | ${latency}= | Create List | ${tmp}
256 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
257 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
258 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
259 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
260 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
261
262 | Find NDR using binary search and pps
263 | | [Documentation]
264 | | ... | Find throughput by using RFC2544 binary search with non drop rate.
265 | | ...
266 | | ... | *Arguments:*
267 | | ... | - framesize - L2 Frame Size [B]. Type: integer
268 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
269 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
270 | | ... | - topology_type - Topology type. Type: string
271 | | ... | - min_rate - Lower limit of search [pps]. Type: float
272 | | ... | - max_rate - Upper limit of search [pps]. Type: float
273 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
274 | | ...
275 | | ... | *Example:*
276 | | ...
277 | | ... | \| Find NDR using binary search and pps \| 64 \| 6000000 \
278 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \|
279 | | ...
280 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
281 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
282 | | ...
283 | | ${duration}= | Set Variable | ${perf_trial_duration}
284 | | Set Duration | ${duration}
285 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
286 | | Set Search Frame Size | ${framesize}
287 | | Set Search Rate Type pps
288 | | Set Binary Convergence Threshold | ${threshold}
289 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
290 | | ${rate_per_stream} | ${lat}= | Verify Search Result
291 | | ${tmp}= | Create List | 100%NDR | ${lat}
292 | | ${latency}= | Create List | ${tmp}
293 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
294 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
295 | | ... | ${framesize} | ${topology_type}
296 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
297 | | Append To List | ${latency} | ${tmp}
298 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
299 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
300 | | ... | ${framesize} | ${topology_type}
301 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
302 | | Append To List | ${latency} | ${tmp}
303 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
304 | | ... | ${latency}
305 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
306 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
307
308 | Find PDR using binary search and pps
309 | | [Documentation]
310 | | ... | Find throughput by using RFC2544 binary search with partial drop rate
311 | | ... | with PDR threshold and type specified by parameter.
312 | | ...
313 | | ... | *Arguments:*
314 | | ... | - framesize - L2 Frame Size [B]. Type: integer
315 | | ... | - binary_min - Lower boundary of search [pps]. Type: float
316 | | ... | - binary_max - Upper boundary of search [pps]. Type: float
317 | | ... | - topology_type - Topology type. Type: string
318 | | ... | - min_rate - Lower limit of search [pps]. Type: float
319 | | ... | - max_rate - Upper limit of search [pps]. Type: float
320 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
321 | | ... | - loss_acceptance - Accepted loss during search. Type: float
322 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
323 | | ...
324 | | ... | *Example:*
325 | | ...
326 | | ... | \| Find PDR using binary search and pps \| 64 \| 6000000 \
327 | | ... | \| 12000000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 50000 \| 0.5 \
328 | | ... | \| percentage \|
329 | | ...
330 | | [Arguments] | ${framesize} | ${binary_min} | ${binary_max}
331 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
332 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
333 | | ...
334 | | ${duration}= | Set Variable | ${perf_trial_duration}
335 | | Set Duration | ${duration}
336 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
337 | | Set Search Frame Size | ${framesize}
338 | | Set Search Rate Type pps
339 | | Set Loss Acceptance | ${loss_acceptance}
340 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
341 | | ... | Set Loss Acceptance Type Percentage
342 | | Set Binary Convergence Threshold | ${threshold}
343 | | Binary Search | ${binary_min} | ${binary_max} | ${topology_type}
344 | | ${rate_per_stream} | ${lat}= | Verify Search Result
345 | | ${tmp}= | Create List | 100%PDR | ${lat}
346 | | ${latency}= | Create List | ${tmp}
347 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
348 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
349 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
350 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
351 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
352
353 | Find NDR using combined search and pps
354 | | [Documentation]
355 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
356 | | ... | non drop rate.
357 | | ...
358 | | ... | *Arguments:*
359 | | ... | - framesize - L2 Frame Size [B]. Type: integer
360 | | ... | - start_rate - Initial start rate [pps]. Type: float
361 | | ... | - step_rate - Step of linear search [pps]. Type: float
362 | | ... | - topology_type - Topology type. Type: string
363 | | ... | - min_rate - Lower limit of search [pps]. Type: float
364 | | ... | - max_rate - Upper limit of search [pps]. Type: float
365 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
366 | | ...
367 | | ... | *Example:*
368 | | ...
369 | | ... | \| Find NDR using combined search and pps \| 64 \| 5000000 \
370 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \|
371 | | ...
372 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
373 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
374 | | ...
375 | | ${duration}= | Set Variable | ${perf_trial_duration}
376 | | Set Duration | ${duration}
377 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
378 | | Set Search Linear Step | ${step_rate}
379 | | Set Search Frame Size | ${framesize}
380 | | Set Search Rate Type pps
381 | | Set Binary Convergence Threshold | ${threshold}
382 | | Combined Search | ${start_rate} | ${topology_type}
383 | | ${rate_per_stream} | ${lat}= | Verify Search Result
384 | | ${tmp}= | Create List | 100%NDR | ${lat}
385 | | ${latency}= | Create List | ${tmp}
386 | | ${rate_50p}= | Evaluate | int(${rate_per_stream}*0.5)
387 | | ${lat_50p}= | Measure latency pps | ${duration} | ${rate_50p}
388 | | ... | ${framesize} | ${topology_type}
389 | | ${tmp}= | Create List | 50%NDR | ${lat_50p}
390 | | Append To List | ${latency} | ${tmp}
391 | | ${rate_10p}= | Evaluate | int(${rate_per_stream}*0.1)
392 | | ${lat_10p}= | Measure latency pps | ${duration} | ${rate_10p}
393 | | ... | ${framesize} | ${topology_type}
394 | | ${tmp}= | Create List | 10%NDR | ${lat_10p}
395 | | Append To List | ${latency} | ${tmp}
396 | | Display result of NDR search | ${rate_per_stream} | ${framesize} | 2
397 | | ... | ${latency}
398 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
399 | | ... | ${framesize} | ${topology_type}
400 | | ... | fail_on_loss=${False}
401
402 | Find PDR using combined search and pps
403 | | [Documentation]
404 | | ... | Find throughput by using RFC2544 combined search (linear+binary) with
405 | | ... | partial drop rate with PDR threshold and type specified by parameter.
406 | | ...
407 | | ... | *Arguments:*
408 | | ... | - framesize - L2 Frame Size [B]. Type: integer
409 | | ... | - start_rate - Initial start rate [pps]. Type: float
410 | | ... | - step_rate - Step of linear search [pps]. Type: float
411 | | ... | - topology_type - Topology type. Type: string
412 | | ... | - min_rate - Lower limit of search [pps]. Type: float
413 | | ... | - max_rate - Upper limit of search [pps]. Type: float
414 | | ... | - threshold - Threshold to stop search [pps]. Type: integer
415 | | ... | - loss_acceptance - Accepted loss during search. Type: float
416 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
417 | | ...
418 | | ... | *Example:*
419 | | ...
420 | | ... | \| Find PDR using combined search and pps \| 64 \| 5000000 \
421 | | ... | \| 100000 \| 3-node-IPv4 \| 100000 \| 14880952 \| 5000 \| 0.5 \
422 | | ... | \| percentage \|
423 | | ...
424 | | [Arguments] | ${framesize} | ${start_rate} | ${step_rate}
425 | | ... | ${topology_type} | ${min_rate} | ${max_rate} | ${threshold}
426 | | ... | ${loss_acceptance}=0 | ${loss_acceptance_type}='frames'
427 | | ...
428 | | ${duration}= | Set Variable | ${perf_trial_duration}
429 | | Set Duration | ${duration}
430 | | Set Search Rate Boundaries | ${max_rate} | ${min_rate}
431 | | Set Search Linear Step | ${step_rate}
432 | | Set Search Frame Size | ${framesize}
433 | | Set Search Rate Type pps
434 | | Set Loss Acceptance | ${loss_acceptance}
435 | | Run Keyword If | '${loss_acceptance_type}' == 'percentage'
436 | | ... | Set Loss Acceptance Type Percentage
437 | | Set Binary Convergence Threshold | ${threshold}
438 | | Combined Search | ${start_rate} | ${topology_type}
439 | | ${rate_per_stream} | ${lat}= | Verify Search Result
440 | | ${tmp}= | Create List | 100%PDR | ${lat}
441 | | ${latency}= | Create List | ${tmp}
442 | | Display result of PDR search | ${rate_per_stream} | ${framesize} | 2
443 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
444 | | Traffic should pass with partial loss | ${duration} | ${rate_per_stream}pps
445 | | ... | ${framesize} | ${topology_type} | ${loss_acceptance}
446 | | ... | ${loss_acceptance_type} | fail_on_loss=${False}
447
448 | Find NDR and PDR intervals using optimized search
449 | | [Documentation]
450 | | ... | Find boundaries for RFC2544 compatible NDR and PDR values
451 | | ... | using an optimized search algorithm.
452 | | ... | Display results as formatted test message.
453 | | ... | Fail if a resulting lower bound has too high loss fraction.
454 | | ... | Proceed with Perform additional measurements based on NDRPDR result.
455 | | ... | Input rates are understood as uni-directional,
456 | | ... | reported result contains bi-directional rates.
457 | | ...
458 | | ... | TODO: Should the trial duration of the additional
459 | | ... | measurements be configurable?
460 | | ...
461 | | ... | *Arguments:*
462 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
463 | | ... | - topology_type - Topology type. Type: string
464 | | ... | - minimum_transmit_rate - Lower limit of search [pps]. Type: float
465 | | ... | - maximum_transmit_rate - Upper limit of search [pps]. Type: float
466 | | ... | - packet_loss_ratio - Accepted loss during search. Type: float
467 | | ... | - final_relative_width - Maximal width multiple of upper. Type: float
468 | | ... | - final_trial_duration - Duration of final trials [s]. Type: float
469 | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float
470 | | ... | - intermediate phases - Number of intermediate phases [1]. Type: int
471 | | ... | - timeout - Fail if search duration is longer [s]. Type: float
472 | | ...
473 | | ... | *Example:*
474 | | ...
475 | | ... | \| Find NDR and PDR intervals using optimized search \| \${64} \| \
476 | | ... | 3-node-IPv4 \| \${100000} \| \${14880952} \| \${0.005} \| \${0.005} \
477 | | ... | \| \${30.0} \| \${1.0} \| \${2} \| ${600.0} \|
478 | | ...
479 | | [Arguments] | ${frame_size} | ${topology_type} | ${minimum_transmit_rate}
480 | | ... | ${maximum_transmit_rate} | ${packet_loss_ratio}=${0.005}
481 | | ... | ${final_relative_width}=${0.005} | ${final_trial_duration}=${30.0}
482 | | ... | ${initial_trial_duration}=${1.0}
483 | | ... | ${number_of_intermediate_phases}=${2} | ${timeout}=${720.0}
484 | | ...
485 | | ${result} = | Perform optimized ndrpdr search | ${frame_size}
486 | | ... | ${topology_type} | ${minimum_transmit_rate*2}
487 | | ... | ${maximum_transmit_rate*2} | ${packet_loss_ratio}
488 | | ... | ${final_relative_width} | ${final_trial_duration}
489 | | ... | ${initial_trial_duration} | ${number_of_intermediate_phases}
490 | | ... | timeout=${timeout}
491 | | Display result of NDRPDR search | ${result} | ${frame_size}
492 | | Check NDRPDR interval validity | ${result.pdr_interval}
493 | | ... | ${packet_loss_ratio}
494 | | Check NDRPDR interval validity | ${result.ndr_interval}
495 | | Perform additional measurements based on NDRPDR result
496 | | ... | ${result} | ${frame_size} | ${topology_type}
497
498 | Display single bound
499 | | [Documentation]
500 | | ... | Display one bound of NDR+PDR search,
501 | | ... | in packet per seconds (total and per stream)
502 | | ... | and Gbps total bandwidth with untagged packet.
503 | | ... | Througput is calculated as:
504 | | ... | Measured rate per stream * Total number of streams
505 | | ... | Bandwidth is calculated as:
506 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
507 | | ... | The given result should contain latency data as well.
508 | | ...
509 | | ... | *Arguments:*
510 | | ... | - text - Flavor text describing which bound is this. Type: string
511 | | ... | - rate_total - Total (not per stream) measured Tr [pps]. Type: float
512 | | ... | - framesize - L2 Frame Size [B]. Type: integer
513 | | ... | - latency - Latency data to display if non-empty. Type: string
514 | | ...
515 | | ... | *Example:*
516 | | ...
517 | | ... | \| Display single bound \| NDR lower bound \| \${12345.67} \
518 | | ... | \| \${64} \| show_latency=\${EMPTY} \|
519 | | ...
520 | | [Arguments] | ${text} | ${rate_total} | ${framesize} | ${latency}=${EMPTY}
521 | | ...
522 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
523 | | Set Test Message | ${\n}${text}: ${rate_total} pps, | append=yes
524 | | Set Test Message | ${bandwidth_total} Gbps (untagged) | append=yes
525 | | Return From Keyword If | not """${latency}"""
526 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] per stream: ${latency}
527 | | ... | append=yes
528
529 | Display result of NDRPDR search
530 | | [Documentation]
531 | | ... | Display result of NDR+PDR search, both quantities, both bounds,
532 | | ... | in packet per seconds (total and per stream)
533 | | ... | and Gbps total bandwidth with untagged packet.
534 | | ... | Througput is calculated as:
535 | | ... | Measured rate per stream * Total number of streams
536 | | ... | Bandwidth is calculated as:
537 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
538 | | ... | The given result should contain latency data as well.
539 | | ...
540 | | ... | *Arguments:*
541 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
542 | | ... | - framesize - L2 Frame Size [B]. Type: integer
543 | | ...
544 | | ... | *Example:*
545 | | ...
546 | | ... | \| Display result of NDRPDR search \| \${result} \| \${64} \|
547 | | ...
548 | | [Arguments] | ${result} | ${framesize}
549 | | ...
550 | | ${framesize}= | Get Frame Size | ${framesize}
551 | | Display single bound | NDR_LOWER
552 | | ... | ${result.ndr_interval.measured_low.transmit_rate} | ${framesize}
553 | | ... | ${result.ndr_interval.measured_low.latency}
554 | | Display single bound | NDR_UPPER
555 | | ... | ${result.ndr_interval.measured_high.transmit_rate} | ${framesize}
556 | | Display single bound | PDR_LOWER
557 | | ... | ${result.pdr_interval.measured_low.transmit_rate} | ${framesize}
558 | | ... | ${result.pdr_interval.measured_low.latency}
559 | | Display single bound | PDR_UPPER
560 | | ... | ${result.pdr_interval.measured_high.transmit_rate} | ${framesize}
561
562 | Check NDRPDR interval validity
563 | | [Documentation]
564 | | ... | Extract loss ratio of lower bound of the interval.
565 | | ... | Fail if it does not reach the allowed value.
566 | | ...
567 | | ... | *Arguments:*
568 | | ... | - interval - Measured interval. Type: ReceiveRateInterval
569 | | ... | - packet_loss_ratio - Accepted loss (0.0 for NDR). Type: float
570 | | ...
571 | | ... | *Example:*
572 | | ...
573 | | ... | \| Check NDRPDR interval validity \| \${result.pdr_interval} \
574 | | ... | \| \${0.005} \|
575 | | ...
576 | | [Arguments] | ${interval} | ${packet_loss_ratio}=${0.0}
577 | | ...
578 | | ${lower_bound} = | Set Variable | ${interval.measured_low}
579 | | ${lower_bound_lf} = | Set Variable | ${lower_bound.loss_fraction}
580 | | Return From Keyword If | ${lower_bound_lf} <= ${packet_loss_ratio}
581 | | ${message}= | Catenate | SEPARATOR=${SPACE}
582 | | ... | Minimal rate loss fraction ${lower_bound_lf}
583 | | ... | does not reach target ${packet_loss_ratio}.
584 | | ${message_zero} = | Set Variable | Zero packets forwarded!
585 | | ${message_other} = | Set Variable | ${lower_bound.loss_count} packets lost.
586 | | ${message} = | Set Variable If | ${lower_bound_lf} >= 1.0
587 | | ... | ${message}${\n}${message_zero} | ${message}${\n}${message_other}
588 | | Fail | ${message}
589
590 | Perform additional measurements based on NDRPDR result
591 | | [Documentation]
592 | | ... | Perform any additional measurements which are not directly needed
593 | | ... | for determining NDR nor PDR, but which are needed for gathering
594 | | ... | additional data for debug purposes.
595 | | ... | Currently, just "Traffic should pass with no loss" is called.
596 | | ... | TODO: Move latency measurements from optimized search here.
597 | | ...
598 | | ... | *Arguments:*
599 | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult
600 | | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str
601 | | ... | - topology_type - Topology type. Type: string
602 | | ...
603 | | ... | *Example:*
604 | | ... | \| Perform additional measurements based on NDRPDR result \
605 | | ... | \| \${result} \| ${64} \| 3-node-IPv4 \|
606 | | ...
607 | | [Arguments] | ${result} | ${framesize} | ${topology_type}
608 | | ...
609 | | ${duration}= | Set Variable | 5.0
610 | | ${rate_per_stream}= | Evaluate
611 | | ... | ${result.ndr_interval.measured_low.target_tr} / 2.0
612 | | Traffic should pass with no loss | ${duration} | ${rate_per_stream}pps
613 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
614
615 | Display result of NDR search
616 | | [Documentation]
617 | | ... | Display result of NDR search in packet per seconds (total and per
618 | | ... | stream) and Gbps total bandwidth with untagged packet.
619 | | ... | Througput is calculated as:
620 | | ... | Measured rate per stream * Total number of streams
621 | | ... | Bandwidth is calculated as:
622 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
623 | | ...
624 | | ... | *Arguments:*
625 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
626 | | ... | - framesize - L2 Frame Size [B]. Type: integer
627 | | ... | - nr_streams - Total number of streams. Type: integer
628 | | ... | - latency - Latency stats. Type: dictionary
629 | | ...
630 | | ... | *Example:*
631 | | ...
632 | | ... | \| Display result of NDR search \| 4400000 \| 64 \| 2 \
633 | | ... | \| [100%NDR, [10/10/10, 1/2/3]] \|
634 | | ...
635 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams} | ${latency}
636 | | ...
637 | | ${framesize}= | Get Frame Size | ${framesize}
638 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
639 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
640 | | Set Test Message | FINAL_RATE: ${rate_total} pps
641 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
642 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
643 | | ... | append=yes
644 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
645 | | :FOR | ${lat} | IN | @{latency}
646 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
647
648 | Display result of PDR search
649 | | [Documentation]
650 | | ... | Display result of PDR search in packet per seconds (total and per
651 | | ... | stream) and Gbps total bandwidth with untagged packet.
652 | | ... | Througput is calculated as:
653 | | ... | Measured rate per stream * Total number of streams
654 | | ... | Bandwidth is calculated as:
655 | | ... | (Throughput * (L2 Frame Size + IPG) * 8) / Max bitrate of NIC
656 | | ...
657 | | ... | *Arguments:*
658 | | ... | - rate_per_stream - Measured rate per stream [pps]. Type: string
659 | | ... | - framesize - L2 Frame Size [B]. Type: integer
660 | | ... | - nr_streams - Total number of streams. Type: integer
661 | | ... | - loss_acceptance - Accepted loss during search. Type: float
662 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
663 | | ... | - latency - Latency stats. Type: dictionary
664 | | ...
665 | | ... | *Example:*
666 | | ...
667 | | ... | \| Display result of PDR search \| 4400000 \| 64 \| 2 \| 0.5 \
668 | | ... | \| percentage \| [100%NDR, [10/10/10, 1/2/3]] \|
669 | | ...
670 | | [Arguments] | ${rate_per_stream} | ${framesize} | ${nr_streams}
671 | | ... | ${loss_acceptance} | ${loss_acceptance_type} | ${latency}
672 | | ...
673 | | ${framesize}= | Get Frame Size | ${framesize}
674 | | ${rate_total}= | Evaluate | ${rate_per_stream}*${nr_streams}
675 | | ${bandwidth_total}= | Evaluate | ${rate_total}*(${framesize}+20)*8/(10**9)
676 | | Set Test Message | FINAL_RATE: ${rate_total} pps
677 | | Set Test Message | (${nr_streams}x ${rate_per_stream} pps) | append=yes
678 | | Set Test Message | ${\n}FINAL_BANDWIDTH: ${bandwidth_total} Gbps (untagged)
679 | | ... | append=yes
680 | | Set Test Message | ${\n}LATENCY usec [min/avg/max] | append=yes
681 | | :FOR | ${lat} | IN | @{latency}
682 | | | Set Test Message | ${\n}LAT_${lat[0]}: ${lat[1]} | append=yes
683 | | Set Test Message
684 | | ... | ${\n}LOSS_ACCEPTANCE: ${loss_acceptance} ${loss_acceptance_type}
685 | | ... | append=yes
686
687 | Measure latency pps
688 | | [Documentation]
689 | | ... | Send traffic at specified rate. Measure min/avg/max latency
690 | | ...
691 | | ... | *Arguments:*
692 | | ... | - duration - Duration of traffic run [s]. Type: integer
693 | | ... | - rate - Rate for sending packets. Type: integer
694 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
695 | | ... | - topology_type - Topology type. Type: string
696 | | ...
697 | | ... | *Example:*
698 | | ...
699 | | ... | \| Measure latency \| 10 \| 4.0 \| 64 \| 3-node-IPv4 \|
700 | | ...
701 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
702 | | ...
703 | | Return From Keyword If | ${rate} <= 10000 | ${-1}
704 | | Send traffic on tg | ${duration} | ${rate}pps | ${framesize}
705 | | ... | ${topology_type} | warmup_time=0
706 | | Run keyword and return | Get latency
707
708 | Traffic should pass with no loss
709 | | [Documentation]
710 | | ... | Send traffic at specified rate. No packet loss is accepted at loss
711 | | ... | evaluation.
712 | | ...
713 | | ... | *Arguments:*
714 | | ... | - duration - Duration of traffic run [s]. Type: integer
715 | | ... | - rate - Rate for sending packets. Type: string
716 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
717 | | ... | - topology_type - Topology type. Type: string
718 | | ... | - fail_on_loss - If True, the keyword fails if loss occurred.
719 | | ... | Type: boolean
720 | | ...
721 | | ... | *Example:*
722 | | ...
723 | | ... | \| Traffic should pass with no loss \| 10 \| 4.0mpps \| 64 \
724 | | ... | \| 3-node-IPv4 \|
725 | | ...
726 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
727 | | ... | ${fail_on_loss}=${True}
728 | | ...
729 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
730 | | ... | ${topology_type}
731 | | Run Keyword If | ${fail_on_loss} | No traffic loss occurred
732
733 | Traffic should pass with partial loss
734 | | [Documentation]
735 | | ... | Send traffic at specified rate. Partial packet loss is accepted
736 | | ... | within loss acceptance value specified as argument.
737 | | ...
738 | | ... | *Arguments:*
739 | | ... | - duration - Duration of traffic run [s]. Type: integer
740 | | ... | - rate - Rate for sending packets. Type: string
741 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
742 | | ... | - topology_type - Topology type. Type: string
743 | | ... | - loss_acceptance - Accepted loss during search. Type: float
744 | | ... | - loss_acceptance_type - Percentage or frames. Type: string
745 | | ...
746 | | ... | *Example:*
747 | | ...
748 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
749 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
750 | | ...
751 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
752 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
753 | | ... | ${fail_on_loss}=${True}
754 | | ...
755 | | Send traffic at specified rate | ${duration} | ${rate} | ${framesize}
756 | | ... | ${topology_type}
757 | | Run Keyword If | ${fail_on_loss} | Partial traffic loss accepted
758 | | ... | ${loss_acceptance} | ${loss_acceptance_type}
759
760 | Traffic should pass with maximum rate
761 | | [Documentation]
762 | | ... | Send traffic at maximum rate.
763 | | ...
764 | | ... | *Arguments:*
765 | | ... | - rate - Rate for sending packets. Type: string
766 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
767 | | ... | - topology_type - Topology type. Type: string
768 | | ... | - subsamples - How many trials in this measurement. Type:int
769 | | ... | - trial_duration - Duration of single trial [s]. Type: float
770 | | ... | - fail_no_traffic - Whether to fail on zero receive count. Type: boolean
771 | | ...
772 | | ... | *Example:*
773 | | ...
774 | | ... | \| Traffic should pass with maximum rate \| 4.0mpps \| 64 \
775 | | ... | \| 3-node-IPv4 \| ${1} \| ${10.0} | ${False} \|
776 | | ...
777 | | [Arguments] | ${rate} | ${framesize} | ${topology_type}
778 | | ... | ${trial_duration}=${perf_trial_duration} | ${fail_no_traffic}=${True}
779 | | ... | ${subsamples}=${perf_trial_multiplicity}
780 | | ...
781 | | ${results} = | Send traffic at specified rate | ${trial_duration} | ${rate}
782 | | ... | ${framesize} | ${topology_type} | ${subsamples}
783 | | Set Test Message | ${\n}Maximum Receive Rate trial results
784 | | Set Test Message | in packets per second: ${results}
785 | | ... | append=yes
786 | | # TODO: Should we also report the percentage relative to transmit rate,
787 | | # so that people looking at console can decide how close to 100% it is?
788 | | Run Keyword If | ${fail_no_traffic} | Fail if no traffic forwarded
789
790 | Send traffic at specified rate
791 | | [Documentation]
792 | | ... | Send traffic at specified rate.
793 | | ... | Return list of measured receive rates.
794 | | ...
795 | | ... | *Arguments:*
796 | | ... | - trial_duration - Duration of single trial [s]. Type: float
797 | | ... | - rate - Rate for sending packets. Type: string
798 | | ... | - framesize - L2 Frame Size [B]. Type: integer/string
799 | | ... | - topology_type - Topology type. Type: string
800 | | ... | - subsamples - How many trials in this measurement. Type: int
801 | | ...
802 | | ... | *Example:*
803 | | ...
804 | | ... | \| Send traffic at specified rate \| ${1.0} \| 4.0mpps \| 64 \
805 | | ... | \| 3-node-IPv4 \| ${10} \|
806 | | ...
807 | | [Arguments] | ${trial_duration} | ${rate} | ${framesize}
808 | | ... | ${topology_type} | ${subsamples}=${1}
809 | | ...
810 | | Clear and show runtime counters with running traffic | ${trial_duration}
811 | | ... | ${rate} | ${framesize} | ${topology_type}
812 | | Run Keyword If | ${dut_stats}==${True} | Clear all counters on all DUTs
813 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
814 | | ... | VPP Enable Traces On All DUTs | ${nodes}
815 | | ${results} = | Create List
816 | | :FOR | ${i} | IN RANGE | ${subsamples}
817 | | | Send traffic on tg | ${trial_duration} | ${rate} | ${framesize}
818 | | | ... | ${topology_type} | warmup_time=0
819 | | | ${rx} = | Get Received
820 | | | ${rr} = | Evaluate | ${rx} / ${trial_duration}
821 | | | Append To List | ${results} | ${rr}
822 | | Run Keyword If | ${dut_stats}==${True} | Show statistics on all DUTs
823 | | ... | ${nodes}
824 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
825 | | ... | Show Packet Trace On All Duts | ${nodes} | maximum=${100}
826 | | Return From Keyword | ${results}
827
828 | Clear and show runtime counters with running traffic
829 | | [Documentation]
830 | | ... | Start traffic at specified rate then clear runtime counters on all
831 | | ... | DUTs. Wait for specified amount of time and capture runtime counters
832 | | ... | on all DUTs. Finally stop traffic
833 | | ...
834 | | ... | *Arguments:*
835 | | ... | - duration - Duration of traffic run [s]. Type: integer
836 | | ... | - rate - Rate for sending packets. Type: string
837 | | ... | - framesize - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string
838 | | ... | - topology_type - Topology type. Type: string
839 | | ...
840 | | ... | *Example:*
841 | | ...
842 | | ... | \| Traffic should pass with partial loss \| 10 \| 4.0mpps \| 64 \
843 | | ... | \| 3-node-IPv4 \| 0.5 \| percentage \|
844 | | ...
845 | | [Arguments] | ${duration} | ${rate} | ${framesize} | ${topology_type}
846 | | ...
847 | | Send traffic on tg | -1 | ${rate} | ${framesize} | ${topology_type}
848 | | ... | warmup_time=0 | async_call=${True} | latency=${False}
849 | | Run Keyword If | ${dut_stats}==${True}
850 | | ... | Clear runtime counters on all DUTs | ${nodes}
851 | | Sleep | ${duration}
852 | | Run Keyword If | ${dut_stats}==${True}
853 | | ... | Show runtime counters on all DUTs | ${nodes}
854 | | Stop traffic on tg