DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Ori Kam <orika@mellanox.com>
Cc: jerinj@marvell.com, xiang.w.wang@intel.com, matan@mellanox.com,
	viacheslavo@mellanox.com, John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	dev@dpdk.org, guyk@marvell.com, dev@dpdk.org,
	pbhagavatula@marvell.com, shahafs@mellanox.com,
	hemant.agrawal@nxp.com, opher@mellanox.com, alexr@mellanox.com,
	dovrat@marvell.com, pkapoor@marvell.com, nipun.gupta@nxp.com,
	bruce.richardson@intel.com, yang.a.hong@intel.com,
	harry.chang@intel.com, gu.jian1@zte.com.cn,
	shanjiangh@chinatelecom.cn, zhangy.yun@chinatelecom.cn,
	lixingfu@huachentel.com, wushuai@inspur.com,
	yuyingxia@yxlink.com, fanchenggang@sunyainfo.com,
	davidfgao@tencent.com, liuzhong1@chinaunicom.cn,
	zhaoyong11@huawei.com, oc@yunify.com, jim@netgate.com,
	hongjun.ni@intel.com, deri@ntop.org, fc@napatech.com,
	arthur.su@lionic.com, rasland@mellanox.com,
	Yuval Avnery <yuvalav@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH v3] app/test-regex: add RegEx test application
Date: Wed, 29 Jul 2020 15:54:25 +0200
Message-ID: <4399824.qcR0VbfG77@thomas> (raw)
In-Reply-To: <1596021966-10450-1-git-send-email-orika@mellanox.com>

29/07/2020 13:26, Ori Kam:
> --- /dev/null
> +++ b/app/test-regex/Makefile
> @@ -0,0 +1,21 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright 2020 Mellanox Technologies, Ltd
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +#
> +# library name

It's not a library.
You can completely drop this useless comment.

> +#
> +APP = testregex
> +
> +CFLAGS += -O3
> +CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
> +
> +#
> +# all source are stored in SRCS-y
> +#
> +SRCS-y := main.c
> +
> +include $(RTE_SDK)/mk/rte.app.mk
> +

extra blank line at EOF

> diff --git a/app/test-regex/main.c b/app/test-regex/main.c
> new file mode 100644
> index 0000000..789d9ec
> --- /dev/null
> +++ b/app/test-regex/main.c
> @@ -0,0 +1,447 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright 2020 Mellanox Technologies, Ltd
> + */
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +#include <stdint.h>
> +#include <stdbool.h>
> +#include <stdarg.h>
> +#include <ctype.h>
> +#include <errno.h>
> +#include <getopt.h>
> +#include <signal.h>
> +
> +#include <rte_eal.h>
> +#include <rte_common.h>
> +#include <rte_malloc.h>
> +#include <rte_mempool.h>
> +#include <rte_mbuf.h>
> +#include <rte_cycles.h>
> +#include <rte_regexdev.h>
> +
> +#define HELP_VAL 0
> +#define RULES_VAL 1
> +#define DATA_VAL 2
> +#define JOB_VAL 3
> +#define PERF_VAL 4
> +#define ITER_VAL 5

These macros are not used anymore.

> +
> +#define MAX_FILE_NAME 255
> +
> +/* enum that holds the value for the application arguments. */

There is no value in "enum that holds the value for the".
You can just keep "application arguments",
but the real info is to say it is not a value but an argument index.
What about "arguments parsed with getopt_long"?

> +enum app_arg_values {

_values suffix look wrong

> +	ARG_HELP,
> +	ARG_RULES_FILE_NAME,
> +	ARG_DATA_FILE_NAME,
> +	ARG_NUM_OF_JOBS,
> +	ARG_PERF_MODE,
> +	ARG_NUM_OF_ITERATIONS,
> +
> +};
> +
[...]
> +
> +#define MBUF_CACHE_SIZE 256
> +#define MBUF_SIZE (1 << 8)

I expect such definitions at the beginning of the file.

[...]
> +static void
> +extbuf_free_cb(void *addr __rte_unused, void *fcb_opaque __rte_unused)
> +{
> +
> +}

