app/regex: add RegEx test application
[dpdk.git] / doc / guides / tools / testregex.rst
1 .. SPDX-License-Identifier: BSD-3-Clause
2    Copyright 2020 Mellanox Technologies, Ltd
3
4 dpdk-test-regex Tool
5 ====================
6
7 The ``dpdk-test-regex`` tool is a Data Plane Development Kit (DPDK)
8 application that allows functional testing and performance measurement for
9 the RegEx PMDs.
10 The test supports only one core and one PMD.
11 It is based on precompiled rule file, and an input file, both of them can
12 be selected using command-line options.
13
14 In general case, each PMD has its own rule file.
15
16 The test outputs the following data:
17
18 * Performance, in gigabit per second.
19
20 * Matching results (rule id, position, length), for each job.
21
22 * Matching results in absolute location (rule id, position , length),
23   relative to the start of the input data.
24
25
26 Limitations
27 ~~~~~~~~~~~
28
29 * Only one queue is supported.
30
31 * Supports only precompiled rules.
32
33
34 Application Options
35 ~~~~~~~~~~~~~~~~~~~
36
37 ``--rules NAME``
38   precompiled rule file
39
40 ``--data NAME``
41   data file to use
42
43 ``--nb_jobs N``
44   number of jobs to use
45
46 ``--perf N``
47   only outputs the performance data
48
49 ``--nb_iter N``
50   number of iteration to run
51
52 ``--help``
53   print application options
54
55
56 Running the Tool
57 ----------------
58
59 **Step 1: Compile a rule file**
60
61 In order for the RegEx to work it must have a precompiled rule file.
62 to generate this file there is a need to use a RegEx compiler that matches the
63 RegEx PMD.
64
65 **Step 2: Generate a data file**
66
67 The data file, will be used as a source data for the RegEx to work on.
68
69 **Step 3: Run the tool**
70
71 The tool has a number of command line options. Here is the sample command line::
72
73    ./dpdk-test-regex -w 83:00.0 -- --rules rule_file.rof2 --data data_file.txt --job 100