1.. SPDX-License-Identifier: BSD-3-Clause 2 Copyright 2020 Mellanox Technologies, Ltd 3 4Flow Performance Tool 5===================== 6 7Application for rte_flow performance testing. 8The application provides the ability to test insertion rate of specific 9rte_flow rule, by stressing it to the NIC, and calculates the insertion 10and deletion rates. 11 12The application allows to configure which rule to apply through several 13options of the command line. 14 15After that the application will start producing rules with same pattern 16but increasing the outer IP source address by 1 each time, thus it will 17give different flow each time, and all other items will have open masks. 18 19To assess the rule insertion rate, the flow performance tool breaks 20down 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). 22Then, the flow performance tool measures the total time per window and 23computes an average time across all windows. 24 25The application also provides the ability to measure rte flow deletion rate, 26in addition to memory consumption before and after the flow rules' creation. 27 28The app supports single and multiple core performance measurements, and 29support multiple cores insertion/deletion as well. 30 31 32Compiling the Application 33------------------------- 34 35The ``test-flow-perf`` application is compiled as part of the main compilation 36of the DPDK libraries and tools. 37 38Refer to the DPDK Getting Started Guides for details. 39 40 41Running the Application 42----------------------- 43 44EAL Command-line Options 45~~~~~~~~~~~~~~~~~~~~~~~~ 46 47Please refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>` 48or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for 49a list of available EAL command-line options. 50 51 52Flow Performance Options 53~~~~~~~~~~~~~~~~~~~~~~~~ 54 55The following are the command-line options for the flow performance application. 56They must be separated from the EAL options, shown in the previous section, 57with 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 63The 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 103Attributes: 104 105* ``--ingress`` 106 Set Ingress attribute to all flows attributes. 107 108* ``--egress`` 109 Set Egress attribute to all flows attributes. 110 111* ``--transfer`` 112 Set Transfer attribute to all flows attributes. 113 114* ``--group=N`` 115 Set group for all flows, where N >= 0. 116 Default group is 0. 117 118Items: 119 120* ``--ether`` 121 Add Ether item to all flows items, This item have open mask. 122 123* ``--vlan`` 124 Add VLAN item to all flows items, 125 This item have VLAN value defined in user_parameters.h 126 under ``VNI_VALUE`` with full mask, default value = 1. 127 Other fields are open mask. 128 129* ``--ipv4`` 130 Add IPv4 item to all flows items, 131 This item have incremental source IP, with full mask. 132 Other fields are open mask. 133 134* ``--ipv6`` 135 Add IPv6 item to all flows item, 136 This item have incremental source IP, with full mask. 137 Other fields are open mask. 138 139* ``--tcp`` 140 Add TCP item to all flows items, This item have open mask. 141 142* ``--udp`` 143 Add UDP item to all flows items, This item have open mask. 144 145* ``--vxlan`` 146 Add VXLAN item to all flows items, 147 This item have VNI value defined in user_parameters.h 148 under ``VNI_VALUE`` with full mask, default value = 1. 149 Other fields are open mask. 150 151* ``--vxlan-gpe`` 152 Add VXLAN-GPE 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* ``--gre`` 158 Add GRE item to all flows items, 159 This item have protocol value defined in user_parameters.h 160 under ``GRE_PROTO`` with full mask, default protocol = 0x6558 "Ether" 161 Other fields are open mask. 162 163* ``--geneve`` 164 Add GENEVE item to all flows items, 165 This item have VNI value defined in user_parameters.h 166 under ``VNI_VALUE`` with full mask, default value = 1. 167 Other fields are open mask. 168 169* ``--gtp`` 170 Add GTP item to all flows items, 171 This item have TEID value defined in user_parameters.h 172 under ``TEID_VALUE`` with full mask, default value = 1. 173 Other fields are open mask. 174 175* ``--meta`` 176 Add Meta item to all flows items, 177 This item have data value defined in user_parameters.h 178 under ``META_DATA`` with full mask, default value = 1. 179 Other fields are open mask. 180 181* ``--tag`` 182 Add Tag item to all flows items, 183 This item have data value defined in user_parameters.h 184 under ``META_DATA`` with full mask, default value = 1. 185 186 Also it have tag value defined in user_parameters.h 187 under ``TAG_INDEX`` with full mask, default value = 0. 188 Other fields are open mask. 189 190* ``--icmpv4`` 191 Add icmpv4 item to all flows items, This item have open mask. 192 193* ``--icmpv6`` 194 Add icmpv6 item to all flows items, This item have open mask. 195 196 197Actions: 198 199* ``--port-id`` 200 Add port redirection action to all flows actions. 201 Port redirection destination is defined in user_parameters.h 202 under PORT_ID_DST, default value = 1. 203 204* ``--rss`` 205 Add RSS action to all flows actions, 206 The queues in RSS action will be all queues configured 207 in the app. 208 209* ``--queue`` 210 Add queue action to all flows items, 211 The queue will change in round robin state for each flow. 212 213 For example: 214 The app running with 4 RX queues 215 Flow #0: queue index 0 216 Flow #1: queue index 1 217 Flow #2: queue index 2 218 Flow #3: queue index 3 219 Flow #4: queue index 0 220 ... 221 222* ``--jump`` 223 Add jump action to all flows actions. 224 Jump action destination is defined in user_parameters.h 225 under ``JUMP_ACTION_TABLE``, default value = 2. 226 227* ``--mark`` 228 Add mark action to all flows actions. 229 Mark action id is defined in user_parameters.h 230 under ``MARK_ID``, default value = 1. 231 232* ``--count`` 233 Add count action to all flows actions. 234 235* ``--set-meta`` 236 Add set-meta action to all flows actions. 237 Meta data is defined in user_parameters.h under ``META_DATA`` 238 with full mask, default value = 1. 239 240* ``--set-tag`` 241 Add set-tag action to all flows actions. 242 Meta data is defined in user_parameters.h under ``META_DATA`` 243 with full mask, default value = 1. 244 245 Tag index is defined in user_parameters.h under ``TAG_INDEX`` 246 with full mask, default value = 0. 247 248* ``--drop`` 249 Add drop action to all flows actions. 250 251* ``--hairpin-queue=N`` 252 Add hairpin queue action to all flows actions. 253 The queue will change in round robin state for each flow. 254 255 For example: 256 The app running with 4 RX hairpin queues and 4 normal RX queues 257 Flow #0: queue index 4 258 Flow #1: queue index 5 259 Flow #2: queue index 6 260 Flow #3: queue index 7 261 Flow #4: queue index 4 262 ... 263 264* ``--hairpin-rss=N`` 265 Add hairpin RSS action to all flows actions. 266 The queues in RSS action will be all hairpin queues configured 267 in the app. 268 269* ``--set-src-mac`` 270 Add set source mac action to all flows actions. 271 The mac to be set is random each flow. 272 273* ``--set-dst-mac`` 274 Add set destination mac action to all flows actions. 275 The mac to be set is random each flow. 276 277* ``-set-src-ipv4`` 278 Add set source ipv4 action to all flows actions. 279 The ipv4 header to be set is random each flow. 280 281* ``--set-dst-ipv4`` 282 Add set destination ipv4 action to all flows actions. 283 The ipv4 header to be set is random each flow. 284 285* ``--set-src-ipv6`` 286 Add set source ipv6 action to all flows actions. 287 The ipv6 header to be set is random each flow. 288 289* ``--set-dst-ipv6`` 290 Add set destination ipv6 action to all flows actions. 291 The ipv6 header to be set is random each flow. 292 293* ``--set-src-tp`` 294 Add set source tp action to all flows actions. 295 The tp sport header to be set is random each flow. 296 297* ``--set-dst-tp`` 298 Add set destination tp action to all flows actions. 299 The tp dport header to be set is random each flow. 300 301* ``--inc-tcp-ack`` 302 Add increment TCP acknowledgment by one to all flows actions. 303 304* ``--dec-tcp-ack`` 305 Add decrement TCP acknowledgment by one to all flows actions. 306 307* ``--inc-tcp-seq`` 308 Add increment TCP sequence by one to all flows actions. 309 310* ``--dec-tcp-seq`` 311 Add decrement TCP sequence by one to all flows actions. 312 313* ``--set-ttl`` 314 Add set IP ttl action to all flows actions. 315 The ttl value to be set is random each flow. 316 317* ``--dec-ttl`` 318 Add decrement IP ttl by one to all flows actions. 319 320* ``--set-ipv4-dscp`` 321 Add set IPv4 dscp action to all flows actions. 322 The dscp value to be is random each flow. 323 324* ``--set-ipv6-dscp`` 325 Add set IPv6 dscp action to all flows actions. 326 The dscp value to be is random each flow. 327 328* ``--flag`` 329 Add flag action to all flows actions. 330 331* ``--raw-encap=<DATA>`` 332 Add raw encap action to all flows actions. 333 Data is the data needed to be encaped, with fixed values. 334 Example: raw-encap=ether,ipv4,udp,vxlan 335 336* ``--raw-decap=<DATA>`` 337 Add raw decap action to all flows actions. 338 Data is the data needed to be decaped, with fixed values. 339 Example: raw-decap=ether,ipv4,gre 340 341* ``--vxlan-encap`` 342 Add vxlan encap action to all flows actions. 343 Data to encap is fixed with pattern: ether,ipv4,udp,vxlan, 344 all encapped items have fixed values. 345 346* ``--vxlan-decap`` 347 Add vxlan decap action to all flows actions. 348 349* ``--meter`` 350 Add meter action to all flows actions. 351 Currently, 1 meter profile -> N meter rules -> N rte flows. 352