e608a44c241dc01555905ca1d9b7409312121c62
[dpdk.git] / doc / guides / tools / flow-perf.rst
1 .. SPDX-License-Identifier: BSD-3-Clause
2    Copyright 2020 Mellanox Technologies, Ltd
3
4 Flow Performance Tool
5 =====================
6
7 Application for rte_flow performance testing.
8 The application provides the ability to test insertion rate of specific
9 rte_flow rule, by stressing it to the NIC, and calculates the insertion
10 and deletion rates.
11
12 The application allows to configure which rule to apply through several
13 options of the command line.
14
15 After that the application will start producing rules with same pattern
16 but increasing the outer IP source address by 1 each time, thus it will
17 give different flow each time, and all other items will have open masks.
18
19 To assess the rule insertion rate, the flow performance tool breaks
20 down the entire number of flow rule operations into windows of fixed size
21 (defaults to 100000 flow rule operations per window, but can be configured).
22 Then, the flow performance tool measures the total time per window and
23 computes an average time across all windows.
24
25 The application also provides the ability to measure rte flow deletion rate,
26 in addition to memory consumption before and after the flow rules' creation.
27
28 The app supports single and multiple core performance measurements, and
29 support multiple cores insertion/deletion as well.
30
31
32 Compiling the Application
33 -------------------------
34
35 The ``test-flow-perf`` application is compiled as part of the main compilation
36 of the DPDK libraries and tools.
37
38 Refer to the DPDK Getting Started Guides for details.
39
40
41 Running the Application
42 -----------------------
43
44 EAL Command-line Options
45 ~~~~~~~~~~~~~~~~~~~~~~~~
46
47 Please refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>`
48 or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for
49 a list of available EAL command-line options.
50
51
52 Flow Performance Options
53 ~~~~~~~~~~~~~~~~~~~~~~~~
54
55 The following are the command-line options for the flow performance application.
56 They must be separated from the EAL options, shown in the previous section,
57 with a ``--`` separator:
58
59 .. code-block:: console
60
61         sudo ./dpdk-test-flow_perf -n 4 -a 08:00.0 -- --ingress --ether --ipv4 --queue --rules-count=1000000
62
63 The command line options are:
64
65 *       ``--help``
66         Display a help message and quit.
67
68 *       ``--rules-count=N``
69         Set the total number of flow rules to insert,
70         where 1 <= N <= "number of flow rules".
71         The default value is 4,000,000.
72
73 *       ``--rules-batch=N``
74         Set the number of flow rules to insert per iteration window,
75         where 1 <= N <= "number of flow rules per iteration window".
76         The default value is 100,000 flow rules per iteration window.
77         For a total of --rules-count=1000000 flow rules to be inserted
78         and an iteration window size of --rules-batch=100000 flow rules,
79         the application will measure the insertion rate 10 times
80         (i.e., once every 100000 flow rules) and then report an average
81         insertion rate across the 10 measurements.
82
83 *       ``--dump-iterations``
84         Print rates for each iteration window.
85         Default iteration window equals to the rules-batch size (i.e., 100,000).
86
87 *       ``--deletion-rate``
88         Enable deletion rate calculations.
89
90 *       ``--dump-socket-mem``
91         Dump the memory stats for each socket before the insertion and after.
92
93 *       ``--enable-fwd``
94         Enable packets forwarding after insertion/deletion operations.
95
96 *       ``--portmask=N``
97         hexadecimal bitmask of ports to be used.
98
99 *       ``--cores=N``
100         Set the number of needed cores to insert/delete rte_flow rules.
101         Default cores count is 1.
102
103 *       ``--meter-profile-alg``
104         Set the traffic metering algorithm.
105         Example: meter-profile-alg=srtcmp, default algorithm is srtcm_rfc2697
106
107 *       ``--unique-data``
108         Flag to set using unique data for all actions that support data,
109         Such as header modify and encap actions. Default is using fixed
110         data for any action that support data for all flows.
111
112 *       ``--rxq=N``
113         Set the count of receive queues, default is 1.
114
115 *       ``--txq=N``
116         Set the count of send queues, default is 1.
117
118 *       ``--rxd=N``
119         Set the count of rxd, default is 256.
120
121 *       ``--txd=N``
122         Set the count of txd, default is 256.
123
124 *       ``--mbuf-size=N``
125         Set the size of mbuf, default size is 2048.
126
127 *       ``--mbuf-cache-size=N``
128         Set the size of mbuf cache, default size is 512.
129
130 *       ``--total-mbuf-count=N``
131         Set the count of total mbuf number, default count is 32000.
132
133 Attributes:
134
135 *       ``--ingress``
136         Set Ingress attribute to all flows attributes.
137
138 *       ``--egress``
139         Set Egress attribute to all flows attributes.
140
141 *       ``--transfer``
142         Set Transfer attribute to all flows attributes.
143
144 *       ``--group=N``
145         Set group for all flows, where N >= 0.
146         Default group is 0.
147
148 Items:
149
150 *       ``--ether``
151         Add Ether item to all flows items, This item have open mask.
152
153 *       ``--vlan``
154         Add VLAN item to all flows items,
155         This item have VLAN value defined in user_parameters.h
156         under ``VNI_VALUE`` with full mask, default value = 1.
157         Other fields are open mask.
158
159 *       ``--ipv4``
160         Add IPv4 item to all flows items,
161         This item have incremental source IP, with full mask.
162         Other fields are open mask.
163
164 *       ``--ipv6``
165         Add IPv6 item to all flows item,
166         This item have incremental source IP, with full mask.
167         Other fields are open mask.
168
169 *       ``--tcp``
170         Add TCP item to all flows items, This item have open mask.
171
172 *       ``--udp``
173         Add UDP item to all flows items, This item have open mask.
174
175 *       ``--vxlan``
176         Add VXLAN item to all flows items,
177         This item have VNI value defined in user_parameters.h
178         under ``VNI_VALUE`` with full mask, default value = 1.
179         Other fields are open mask.
180
181 *       ``--vxlan-gpe``
182         Add VXLAN-GPE item to all flows items,
183         This item have VNI value defined in user_parameters.h
184         under ``VNI_VALUE`` with full mask, default value = 1.
185         Other fields are open mask.
186
187 *       ``--gre``
188         Add GRE item to all flows items,
189         This item have protocol value defined in user_parameters.h
190         under ``GRE_PROTO`` with full mask, default protocol = 0x6558 "Ether"
191         Other fields are open mask.
192
193 *       ``--geneve``
194         Add GENEVE item to all flows items,
195         This item have VNI value defined in user_parameters.h
196         under ``VNI_VALUE`` with full mask, default value = 1.
197         Other fields are open mask.
198
199 *       ``--gtp``
200         Add GTP item to all flows items,
201         This item have TEID value defined in user_parameters.h
202         under ``TEID_VALUE`` with full mask, default value = 1.
203         Other fields are open mask.
204
205 *       ``--meta``
206         Add Meta item to all flows items,
207         This item have data value defined in user_parameters.h
208         under ``META_DATA`` with full mask, default value = 1.
209         Other fields are open mask.
210
211 *       ``--tag``
212         Add Tag item to all flows items,
213         This item have data value defined in user_parameters.h
214         under ``META_DATA`` with full mask, default value = 1.
215
216         Also it have tag value defined in user_parameters.h
217         under ``TAG_INDEX`` with full mask, default value = 0.
218         Other fields are open mask.
219
220 *       ``--icmpv4``
221         Add icmpv4 item to all flows items, This item have open mask.
222
223 *       ``--icmpv6``
224         Add icmpv6 item to all flows items, This item have open mask.
225
226
227 Actions:
228
229 *       ``--port-id``
230         Add port redirection action to all flows actions.
231         Port redirection destination is defined in user_parameters.h
232         under PORT_ID_DST, default value = 1.
233
234        It can also has optional parameter like --port-id=N[,M] to
235        specify the destination port, the number of values should be
236        the same with number of set bits in portmask.
237
238 *       ``--rss``
239         Add RSS action to all flows actions,
240         The queues in RSS action will be all queues configured
241         in the app.
242
243 *       ``--queue``
244         Add queue action to all flows items,
245         The queue will change in round robin state for each flow.
246
247         For example:
248                 The app running with 4 RX queues
249                 Flow #0: queue index 0
250                 Flow #1: queue index 1
251                 Flow #2: queue index 2
252                 Flow #3: queue index 3
253                 Flow #4: queue index 0
254                 ...
255
256 *       ``--jump``
257         Add jump action to all flows actions.
258         Jump action destination is defined in user_parameters.h
259         under ``JUMP_ACTION_TABLE``, default value = 2.
260
261 *       ``--mark``
262         Add mark action to all flows actions.
263         Mark action id is defined in user_parameters.h
264         under ``MARK_ID``, default value = 1.
265
266 *       ``--count``
267         Add count action to all flows actions.
268
269 *       ``--set-meta``
270         Add set-meta action to all flows actions.
271         Meta data is defined in user_parameters.h under ``META_DATA``
272         with full mask, default value = 1.
273
274 *       ``--set-tag``
275         Add set-tag action to all flows actions.
276         Meta data is defined in user_parameters.h under ``META_DATA``
277         with full mask, default value = 1.
278
279         Tag index is defined in user_parameters.h under ``TAG_INDEX``
280         with full mask, default value = 0.
281
282 *       ``--drop``
283         Add drop action to all flows actions.
284
285 *       ``--hairpin-queue=N``
286         Add hairpin queue action to all flows actions.
287         The queue will change in round robin state for each flow.
288
289         For example:
290                 The app running with 4 RX hairpin queues and 4 normal RX queues
291                 Flow #0: queue index 4
292                 Flow #1: queue index 5
293                 Flow #2: queue index 6
294                 Flow #3: queue index 7
295                 Flow #4: queue index 4
296                 ...
297
298 *       ``--hairpin-rss=N``
299         Add hairpin RSS action to all flows actions.
300         The queues in RSS action will be all hairpin queues configured
301         in the app.
302
303 *       ``--set-src-mac``
304         Add set source mac action to all flows actions.
305         The mac to be set is random each flow.
306
307 *       ``--set-dst-mac``
308         Add set destination mac action to all flows actions.
309         The mac to be set is random each flow.
310
311 *       ``-set-src-ipv4``
312         Add set source ipv4 action to all flows actions.
313         The ipv4 header to be set is random each flow.
314
315 *       ``--set-dst-ipv4``
316         Add set destination ipv4 action to all flows actions.
317         The ipv4 header to be set is random each flow.
318
319 *       ``--set-src-ipv6``
320         Add set source ipv6 action to all flows actions.
321         The ipv6 header to be set is random each flow.
322
323 *       ``--set-dst-ipv6``
324         Add set destination ipv6 action to all flows actions.
325         The ipv6 header to be set is random each flow.
326
327 *       ``--set-src-tp``
328         Add set source tp action to all flows actions.
329         The tp sport header to be set is random each flow.
330
331 *       ``--set-dst-tp``
332         Add set destination tp action to all flows actions.
333         The tp dport header to be set is random each flow.
334
335 *       ``--inc-tcp-ack``
336         Add increment TCP acknowledgment by one to all flows actions.
337
338 *       ``--dec-tcp-ack``
339         Add decrement TCP acknowledgment by one to all flows actions.
340
341 *       ``--inc-tcp-seq``
342         Add increment TCP sequence by one to all flows actions.
343
344 *       ``--dec-tcp-seq``
345         Add decrement TCP sequence by one to all flows actions.
346
347 *       ``--set-ttl``
348         Add set IP ttl action to all flows actions.
349         The ttl value to be set is random each flow.
350
351 *       ``--dec-ttl``
352         Add decrement IP ttl by one to all flows actions.
353
354 *       ``--set-ipv4-dscp``
355         Add set IPv4 dscp action to all flows actions.
356         The dscp value to be is random each flow.
357
358 *       ``--set-ipv6-dscp``
359         Add set IPv6 dscp action to all flows actions.
360         The dscp value to be is random each flow.
361
362 *       ``--flag``
363         Add flag action to all flows actions.
364
365 *       ``--raw-encap=<DATA>``
366         Add raw encap action to all flows actions.
367         Data is the data needed to be encaped, with fixed values.
368         Example: raw-encap=ether,ipv4,udp,vxlan
369
370 *       ``--raw-decap=<DATA>``
371         Add raw decap action to all flows actions.
372         Data is the data needed to be decaped, with fixed values.
373         Example: raw-decap=ether,ipv4,gre
374
375 *       ``--vxlan-encap``
376         Add vxlan encap action to all flows actions.
377         Data to encap is fixed with pattern: ether,ipv4,udp,vxlan,
378         all encapped items have fixed values.
379
380 *       ``--vxlan-decap``
381         Add vxlan decap action to all flows actions.
382
383 *       ``--meter``
384         Add meter action to all flows actions.
385         Currently, 1 meter profile -> N meter rules -> N rte flows.