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 | ${perf_qemu_qsz}= | 256
62 | ${avg_imix_framesize}= | ${357.833}
63 # X520-DA2 bandwidth limit
64 | ${s_limit} | ${10000000000}
66 | ${sock1}= | /tmp/sock-1-1
67 | ${sock2}= | /tmp/sock-1-2
69 | ${fib_table_1}= | 100
70 | ${fib_table_2}= | 101
72 | ${traffic_profile}= | trex-sl-3n-ethip4-ip4src253
75 | Discover NDR or PDR for IPv4 forwarding with VM
76 | | [Arguments] | ${wt} | ${rxq} | ${framesize} | ${min_rate} | ${search_type}
79 | | ... | [Cfg] DUT runs IP4 routing config with required number of threads,\
80 | | ... | phy cores and receive queues per NIC port.
81 | | ... | [Ver] Find NDR or PDR for defined frame size using binary search\
82 | | ... | start at 10GE linerate with specified step.
84 | | ... | *Arguments:*
85 | | ... | - wt - Number of worker threads to be used. Type: integer
86 | | ... | - rxq - Number of Rx queues to be used. Type: integer
87 | | ... | - framesize - L2 Frame Size [B]. Type: integer
88 | | ... | - min_rate - Lower limit of search [pps]. Type: float
89 | | ... | - search_type - Type of the search - non drop rate (NDR) or partial
90 | | ... | drop rare (PDR). Type: string
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 | | Setup Scheduler Policy for Vpp On All DUTs
121 | | Run Keyword If | '${search_type}' == 'NDR'
122 | | ... | Find NDR using binary search and pps
123 | | ... | ${framesize} | ${binary_min} | ${binary_max} | ${traffic_profile}
124 | | ... | ${min_rate} | ${max_rate} | ${threshold}
125 | | ... | ELSE IF | '${search_type}' == 'PDR'
126 | | ... | Find PDR using binary search and pps
127 | | ... | ${framesize} | ${binary_min} | ${binary_max} | ${traffic_profile}
128 | | ... | ${min_rate} | ${max_rate} | ${threshold}
129 | | ... | ${perf_pdr_loss_acceptance} | ${perf_pdr_loss_acceptance_type}
132 | tc01-64B-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
134 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
135 | | ... | 1 receive queue per NIC port.
136 | | ... | [Ver] Find NDR for 64 Byte frames using binary search start at 10GE\
137 | | ... | linerate, step 10kpps.
139 | | [Tags] | 64B | 1T1C | STHREAD | NDRDISC
141 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
142 | | wt=1 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=NDR
144 | tc02-64B-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
146 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
147 | | ... | 1 receive queue per NIC port.
148 | | ... | [Ver] Find PDR for 64 Byte frames using binary search start at 10GE\
149 | | ... | linerate, step 10kpps, LT=0.5%.
151 | | [Tags] | 64B | 1T1C | STHREAD | PDRDISC | SKIP_PATCH
153 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
154 | | wt=1 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=PDR
156 | tc03-1518B-1t1c--ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
158 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
159 | | ... | 1 receive queue per NIC port.
160 | | ... | [Ver] Find NDR for 1518 Byte frames using binary search start at 10GE\
161 | | ... | linerate, step 10kpps.
163 | | [Tags] | 1518B | 1T1C | STHREAD | NDRDISC
165 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
166 | | wt=1 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=NDR
168 | tc04-1518B-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
170 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
171 | | ... | 1 receive queue per NIC port.
172 | | ... | [Ver] Find PDR for 1518 Byte frames using binary search start at 10GE\
173 | | ... | linerate, step 10kpps, LT=0.5%.
175 | | [Tags] | 1518B | 1T1C | STHREAD | PDRDISC | SKIP_PATCH
177 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
178 | | wt=1 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=PDR
180 | tc05-IMIX-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
182 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
183 | | ... | 1 receive queue per NIC port.
184 | | ... | [Ver] Find NDR for IMIX_v4_1 framesize using binary search start at\
185 | | ... | 10GE linerate, step 10kpps.
186 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
188 | | [Tags] | IMIX | 1T1C | STHREAD | NDRDISC
190 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
191 | | wt=1 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=NDR
193 | tc06-IMIX-1t1c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
195 | | ... | [Cfg] DUT runs IPv4 routing config with 1 thread, 1 phy core,\
196 | | ... | 1 receive queue per NIC port.
197 | | ... | [Ver] Find PDR for IMIX_v4_1 framesize using binary search start at\
198 | | ... | 10GE linerate, step 10kpps, LT=0.5%.
199 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
201 | | [Tags] | IMIX | 1T1C | STHREAD | PDRDISC | SKIP_PATCH
203 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
204 | | wt=1 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=PDR
206 | tc07-64B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
208 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
209 | | ... | 1 receive queue per NIC port.
210 | | ... | [Ver] Find NDR for 64 Byte frames using binary search start at 10GE\
211 | | ... | linerate, step 10kpps.
213 | | [Tags] | 64B | 2T2C | STHREAD | NDRDISC
215 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
216 | | wt=2 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=NDR
218 | tc08-64B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
220 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
221 | | ... | 1 receive queue per NIC port.
222 | | ... | [Ver] Find PDR for 64 Byte frames using binary search start at 10GE\
223 | | ... | linerate, step 10kpps, LT=0.5%.
225 | | [Tags] | 64B | 2T2C | STHREAD | PDRDISC | SKIP_PATCH
227 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
228 | | wt=2 | rxq=1 | framesize=${64} | min_rate=${10000} | search_type=PDR
230 | tc09-1518B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
232 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
233 | | ... | 1 receive queue per NIC port.
234 | | ... | [Ver] Find NDR for 1518 Byte frames using binary search start at 10GE\
235 | | ... | linerate, step 10kpps.
237 | | [Tags] | 1518B | 2T2C | STHREAD | NDRDISC | SKIP_PATCH
239 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
240 | | wt=2 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=NDR
242 | tc10-1518B-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
244 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
245 | | ... | 1 receive queue per NIC port.
246 | | ... | [Ver] Find PDR for 1518 Byte frames using binary search start at 10GE\
247 | | ... | linerate, step 10kpps, LT=0.5%.
249 | | [Tags] | 1518B | 2T2C | STHREAD | PDRDISC | SKIP_PATCH
251 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
252 | | wt=2 | rxq=1 | framesize=${1518} | min_rate=${10000} | search_type=PDR
254 | tc11-IMIX-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
256 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
257 | | ... | 1 receive queue per NIC port.
258 | | ... | [Ver] Find NDR for IMIX_v4_1 framesize using binary search start at\
259 | | ... | 10GE linerate, step 10kpps.
260 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
262 | | [Tags] | IMIX | 2T2C | STHREAD | NDRDISC | SKIP_PATCH
264 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
265 | | wt=2 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=NDR
267 | tc12-IMIX-2t2c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
269 | | ... | [Cfg] DUT runs IPv4 routing config with 2 threads, 2 phy cores,\
270 | | ... | 1 receive queue per NIC port.
271 | | ... | [Ver] Find PDR for IMIX_v4_1 framesize using binary search start at\
272 | | ... | 10GE linerate, step 10kpps.
273 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
275 | | [Tags] | IMIX | 2T2C | STHREAD | PDRDISC | SKIP_PATCH
277 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
278 | | wt=2 | rxq=1 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=PDR
280 | tc13-64B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
282 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
283 | | ... | 2 receive queues per NIC port.
284 | | ... | [Ver] Find NDR for 64 Byte frames using binary search start at 10GE\
285 | | ... | linerate, step 10kpps.
287 | | [Tags] | 64B | 4T4C | STHREAD | NDRDISC
289 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
290 | | wt=4 | rxq=2 | framesize=${64} | min_rate=${10000} | search_type=NDR
292 | tc14-64B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
294 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
295 | | ... | 2 receive queues per NIC port.
296 | | ... | [Ver] Find PDR for 64 Byte frames using binary search start at 10GE\
297 | | ... | linerate, step 10kpps, LT=0.5%.
299 | | [Tags] | 64B | 4T4C | STHREAD | PDRDISC | SKIP_PATCH
301 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
302 | | wt=4 | rxq=2 | framesize=${64} | min_rate=${10000} | search_type=PDR
304 | tc15-1518B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
306 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
307 | | ... | 2 receive queues per NIC port.
308 | | ... | [Ver] Find NDR for 1518 Byte frames using binary search start at 10GE\
309 | | ... | linerate, step 10kpps.
311 | | [Tags] | 1518B | 4T4C | STHREAD | NDRDISC | SKIP_PATCH
313 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
314 | | wt=4 | rxq=2 | framesize=${1518} | min_rate=${10000} | search_type=NDR
316 | tc16-1518B-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
318 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
319 | | ... | 2 receive queues per NIC port.
320 | | ... | [Ver] Find PDR for 1518 Byte frames using binary search start at 10GE\
321 | | ... | linerate, step 10kpps, LT=0.5%.
323 | | [Tags] | 1518B | 4T4C | STHREAD | PDRDISC | SKIP_PATCH
325 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
326 | | wt=4 | rxq=2 | framesize=${1518} | min_rate=${10000} | search_type=PDR
328 | tc17-IMIX-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-ndrdisc
330 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
331 | | ... | 2 receive queues per NIC port.
332 | | ... | [Ver] Find NDR for IMIX_v4_1 framesize using binary search start at\
333 | | ... | 10GE linerate, step 10kpps.
334 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
336 | | [Tags] | IMIX | 4T4C | STHREAD | NDRDISC | SKIP_PATCH
338 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
339 | | wt=4 | rxq=2 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=NDR
341 | tc18-IMIX-4t4c-ethip4-ip4base-eth-2vhostvr256-1vm-cfsrr1-pdrdisc
343 | | ... | [Cfg] DUT runs IPv4 routing config with 4 threads, 4 phy cores,\
344 | | ... | 2 receive queues per NIC port.
345 | | ... | [Ver] Find PDR for IMIX_v4_1 framesize using binary search start at\
346 | | ... | 10GE linerate, step 10kpps, LT=0.5%.
347 | | ... | IMIX_v4_1 = (28x64B; 16x570B; 4x1518B)
349 | | [Tags] | IMIX | 4T4C | STHREAD | PDRDISC | SKIP_PATCH
351 | | [Template] | Discover NDR or PDR for IPv4 forwarding with VM
352 | | wt=4 | rxq=2 | framesize=IMIX_v4_1 | min_rate=${10000} | search_type=PDR