Commit Graph

22 Commits

Author SHA1 Message Date
Gerry Gribbon
b6aceada08 app/regex: add match mode option
Allows to specify match mode to be used.

Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-10-09 15:11:58 +02:00
Gerry Gribbon
392ac62b73 app/regex: display response flags value
Allows application user to see response flags

Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-10-09 15:00:22 +02:00
Raslan Darawsheh
a442ca2d23 app/regex: fix mbuf size for multi-segment buffer
When allocating multi segmented buffers, and in case there is
a remainder in total buf len, the actual job len might be more
than expected job_len.

This adds additional space in the mbuf in the multi seg case,
to allow the remaining memory to be stored in one segment.

Fixes: c1d1b94eec ("app/regex: fix number of matches")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-07-05 22:19:03 +02:00
Thierry Herbelot
1afdf9edc8 app/regex: avoid division by zero
Check that nb_jobs is not zero before using it for a division.

Fixes: f5cffb7eb7 ("app/regex: read data file once at startup")
Cc: stable@dpdk.org

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
2022-07-05 22:03:39 +02:00
Gerry Gribbon
c1d1b94eec app/regex: fix number of matches
Depending on number of jobs specified on command line, part of the
data buffer may not get searched, resulting in incorrect number of
matches being reported.

Additional change to ensure the "All Matches" summary outputs the
correct match start locations in the supplied data buffer.

Fixes: de06137cb2 ("app/regex: add RegEx test application")
Cc: stable@dpdk.org

Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-03-14 12:15:29 +01:00
Stephen Hemminger
06c047b680 remove unnecessary null checks
Functions like free, rte_free, and rte_mempool_free
already handle NULL pointer so the checks here are not necessary.

Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-02-12 12:07:48 +01:00
David Marchand
f88b0b8922 devtools: forbid indent with tabs in Meson
The rule for indentation in Meson in DPDK is 4 spaces.

Any tab should be flagged as an issue, let's extend the check and fix
existing offenders.

Fixes: 4ad4b20a79 ("drivers: change indentation in build files")
Fixes: 2457705e64 ("crypto/cnxk: add driver skeleton")
Fixes: 634b731044 ("app/testpmd: build on Windows")
Fixes: 3a6bfc37ea ("net/ice: support QoS config VF bandwidth in DCF")
Fixes: 8ef09fdc50 ("build: add optional NUMA and CPU counts detection")
Fixes: e1369718f5 ("common/octeontx: enable build only on 64-bit Linux")
Fixes: 2b504721bf ("app/bbdev: enable la12xx")
Fixes: 6cc51b1293 ("mem: instrument allocator for ASan")
Fixes: c75542ae42 ("crypto/ipsec_mb: introduce IPsec_mb framework")
Fixes: 918fd2f146 ("crypto/ipsec_mb: move aesni_mb PMD")
Fixes: 746825e5c0 ("crypto/ipsec_mb: move aesni_gcm PMD")
Fixes: bc9ef81c42 ("crypto/ipsec_mb: move kasumi PMD")
Fixes: 4f1cfda59a ("crypto/ipsec_mb: move snow3g PMD")
Fixes: cde8df1bda ("crypto/ipsec_mb: move zuc PMD")
Fixes: f166628854 ("crypto/ipsec_mb: add chacha_poly PMD")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-11-02 19:25:30 +01:00
Jie Zhou
634b731044 app/testpmd: build on Windows
- Disable unsupported apps on Windows
- Enable building of testpmd on Windows

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-07-02 19:03:03 +02:00
Thomas Monjalon
e0512833d4 app/regex: fix usage text
The usage syntax help includes the program name which was fake.
It is replaced with the real name from argv.

Fixes: de06137cb2 ("app/regex: add RegEx test application")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-04-09 14:31:41 +02:00
Thomas Monjalon
487cfc2437 app: fix exit messages
Some applications were printing useless messages with rte_exit()
after showing the help. Using exit() is enough in this case.

Some applications were using a redundant printf or fprintf() before
calling rte_exit(). The messages are unified in a single rte_exit().

