app/flow-perf: support ICMP matching
[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 provide the ability to test insertion rate of specific
9 rte_flow rule, by stressing it to the NIC, and calculate the insertion
10 rate.
11
12 The application offers some options in the command line, to configure
13 which rule to apply.
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 The application also provide the ability to measure rte flow deletion rate,
20 in addition to memory consumption before and after the flows creation.
21
22 The app supports single and multi core performance measurements.
23
24
25 Known Limitations
26 -----------------
27
28 The current version has limitations which can be removed in future:
29
30 * Single core insertion only.
31
32
33 Compiling the Application
34 -------------------------
35
36 The ``test-flow-perf`` application is compiled as part of the main compilation
37 of the DPDK libraries and tools.
38
39 Refer to the DPDK Getting Started Guides for details.
40
41
42 Running the Application
43 -----------------------
44
45 EAL Command-line Options
46 ~~~~~~~~~~~~~~~~~~~~~~~~
47
48 Please refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>`
49 or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for
50 a list of available EAL command-line options.
51
52
53 Flow Performance Options
54 ~~~~~~~~~~~~~~~~~~~~~~~~
55
56 The following are the command-line options for the flow performance application.
57 They must be separated from the EAL options, shown in the previous section,
58 with a ``--`` separator:
59
60 .. code-block:: console
61
62         sudo ./dpdk-test-flow_perf -n 4 -w 08:00.0 -- --ingress --ether --ipv4 --queue --flows-count=1000000
63
64 The command line options are:
65
66 *       ``--help``
67         Display a help message and quit.
68
69 *       ``--flows-count=N``
70         Set the number of needed flows to insert,
71         where 1 <= N <= "number of flows".
72         The default value is 4,000,000.
73
74 *       ``--dump-iterations``
75         Print rates for each iteration of flows.
76         Default iteration is 1,00,000.
77
78 *       ``--deletion-rate``
79         Enable deletion rate calculations.
80
81 *       ``--dump-socket-mem``
82         Dump the memory stats for each socket before the insertion and after.
83
84 *       ``--enable-fwd``
85         Enable packets forwarding after insertion/deletion operations.
86
87 *       ``--portmask=N``
88         hexadecimal bitmask of ports to be used.
89
90
91 Attributes:
92
93 *       ``--ingress``
94         Set Ingress attribute to all flows attributes.
95
96 *       ``--egress``
97         Set Egress attribute to all flows attributes.
98
99 *       ``--transfer``
100         Set Transfer attribute to all flows attributes.
101
102 *       ``--group=N``
103         Set group for all flows, where N >= 0.
104         Default group is 0.
105
106 Items:
107
108 *       ``--ether``
109         Add Ether item to all flows items, This item have open mask.
110
111 *       ``--vlan``
112         Add VLAN item to all flows items,
113         This item have VLAN value defined in user_parameters.h
114         under ``VNI_VALUE`` with full mask, default value = 1.
115         Other fields are open mask.
116
117 *       ``--ipv4``
118         Add IPv4 item to all flows items,
119         This item have incremental source IP, with full mask.
120         Other fields are open mask.
121
122 *       ``--ipv6``
123         Add IPv6 item to all flows item,
124         This item have incremental source IP, with full mask.
125         Other fields are open mask.
126
127 *       ``--tcp``
128         Add TCP item to all flows items, This item have open mask.
129
130 *       ``--udp``
131         Add UDP item to all flows items, This item have open mask.
132
133 *       ``--vxlan``
134         Add VXLAN item to all flows items,
135         This item have VNI value defined in user_parameters.h
136         under ``VNI_VALUE`` with full mask, default value = 1.
137         Other fields are open mask.
138
139 *       ``--vxlan-gpe``
140         Add VXLAN-GPE item to all flows items,
141         This item have VNI value defined in user_parameters.h
142         under ``VNI_VALUE`` with full mask, default value = 1.
143         Other fields are open mask.
144
145 *       ``--gre``
146         Add GRE item to all flows items,
147         This item have protocol value defined in user_parameters.h
148         under ``GRE_PROTO`` with full mask, default protocol = 0x6558 "Ether"
149         Other fields are open mask.
150
151 *       ``--geneve``
152         Add GENEVE item to all flows items,
153         This item have VNI value defined in user_parameters.h
154         under ``VNI_VALUE`` with full mask, default value = 1.
155         Other fields are open mask.
156
157 *       ``--gtp``
158         Add GTP item to all flows items,
159         This item have TEID value defined in user_parameters.h
160         under ``TEID_VALUE`` with full mask, default value = 1.
161         Other fields are open mask.
162
163 *       ``--meta``
164         Add Meta item to all flows items,
165         This item have data value defined in user_parameters.h
166         under ``META_DATA`` with full mask, default value = 1.
167         Other fields are open mask.
168
169 *       ``--tag``
170         Add Tag item to all flows items,
171         This item have data value defined in user_parameters.h
172         under ``META_DATA`` with full mask, default value = 1.
173
174         Also it have tag value defined in user_parameters.h
175         under ``TAG_INDEX`` with full mask, default value = 0.
176         Other fields are open mask.
177
178 *       ``--icmpv4``
179         Add icmpv4 item to all flows items, This item have open mask.
180
181 *       ``--icmpv6``
182         Add icmpv6 item to all flows items, This item have open mask.
183
184
185 Actions:
186
187 *       ``--port-id``
188         Add port redirection action to all flows actions.
189         Port redirection destination is defined in user_parameters.h
190         under PORT_ID_DST, default value = 1.
191
192 *       ``--rss``
193         Add RSS action to all flows actions,
194         The queues in RSS action will be all queues configured
195         in the app.
196
197 *       ``--queue``
198         Add queue action to all flows items,
199         The queue will change in round robin state for each flow.
200
201         For example:
202                 The app running with 4 RX queues
203                 Flow #0: queue index 0
204                 Flow #1: queue index 1
205                 Flow #2: queue index 2
206                 Flow #3: queue index 3
207                 Flow #4: queue index 0
208                 ...
209
210 *       ``--jump``
211         Add jump action to all flows actions.
212         Jump action destination is defined in user_parameters.h
213         under ``JUMP_ACTION_TABLE``, default value = 2.
214
215 *       ``--mark``
216         Add mark action to all flows actions.
217         Mark action id is defined in user_parameters.h
218         under ``MARK_ID``, default value = 1.
219
220 *       ``--count``
221         Add count action to all flows actions.
222
223 *       ``--set-meta``
224         Add set-meta action to all flows actions.
225         Meta data is defined in user_parameters.h under ``META_DATA``
226         with full mask, default value = 1.
227
228 *       ``--set-tag``
229         Add set-tag action to all flows actions.
230         Meta data is defined in user_parameters.h under ``META_DATA``
231         with full mask, default value = 1.
232
233         Tag index is defined in user_parameters.h under ``TAG_INDEX``
234         with full mask, default value = 0.
235
236 *       ``--drop``
237         Add drop action to all flows actions.
238
239 *       ``--hairpin-queue=N``
240         Add hairpin queue action to all flows actions.
241         The queue will change in round robin state for each flow.
242
243         For example:
244                 The app running with 4 RX hairpin queues and 4 normal RX queues
245                 Flow #0: queue index 4
246                 Flow #1: queue index 5
247                 Flow #2: queue index 6
248                 Flow #3: queue index 7
249                 Flow #4: queue index 4
250                 ...
251
252 *       ``--hairpin-rss=N``
253         Add hairpin RSS action to all flows actions.
254         The queues in RSS action will be all hairpin queues configured
255         in the app.
256
257 *       ``--set-src-mac``
258         Add set source mac action to all flows actions.
259         The mac to be set is random each flow.
260
261 *       ``--set-dst-mac``
262         Add set destination mac action to all flows actions.
263         The mac to be set is random each flow.
264
265 *       ``-set-src-ipv4``
266         Add set source ipv4 action to all flows actions.
267         The ipv4 header to be set is random each flow.
268
269 *       ``--set-dst-ipv4``
270         Add set destination ipv4 action to all flows actions.
271         The ipv4 header to be set is random each flow.
272
273 *       ``--set-src-ipv6``
274         Add set source ipv6 action to all flows actions.
275         The ipv6 header to be set is random each flow.
276
277 *       ``--set-dst-ipv6``
278         Add set destination ipv6 action to all flows actions.
279         The ipv6 header to be set is random each flow.
280
281 *       ``--set-src-tp``
282         Add set source tp action to all flows actions.
283         The tp sport header to be set is random each flow.
284
285 *       ``--set-dst-tp``
286         Add set destination tp action to all flows actions.
287         The tp dport header to be set is random each flow.
288
289 *       ``--inc-tcp-ack``
290         Add increment TCP acknowledgment by one to all flows actions.
291
292 *       ``--dec-tcp-ack``
293         Add decrement TCP acknowledgment by one to all flows actions.
294
295 *       ``--inc-tcp-seq``
296         Add increment TCP sequence by one to all flows actions.
297
298 *       ``--dec-tcp-seq``
299         Add decrement TCP sequence by one to all flows actions.
300
301 *       ``--set-ttl``
302         Add set IP ttl action to all flows actions.
303         The ttl value to be set is random each flow.
304
305 *       ``--dec-ttl``
306         Add decrement IP ttl by one to all flows actions.
307
308 *       ``--set-ipv4-dscp``
309         Add set IPv4 dscp action to all flows actions.
310         The dscp value to be is random each flow.
311
312 *       ``--set-ipv6-dscp``
313         Add set IPv6 dscp action to all flows actions.
314         The dscp value to be is random each flow.
315
316 *       ``--flag``
317         Add flag action to all flows actions.
318
319 *       ``--raw-encap=<DATA>``
320         Add raw encap action to all flows actions.
321         Data is the data needed to be encaped, with fixed values.
322         Example: raw-encap=ether,ipv4,udp,vxlan
323
324 *       ``--raw-decap=<DATA>``
325         Add raw decap action to all flows actions.
326         Data is the data needed to be decaped, with fixed values.
327         Example: raw-decap=ether,ipv4,gre
328
329 *       ``--vxlan-encap``
330         Add vxlan encap action to all flows actions.
331         Data to encap is fixed with pattern: ether,ipv4,udp,vxlan,
332         all encapped items have fixed values.
333
334 *       ``--vxlan-decap``
335         Add vxlan decap action to all flows actions.