From: Jiawei Wang <jiaweiw@nvidia.com>
To: <matan@nvidia.com>, <haifeil@nvidia.com>, <thomas@monjalon.net>,
"Wisam Jaddo" <wisamm@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [dpdk-dev] [PATCH 2/3] app/flow-perf: add new meter CIR Configuration
Date: Mon, 10 May 2021 19:17:22 +0300 [thread overview]
Message-ID: <20210510161723.27432-3-jiaweiw@nvidia.com> (raw)
In-Reply-To: <20210510161723.27432-1-jiaweiw@nvidia.com>
Add the new meter CIR configuration parameter, user can set the
different value for committed information rate(CIR) parameter.
The usage as below:
--meter-cir=N, default count is 1250000.
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
---
app/test-flow-perf/main.c | 13 +++++++++++--
doc/guides/tools/flow-perf.rst | 3 +++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 7b8b6fb9c4..1836becbc8 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -71,6 +71,7 @@ static uint32_t rules_count;
static uint32_t rules_batch;
static uint32_t hairpin_queues_num; /* total hairpin q number - default: 0 */
static uint32_t nb_lcores;
+static uint64_t meter_cir;
#define MAX_PKT_BURST 32
#define LCORE_MODE_PKT 1
@@ -144,6 +145,8 @@ usage(char *progname)
printf(" --unique-data: flag to set using unique data for all"
" actions that support data, such as header modify and encap actions\n");
printf(" --policy-mtr: To create meter with policy\n");
+ printf(" --meter-cir=N: to set committed information rate(CIR)"
+ " parameter in meter profile, default is %d\n", METER_CIR);
printf("To set flow attributes:\n");
printf(" --ingress: set ingress attribute in flows\n");
@@ -584,6 +587,7 @@ args_parse(int argc, char **argv)
{ "portmask", 1, 0, 0 },
{ "cores", 1, 0, 0 },
{ "policy-mtr", 0, 0, 0 },
+ { "meter-cir", 1, 0, 0 },
/* Attributes */
{ "ingress", 0, 0, 0 },
{ "egress", 0, 0, 0 },
@@ -815,6 +819,10 @@ args_parse(int argc, char **argv)
}
if (strcmp(lgopts[opt_idx].name, "policy-mtr") == 0)
policy_mtr = true;
+ if (strcmp(lgopts[opt_idx].name, "meter-cir") == 0) {
+ n = atoi(optarg);
+ meter_cir = (uint64_t) n;
+ }
break;
default:
usage(argv[0]);
@@ -1130,8 +1138,8 @@ create_meter_profile(void)
continue;
mp.alg = RTE_MTR_SRTCM_RFC2697;
- mp.srtcm_rfc2697.cir = METER_CIR;
- mp.srtcm_rfc2697.cbs = METER_CIR / 8;
+ mp.srtcm_rfc2697.cir = meter_cir;
+ mp.srtcm_rfc2697.cbs = meter_cir / 8;
mp.srtcm_rfc2697.ebs = 0;
ret = rte_mtr_meter_profile_add
@@ -1952,6 +1960,7 @@ main(int argc, char **argv)
dump_socket_mem_flag = false;
flow_group = DEFAULT_GROUP;
unique_data = false;
+ meter_cir = METER_CIR;
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst
index 4c6480d70a..c3e0e8e3ad 100644
--- a/doc/guides/tools/flow-perf.rst
+++ b/doc/guides/tools/flow-perf.rst
@@ -105,6 +105,9 @@ The command line options are:
Such as header modify and encap actions. Default is using fixed
data for any action that support data for all flows.
+* ``--meter-cir=N``
+ Set the committed information rate(CIR) parameter, default count is 1250000.
+
Attributes:
* ``--ingress``
--
2.18.1
next prev parent reply other threads:[~2021-05-10 16:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 16:17 [dpdk-dev] [PATCH 0/3] app/flow-perf: support meter policy API Jiawei Wang
2021-05-10 16:17 ` [dpdk-dev] [PATCH 1/3] " Jiawei Wang
2021-05-10 16:21 ` Wisam Monther
2021-05-10 16:17 ` Jiawei Wang [this message]
2021-05-10 16:17 ` [dpdk-dev] [PATCH 3/3] app/flow-perf: add the supports for meter PPS Jiawei Wang
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=20210510161723.27432-3-jiaweiw@nvidia.com \
--to=jiaweiw@nvidia.com \
--cc=dev@dpdk.org \
--cc=haifeil@nvidia.com \
--cc=matan@nvidia.com \
--cc=rasland@nvidia.com \
--cc=thomas@monjalon.net \
--cc=wisamm@nvidia.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).