Some rte_exit() calls were missing a line feed or returning a wrong code.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-04-09 14:31:29 +02:00
Suanming Mou
cace2d7ef2 app/test-regex: add scattered mbuf input
This commits adds the scattered mbuf input support.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-04-08 22:52:55 +02:00
Ophir Munk
e5e518edd6 app/regex: measure performance with precise clock
Performance measurement (elapsed time and Gbps) are based on Linux
clock() API. The resolution is improved by replacing the clock() API
with rte_rdtsc_precise() API.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-13 00:04:27 +01:00
Ophir Munk
6e3c6bd6ab app/regex: measure performance per queue pair
Up to this commit measuring the parsing elapsed time and Giga bits per
second performance was done on the aggregation of all QPs (per core).
This commit separates the time measurements per individual QP.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-13 00:00:21 +01:00
Ophir Munk
6b99ba8d4b app/regex: support multiple cores
Up to this commit the regex application was running with multiple QPs on
a single core.  This commit adds the option to specify a number of cores
on which multiple QPs will run.
A new parameter 'nb_lcores' was added to configure the number of cores:
--nb_lcores <num of cores>.
If not configured the number of cores is set to 1 by default.  On
application startup a few initial steps occur by the main core: the
number of QPs and cores are parsed.  The QPs are distributed as evenly
as possible on the cores.  The regex device and all QPs are initialized.
The data file is read and saved in a buffer. Then for each core the
application calls rte_eal_remote_launch() with the worker routine
(run_regex) as its parameter.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-12 23:59:51 +01:00
Ophir Munk
f5cffb7eb7 app/regex: read data file once at startup
Up to this commit the input data file was read from scratch for each QP,
which is redundant. Starting from this commit the data file is read only
once at startup. Each QP will clone the data.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-12 23:59:33 +01:00
Ophir Munk
4545bd0088 app/regex: support multiple queue pairs
Up to this commit the regex application used one QP which was assigned a
number of jobs, each with a different segment of a file to parse.  This
commit adds support for multiple QPs assignments. All QPs will be
assigned the same number of jobs, with the same segments of file to
parse. It will enable comparing functionality with different numbers of
QPs. All queues are managed on one core with one thread. This commit
focuses on changing routines API to support multi QPs, mainly, QP scalar
variables are replaced by per-QP struct instance.  The enqueue/dequeue
operations are interleaved as follows:
 enqueue(QP #1)
 enqueue(QP #2)
 ...
 enqueue(QP #n)
 dequeue(QP #1)
 dequeue(QP #2)
 ...
 dequeue(QP #n)

A new parameter 'nb_qps' was added to configure the number of QPs:
 --nb_qps <num of qps>.
If not configured, nb_qps is set to 1 by default.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-12 23:56:46 +01:00
Ophir Munk
2d1fb3f2a6 app/regex: move mempool creation to worker routine
Function rte_pktmbuf_pool_create() is moved from init_port() routine to
run_regex() routine. Looking forward on multi core support - init_port()
will be called only once as part of application startup while mem pool
creation should be called multiple times (per core).

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-12 23:56:13 +01:00
Guy Kaneti
30cf171352 app/regex: add job context
Store mbuf pointer associated with that job.

Signed-off-by: Guy Kaneti <guyk@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-11-03 02:06:03 +01:00
Guy Kaneti
d96d0fa710 app/regex: configure queue according to capabilities
configure qp with OOS according to device capabilities
returned from rte_regexdev_info_get.

Signed-off-by: Guy Kaneti <guyk@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-11-03 02:03:52 +01:00
Ophir Munk
06ca0e4baa app/regex: fix crash in options parsing
getopt_long() parses command-line arguments. One of its arguments
'longopts' is a pointer to the first element of an array of struct
option.  The last element of the array has to be filled with zeros
to mark the end of options. For example:

struct option longopts[] = {
{ "help",  0, 0, ARG_HELP},
....
/* End of options */
{ 0, 0, 0, 0 }
};

This commit adds the last element. Prior to this commit getopt_long()
continued parsing beyond the longopts[] array which occasionally caused
segmentation faults.

Fixes: de06137cb2 ("app/regex: add RegEx test application")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2020-10-20 00:05:54 +02:00
Ciara Power
3cc6ecfdfe build: remove makefiles
A decision was made [1] to no longer support Make in DPDK, this patch
removes all Makefiles that do not make use of pkg-config, along with
the mk directory previously used by make.

[1] https://mails.dpdk.org/archives/dev/2020-April/162839.html

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-09-08 00:09:50 +02:00
Yuval Avnery
de06137cb2 app/regex: add RegEx test application
Following the new RegEx class.
There is a need to create a dedicated test application in order to
validate this class and PMD.

Unlike net device this application loads data from a file.

This commit introduces the new RegEx test app.

The basic app flow:
1. Configure the RegEx device to use one queue, and set the rule
   database, using precompiled file.
2. Allocate mbufs based on the requested number of jobs, each job will
i  get one mbuf.
3. Enqueue as much as possible jobs.
4. Dequeue jobs.
5. if the number of dequeue jobs < requested number of jobs job to step

Signed-off-by: Ori Kam <orika@mellanox.com>
Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
2020-07-30 09:13:52 +02:00