app/flow-perf: support raw encap/decap actions
[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
88 Attributes:
89
90 *       ``--ingress``
91         Set Ingress attribute to all flows attributes.
92
93 *       ``--egress``
94         Set Egress attribute to all flows attributes.
95
96 *       ``--transfer``
97         Set Transfer attribute to all flows attributes.
98
99 *       ``--group=N``
100         Set group for all flows, where N >= 0.
101         Default group is 0.
102
103 Items:
104
105 *       ``--ether``
106         Add Ether item to all flows items, This item have open mask.
107
108 *       ``--vlan``
109         Add VLAN item to all flows items,
110         This item have VLAN value defined in user_parameters.h
111         under ``VNI_VALUE`` with full mask, default value = 1.
112         Other fields are open mask.
113
114 *       ``--ipv4``
115         Add IPv4 item to all flows items,
116         This item have incremental source IP, with full mask.
117         Other fields are open mask.
118
119 *       ``--ipv6``
120         Add IPv6 item to all flows item,
121         This item have incremental source IP, with full mask.
122         Other fields are open mask.
123
124 *       ``--tcp``
125         Add TCP item to all flows items, This item have open mask.
126
127 *       ``--udp``
128         Add UDP item to all flows items, This item have open mask.
129
130 *       ``--vxlan``
131         Add VXLAN item to all flows items,
132         This item have VNI value defined in user_parameters.h
133         under ``VNI_VALUE`` with full mask, default value = 1.
134         Other fields are open mask.
135
136 *       ``--vxlan-gpe``
137         Add VXLAN-GPE item to all flows items,
138         This item have VNI value defined in user_parameters.h
139         under ``VNI_VALUE`` with full mask, default value = 1.
140         Other fields are open mask.
141
142 *       ``--gre``
143         Add GRE item to all flows items,
144         This item have protocol value defined in user_parameters.h
145         under ``GRE_PROTO`` with full mask, default protocol = 0x6558 "Ether"
146         Other fields are open mask.
147
148 *       ``--geneve``
149         Add GENEVE item to all flows items,
150         This item have VNI value defined in user_parameters.h
151         under ``VNI_VALUE`` with full mask, default value = 1.
152         Other fields are open mask.
153
154 *       ``--gtp``
155         Add GTP item to all flows items,
156         This item have TEID value defined in user_parameters.h
157         under ``TEID_VALUE`` with full mask, default value = 1.
158         Other fields are open mask.
159
160 *       ``--meta``
161         Add Meta item to all flows items,
162         This item have data value defined in user_parameters.h
163         under ``META_DATA`` with full mask, default value = 1.
164         Other fields are open mask.
165
166 *       ``--tag``
167         Add Tag item to all flows items,
168         This item have data value defined in user_parameters.h
169         under ``META_DATA`` with full mask, default value = 1.
170
171         Also it have tag value defined in user_parameters.h
172         under ``TAG_INDEX`` with full mask, default value = 0.
173         Other fields are open mask.
174
175
176 Actions:
177
178 *       ``--port-id``
179         Add port redirection action to all flows actions.
180         Port redirection destination is defined in user_parameters.h
181         under PORT_ID_DST, default value = 1.
182
183 *       ``--rss``
184         Add RSS action to all flows actions,
185         The queues in RSS action will be all queues configured
186         in the app.
187
188 *       ``--queue``
189         Add queue action to all flows items,
190         The queue will change in round robin state for each flow.
191
192         For example:
193                 The app running with 4 RX queues
194                 Flow #0: queue index 0
195                 Flow #1: queue index 1
196                 Flow #2: queue index 2
197                 Flow #3: queue index 3
198                 Flow #4: queue index 0
199                 ...
200
201 *       ``--jump``
202         Add jump action to all flows actions.
203         Jump action destination is defined in user_parameters.h
204         under ``JUMP_ACTION_TABLE``, default value = 2.
205
206 *       ``--mark``
207         Add mark action to all flows actions.
208         Mark action id is defined in user_parameters.h
209         under ``MARK_ID``, default value = 1.
210
211 *       ``--count``
212         Add count action to all flows actions.
213
214 *       ``--set-meta``
215         Add set-meta action to all flows actions.
216         Meta data is defined in user_parameters.h under ``META_DATA``
217         with full mask, default value = 1.
218
219 *       ``--set-tag``
220         Add set-tag action to all flows actions.
221         Meta data is defined in user_parameters.h under ``META_DATA``
222         with full mask, default value = 1.
223
224         Tag index is defined in user_parameters.h under ``TAG_INDEX``
225         with full mask, default value = 0.
226
227 *       ``--drop``
228         Add drop action to all flows actions.
229
230 *       ``--hairpin-queue=N``
231         Add hairpin queue action to all flows actions.
232         The queue will change in round robin state for each flow.
233
234         For example:
235                 The app running with 4 RX hairpin queues and 4 normal RX queues
236                 Flow #0: queue index 4
237                 Flow #1: queue index 5
238                 Flow #2: queue index 6
239                 Flow #3: queue index 7
240                 Flow #4: queue index 4
241                 ...
242
243 *       ``--hairpin-rss=N``
244         Add hairpin RSS action to all flows actions.
245         The queues in RSS action will be all hairpin queues configured
246         in the app.
247
248 *       ``--set-src-mac``
249         Add set source mac action to all flows actions.
250         The mac to be set is random each flow.
251
252 *       ``--set-dst-mac``
253         Add set destination mac action to all flows actions.
254         The mac to be set is random each flow.
255
256 *       ``-set-src-ipv4``
257         Add set source ipv4 action to all flows actions.
258         The ipv4 header to be set is random each flow.
259
260 *       ``--set-dst-ipv4``
261         Add set destination ipv4 action to all flows actions.
262         The ipv4 header to be set is random each flow.
263
264 *       ``--set-src-ipv6``
265         Add set source ipv6 action to all flows actions.
266         The ipv6 header to be set is random each flow.
267
268 *       ``--set-dst-ipv6``
269         Add set destination ipv6 action to all flows actions.
270         The ipv6 header to be set is random each flow.
271
272 *       ``--set-src-tp``
273         Add set source tp action to all flows actions.
274         The tp sport header to be set is random each flow.
275
276 *       ``--set-dst-tp``
277         Add set destination tp action to all flows actions.
278         The tp dport header to be set is random each flow.
279
280 *       ``--inc-tcp-ack``
281         Add increment TCP acknowledgment by one to all flows actions.
282
283 *       ``--dec-tcp-ack``
284         Add decrement TCP acknowledgment by one to all flows actions.
285
286 *       ``--inc-tcp-seq``
287         Add increment TCP sequence by one to all flows actions.
288
289 *       ``--dec-tcp-seq``
290         Add decrement TCP sequence by one to all flows actions.
291
292 *       ``--set-ttl``
293         Add set IP ttl action to all flows actions.
294         The ttl value to be set is random each flow.
295
296 *       ``--dec-ttl``
297         Add decrement IP ttl by one to all flows actions.
298
299 *       ``--set-ipv4-dscp``
300         Add set IPv4 dscp action to all flows actions.
301         The dscp value to be is random each flow.
302
303 *       ``--set-ipv6-dscp``
304         Add set IPv6 dscp action to all flows actions.
305         The dscp value to be is random each flow.
306
307 *       ``--flag``
308         Add flag action to all flows actions.
309
310 *       ``--raw-encap=<DATA>``
311         Add raw encap action to all flows actions.
312         Data is the data needed to be encaped, with fixed values.
313         Example: raw-encap=ether,ipv4,udp,vxlan
314
315 *       ``--raw-decap=<DATA>``
316         Add raw decap action to all flows actions.
317         Data is the data needed to be decaped, with fixed values.
318         Example: raw-decap=ether,ipv4,gre