1 # Copyright (c) 2017 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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 | Resource | resources/libraries/robot/performance/performance_setup.robot
16 | Library | resources.libraries.python.QemuUtils
18 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | NDRPDRDISC
19 | ... | NIC_Intel-X520-DA2 | ETH | IP4FWD | BASE | VHOST | VM | VHOST_256
22 | Suite Setup | Set up 3-node performance topology with DUT's NIC model
23 | ... | L3 | Intel-X520-DA2
24 | Suite Teardown | Tear down 3-node performance topology
26 | Test Setup | Set up performance test
27 | Test Teardown | Tear down performance test with vhost and VM with dpdk-testpmd
28 | ... | ${min_rate}pps | ${framesize} | ${traffic_profile}
29 | ... | dut1_node=${dut1} | dut1_vm_refs=${dut1_vm_refs}
30 | ... | dut2_node=${dut2} | dut2_vm_refs=${dut2_vm_refs}
32 | Documentation | *RFC2544: Packet throughput IP4 test cases with vhost*
34 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
35 | ... | with single links between nodes.
36 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4 for IPv4 routing.
37 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4
38 | ... | routing and two static IPv4 /24 route entries. Qemu Guest is connected
39 | ... | to VPP via vhost-user interfaces. Guest is running DPDK testpmd
40 | ... | interconnecting vhost-user interfaces using 5 cores pinned to cpus 5-9
41 | ... | and 2048M memory. Testpmd is using socket-mem=1024M (512x2M hugepages),
42 | ... | 5 cores (1 main core and 4 cores dedicated for io), forwarding mode is
43 | ... | set to mac, rxd/txd=256, burst=64. Scheduler policy is set to SCHED_RR
44 | ... | with priority 1 for all Qemu CPUs. DUT1, DUT2 are tested with 2p10GE
45 | ... | NIC X520 Niantic by Intel.
46 | ... | *[Ver] TG verification:* TG finds and reports throughput NDR (Non Drop
47 | ... | Rate) with zero packet loss tolerance or throughput PDR (Partial Drop
48 | ... | Rate) with non-zero packet loss tolerance (LT) expressed in percentage
49 | ... | of packets transmitted. NDR and PDR are discovered for different
50 | ... | Ethernet L2 frame sizes using either binary search or linear search
51 | ... | algorithms with configured starting rate and final step that determines
52 | ... | throughput measurement resolution. Test packets are generated by TG on
53 | ... | links to DUTs. TG traffic profile contains two L3 flow-groups
54 | ... | (flow-group per direction, 253 flows per flow-group) with all packets
55 | ... | containing Ethernet header, IPv4 header with IP protocol=61 and static
56 | ... | payload. MAC addresses are matching MAC addresses of the TG node
58 | ... | *[Ref] Applicable standard specifications:* RFC2544.
61 | ${avg_imix_framesize}= | ${357.833}
62 # X520-DA2 bandwidth limit
63 | ${s_limit} | ${10000000000}
65 | ${sock1}= | /tmp/sock-1-1
66 | ${sock2}= | /tmp/sock-1-2
68 | ${fib_table_1}= | 100
69 | ${fib_table_2}= | 101
71 | ${traffic_profile} | trex-sl-3n-ethip4-ip4src253
74 | Discover NDR or PDR for IPv4 forwarding with VM
75 | | [Arguments] | ${wt} | ${rxq} | ${framesize} | ${min_rate} | ${search_type}
78 | | ... | [Cfg] DUT runs IP4 routing config with required number of threads,\
79 | | ... | phy cores and receive queues per NIC port.
80 | | ... | [Ver] Find NDR or PDR for defined frame size using binary search\
81 | | ... | start at 10GE linerate with specified step.
83 | | ... | *Arguments:*
84 | | ... | - wt - Number of worker threads to be used. Type: integer
85 | | ... | - rxq - Number of Rx queues to be used. Type: integer
86 | | ... | - framesize - L2 Frame Size [B]. Type: integer
87 | | ... | - min_rate - Lower limit of search [pps]. Type: float
88 | | ... | - search_type - Type of the search - non drop rate (NDR) or partial
89 | | ... | drop rare (PDR). Type: string
91 | | Set Test Variable | ${perf_qemu_qsz} | 256
92 | | Set Test Variable | ${use_tuned_cfs} | ${True}
93 | | Set Test Variable | ${framesize}
94 | | Set Test Variable | ${min_rate}
95 | | ${get_framesize}= | Set Variable If
96 | | ... | "${framesize}" == "IMIX_v4_1" | ${avg_imix_framesize}
97 | | ... | ${framesize}
98 | | ${max_rate}= | Calculate pps | ${s_limit} | ${get_framesize}
99 | | ${binary_min}= | Set Variable | ${min_rate}
100 | | ${binary_max}= | Set Variable | ${max_rate}
101 | | ${threshold}= | Set Variable | ${min_rate}
102 | | ${dut1_vm_refs}= | Create Dictionary
103 | | ${dut2_vm_refs}= | Create Dictionary
104 | | Set Test Variable | ${dut1_vm_refs}
105 | | Set Test Variable | ${dut2_vm_refs}
106 | | Given Add '${wt}' worker threads and '${rxq}' rxqueues in 3-node single-link circular topology
107 | | And Add PCI devices to DUTs in 3-node single link topology
108 | | And Run Keyword If | ${get_framesize} < ${1522} | Add no multi seg to all DUTs
109 | | And Apply startup configuration on all VPP DUTs
110 | | When Initialize IPv4 forwarding with vhost in 3-node circular topology
111 | | ... | ${sock1} | ${sock2}
112 | | ${vm1}= | And Configure guest VM with dpdk-testpmd-mac connected via vhost-user
113 | | ... | ${dut1} | ${sock1} | ${sock2} | DUT1_VM1 | ${dut1_vif1_mac}
114 | | ... | ${dut1_vif2_mac}
115 | | Set To Dictionary | ${dut1_vm_refs} | DUT1_VM1 | ${vm1}
116 | | ${vm2}= | And Configure guest VM with dpdk-testpmd-mac connected via vhost-user
117 | | ... | ${dut2} | ${sock1} | ${sock2} | DUT2_VM1 | ${dut2_vif1_mac}
118 | | ... | ${dut2_vif2_mac}
119 | | Set To Dictionary | ${dut2_vm_refs} | DUT2_VM1 | ${vm2}
120 | | Run Keyword Unless | ${qemu_built} | Set Suite Variable | ${qemu_built}
122 | | Setup Scheduler Policy for Vpp On All DUTs
123 | | Run Keyword If | '${search_type}' == 'NDR'
124 | | ... | Find NDR using binary search and pps
125 | | ... | ${framesize} | ${binary_min} | ${binary_max} | ${traffic_profile}
126 | | ... | ${min_rate} | ${max_rate} | ${threshold}
127 | | ... | ELSE IF | '${search_type}' == 'PDR'
128 | | ... | Find PDR using binary search and pps
129 | | ... | ${framesize} | ${binary_min} | ${binary_max} | ${traffic_profile}
130 | | ... | ${min_rate} | ${max_rate} | ${threshold}
131 | | ... | ${perf_pdr_loss_acceptance} | ${perf_pdr_loss_acceptance_type}
134 | tc01-64B-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
136 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
137 | | ... | 1 receive queue per NIC port.
138 | | ... | [Ver] Find NDR for 64 Byte frames using binary search start at 10GE\
139 | | ... | linerate, step 10kpps.
141 | | [Tags] | 64B | 1T1C | STHREAD | NDRDISC
143 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
144 | | wt=1 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=NDR
146 | tc02-64B-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
148 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
149 | | ... | 1 receive queue per NIC port.
150 | | ... | [Ver] Find PDR for 64 Byte frames using binary search start at 10GE\
151 | | ... | linerate, step 10kpps, LT=0.5%.
153 | | [Tags] | 64B | 1T1C | STHREAD | PDRDISC | SKIP_PATCH
155 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
156 | | wt=1 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=PDR
158 | tc03-1518B-1t1c--ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
160 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
161 | | ... | 1 receive queue per NIC port.
162 | | ... | [Ver] Find NDR for 1518 Byte frames using binary search start at 10GE\
163 | | ... | linerate, step 10kpps.
165 | | [Tags] | 1518B | 1T1C | STHREAD | NDRDISC
167 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
168 | | wt=1 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=NDR
170 | tc04-1518B-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
172 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
173 | | ... | 1 receive queue per NIC port.
174 | | ... | [Ver] Find PDR for 1518 Byte frames using binary search start at 10GE\
175 | | ... | linerate, step 10kpps, LT=0.5%.
177 | | [Tags] | 1518B | 1T1C | STHREAD | PDRDISC | SKIP_PATCH
179 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
180 | | wt=1 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=PDR
182 | tc05-IMIX-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
184 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
185 | | ... | 1 receive queue per NIC port.
186 | | ... | [Ver] Find NDR for IMIX_v4_1 framesize using binary search start at\
187 | | ... | 10GE linerate, step 10kpps.
188 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
190 | | [Tags] | IMIX | 1T1C | STHREAD | NDRDISC
192 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
193 | | wt=1 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=NDR
195 | tc06-IMIX-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
197 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
198 | | ... | 1 receive queue per NIC port.
199 | | ... | [Ver] Find PDR for IMIX_v4_1 framesize using binary search start at\
200 | | ... | 10GE linerate, step 10kpps, LT=0.5%.
201 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
203 | | [Tags] | IMIX | 1T1C | STHREAD | PDRDISC | SKIP_PATCH
205 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
206 | | wt=1 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=PDR
208 | tc07-64B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
210 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
211 | | ... | 1 receive queue per NIC port.
212 | | ... | [Ver] Find NDR for 64 Byte frames using binary search start at 10GE\
213 | | ... | linerate, step 10kpps.
215 | | [Tags] | 64B | 2T2C | STHREAD | NDRDISC
217 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
218 | | wt=2 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=NDR
220 | tc08-64B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
222 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
223 | | ... | 1 receive queue per NIC port.
224 | | ... | [Ver] Find PDR for 64 Byte frames using binary search start at 10GE\
225 | | ... | linerate, step 10kpps, LT=0.5%.
227 | | [Tags] | 64B | 2T2C | STHREAD | PDRDISC | SKIP_PATCH
229 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
230 | | wt=2 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=PDR
232 | tc09-1518B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
234 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
235 | | ... | 1 receive queue per NIC port.
236 | | ... | [Ver] Find NDR for 1518 Byte frames using binary search start at 10GE\
237 | | ... | linerate, step 10kpps.
239 | | [Tags] | 1518B | 2T2C | STHREAD | NDRDISC | SKIP_PATCH
241 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
242 | | wt=2 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=NDR
244 | tc10-1518B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
246 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
247 | | ... | 1 receive queue per NIC port.
248 | | ... | [Ver] Find PDR for 1518 Byte frames using binary search start at 10GE\
249 | | ... | linerate, step 10kpps, LT=0.5%.
251 | | [Tags] | 1518B | 2T2C | STHREAD | PDRDISC | SKIP_PATCH
253 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
254 | | wt=2 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=PDR
256 | tc11-IMIX-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
258 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
259 | | ... | 1 receive queue per NIC port.
260 | | ... | [Ver] Find NDR for IMIX_v4_1 framesize using binary search start at\
261 | | ... | 10GE linerate, step 10kpps.
262 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
264 | | [Tags] | IMIX | 2T2C | STHREAD | NDRDISC | SKIP_PATCH
266 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
267 | | wt=2 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=NDR
269 | tc12-IMIX-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
271 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
272 | | ... | 1 receive queue per NIC port.
273 | | ... | [Ver] Find PDR for IMIX_v4_1 framesize using binary search start at\
274 | | ... | 10GE linerate, step 10kpps.
275 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
277 | | [Tags] | IMIX | 2T2C | STHREAD | PDRDISC | SKIP_PATCH
279 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
280 | | wt=2 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=PDR
282 | tc13-64B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
284 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
285 | | ... | 2 receive queues per NIC port.
286 | | ... | [Ver] Find NDR for 64 Byte frames using binary search start at 10GE\
287 | | ... | linerate, step 10kpps.
289 | | [Tags] | 64B | 4T4C | STHREAD | NDRDISC
291 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
292 | | wt=4 | rxq=2 | framesize=${64} | min_rate=${10000} | search_type=NDR
294 | tc14-64B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
296 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
297 | | ... | 2 receive queues per NIC port.
298 | | ... | [Ver] Find PDR for 64 Byte frames using binary search start at 10GE\
299 | | ... | linerate, step 10kpps, LT=0.5%.
301 | | [Tags] | 64B | 4T4C | STHREAD | PDRDISC | SKIP_PATCH
303 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
304 | | wt=4 | rxq=2 | framesize=${64} | min_rate=${10000} | search_type=PDR
306 | tc15-1518B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
308 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
309 | | ... | 2 receive queues per NIC port.
310 | | ... | [Ver] Find NDR for 1518 Byte frames using binary search start at 10GE\
311 | | ... | linerate, step 10kpps.
313 | | [Tags] | 1518B | 4T4C | STHREAD | NDRDISC | SKIP_PATCH
315 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
316 | | wt=4 | rxq=2 | framesize=${1518} | min_rate=${10000} | search_type=NDR
318 | tc16-1518B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
320 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
321 | | ... | 2 receive queues per NIC port.
322 | | ... | [Ver] Find PDR for 1518 Byte frames using binary search start at 10GE\
323 | | ... | linerate, step 10kpps, LT=0.5%.
325 | | [Tags] | 1518B | 4T4C | STHREAD | PDRDISC | SKIP_PATCH
327 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
328 | | wt=4 | rxq=2 | framesize=${1518} | min_rate=${10000} | search_type=PDR
330 | tc17-IMIX-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
332 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
333 | | ... | 2 receive queues per NIC port.
334 | | ... | [Ver] Find NDR for IMIX_v4_1 framesize using binary search start at\
335 | | ... | 10GE linerate, step 10kpps.
336 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
338 | | [Tags] | IMIX | 4T4C | STHREAD | NDRDISC | SKIP_PATCH
340 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
341 | | wt=4 | rxq=2 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=NDR
343 | tc18-IMIX-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
345 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
346 | | ... | 2 receive queues per NIC port.
347 | | ... | [Ver] Find PDR for IMIX_v4_1 framesize using binary search start at\
348 | | ... | 10GE linerate, step 10kpps, LT=0.5%.
349 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
351 | | [Tags] | IMIX | 4T4C | STHREAD | PDRDISC | SKIP_PATCH
353 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
354 | | wt=4 | rxq=2 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=PDR