extra blank line

> +
> +#define START_BURST_SIZE 32u

could be at beginning also

> --- /dev/null
> +++ b/app/test-regex/meson.build
> @@ -0,0 +1,5 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2018 Intel Corporation

Please don't assign copyright to someone not involved.

> +
> +sources = files('main.c')
> +deps = ['regexdev']

[...]
> +Application Options
> +~~~~~~~~~~~~~~~~~~~
> +
> +* ``--rules NAME``: precompiled rule file
> +
> +* ``--data NAME``: data file to use
> +
> +* ``--nb_jobs N``: number of jobs to use
> +
> +* ``--perf N``: only outputs the performance data
> +
> +* ``--nb_iter N``: number of iteration to run
> +
> +* ``--help``: prints this help

Same comment as v1, definition list is better.

> +Compiling the Tool
> +------------------
> +
> +The ``dpdk-test-regex`` application depends on RegEx lib ``rte_regexdev``.

It is obvious.

> +Running the Tool
> +----------------
> +
> +**Step 1: Compile a rule file**
> +
> +In order for the RegEx to work it must have a precompiled rule file.
> +to generate this file there is a need to use a RegEx compiler that matches the
> +RegEx PMD.
> +
> +**Step 2: Generate a data file**
> +
> +The data file, will be used as a source data for the RegEx to work on.
> +
> +**Step 3: Run the tool**
> +
> +The tool has a number of command line options. Here is the sample command line::
> +
> +   .testregex -w 83:00.0 -- --rules rule_file.rof2 --data data_file.txt --job 100

What is .testregex?

OK, these steps are important to understand well.



  reply	other threads:[~2020-07-29 13:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 19:58 [dpdk-dev] [PATCH v1] " Ori Kam
2020-07-27  4:50 ` Jerin Jacob
2020-07-27  5:12   ` Ori Kam
2020-07-27 16:36     ` Thomas Monjalon
2020-07-28  4:36       ` Ori Kam
2020-07-27 17:09 ` Thomas Monjalon
2020-07-28  4:29   ` Ori Kam
2020-07-29 11:13 ` [dpdk-dev] [PATCH v2] " Ori Kam
2020-07-29 11:26 ` [dpdk-dev] [PATCH v3] " Ori Kam
2020-07-29 13:54   ` Thomas Monjalon [this message]
2020-07-29 18:09 ` [dpdk-dev] [PATCH v4] " Ori Kam
2020-07-30  7:08   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4399824.qcR0VbfG77@thomas \
    --to=thomas@monjalon.net \
    --cc=alexr@mellanox.com \
    --cc=arthur.su@lionic.com \
    --cc=bruce.richardson@intel.com \
    --cc=davidfgao@tencent.com \
    --cc=deri@ntop.org \
    --cc=dev@dpdk.org \
    --cc=dovrat@marvell.com \
    --cc=fanchenggang@sunyainfo.com \
    --cc=fc@napatech.com \
    --cc=gu.jian1@zte.com.cn \
    --cc=guyk@marvell.com \
    --cc=harry.chang@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hongjun.ni@intel.com \
    --cc=jerinj@marvell.com \
    --cc=jim@netgate.com \
    --cc=john.mcnamara@intel.com \
    --cc=liuzhong1@chinaunicom.cn \
    --cc=lixingfu@huachentel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=matan@mellanox.com \
    --cc=nipun.gupta@nxp.com \
    --cc=oc@yunify.com \
    --cc=opher@mellanox.com \
    --cc=orika@mellanox.com \
    --cc=pbhagavatula@marvell.com \
    --cc=pkapoor@marvell.com \
    --cc=rasland@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=shanjiangh@chinatelecom.cn \
    --cc=viacheslavo@mellanox.com \
    --cc=wushuai@inspur.com \
    --cc=xiang.w.wang@intel.com \
    --cc=yang.a.hong@intel.com \
    --cc=yuvalav@mellanox.com \
    --cc=yuyingxia@yxlink.com \
    --cc=zhangy.yun@chinatelecom.cn \
    --cc=zhaoyong11@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git