From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CD8FA052B; Wed, 29 Jul 2020 15:54:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2B6F14C98; Wed, 29 Jul 2020 15:54:39 +0200 (CEST) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by dpdk.org (Postfix) with ESMTP id 79CAE4C93 for ; Wed, 29 Jul 2020 15:54:37 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id DD3A05801A9; Wed, 29 Jul 2020 09:54:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 29 Jul 2020 09:54:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= 2GWUmFjM/RIO7JCJokkPf0513nnR4LOizds/VD29OVY=; b=AZL0dQz6nCx9Oagi kJ4utV5G9GSCLG/F7BNJKBZ6kmVnzEUccxwqFjcJsrfL/s7aR7Ehr3s734JvaDsp k5I/ymX52e3SIdvzeLuJy92DYRKzUIuAHkelzwAZYPJnfU/6sdLl1H4p+uX5EXnA pfKszHkCzMW2f1QyrejgUXiKEeeVuBAYRGFYrTMwl4due+9hjGB12uZn63W/rjZS sPwffAV4zGZWOUfPgwg0intVM5rx9Tpb1oLNDpfUab1m6Vu7/l0xbMXaBmcU54D5 ZRAGnuSegcetK8WLkbfd2alwxRJBLtguQgEsKB58S8G69mINjW8JpnqgLI9+soSO Hu78fg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=2GWUmFjM/RIO7JCJokkPf0513nnR4LOizds/VD29O VY=; b=VQ1LPK2ebYoWIxc6hUTqnhptHcT5vZE2Zfsm5HXiSfdfB6Df/t7ybSkEK 0Gyn8ZhlsHrIzm/1HWAu5k11F2DbCRfazGDrwONSy13rNs0pqklMjj9m7YsB+9es U/7TINkH9vdJug6Y4DU1PdF5tcVJhEzJ0Aech/1DMUhFO++dKEVqc6TFuLgQeKXw dxFspQnIS4sajQnYDVBsTO3Me1VIeTgPuM25WoBEU6/iQfIn64bvYSJDvSjZDbsQ yG/v5cHVXBZA1S218jgsXYc/a2Qej/rruPv0dgi1MqVSkm068tWae5QqeVwWTZQH II6YyMYEGB640cHBN0Z8oGM9UzpgQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeggdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeehheeghfelffehtdevffejudektddttddvtdfhhfffhfevvedvueeh ffegtddvffenucffohhmrghinhepvhgrrhhsrdhmkhenucfkphepjeejrddufeegrddvtd efrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2E0BD30600B4; Wed, 29 Jul 2020 09:54:26 -0400 (EDT) From: Thomas Monjalon To: Ori Kam Cc: jerinj@marvell.com, xiang.w.wang@intel.com, matan@mellanox.com, viacheslavo@mellanox.com, John McNamara , Marko Kovacevic , 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 Date: Wed, 29 Jul 2020 15:54:25 +0200 Message-ID: <4399824.qcR0VbfG77@thomas> In-Reply-To: <1596021966-10450-1-git-send-email-orika@mellanox.com> References: <1595793496-73205-1-git-send-email-orika@mellanox.com> <1596021966-10450-1-git-send-email-orika@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3] app/test-regex: add RegEx test application X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#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.