From: Rongwei Liu <rongweil@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
<thomas@monjalon.net>, Wisam Jaddo <wisamm@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [PATCH v9 3/5] app/flow-perf: support dynamic values for meter profile
Date: Thu, 11 Nov 2021 16:23:38 +0200 [thread overview]
Message-ID: <20211111142340.2209292-4-rongweil@nvidia.com> (raw)
In-Reply-To: <20211111142340.2209292-1-rongweil@nvidia.com>
Change meter-cir option to meter-profile to cover user input for CIR,
CBS & EBS values.
The usage is as below:
--meter-profile=N1,N2,N3 default value is 1250000 156250 0.
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
---
app/test-flow-perf/main.c | 24 +++++++++++++++++++++---
doc/guides/tools/flow-perf.rst | 3 +++
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 89596eb3f6..01bfa20db7 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -85,6 +85,7 @@ static uint32_t hairpin_queues_num; /* total hairpin q number - default: 0 */
static uint32_t nb_lcores;
static uint8_t max_priority;
static uint32_t rand_seed;
+static uint64_t meter_profile_values[3]; /* CIR CBS EBS values. */
#define MAX_PKT_BURST 32
#define LCORE_MODE_PKT 1
@@ -484,6 +485,9 @@ usage(char *progname)
"and S as seed for pseudo-random number generator\n");
printf(" --unique-data: flag to set using unique data for all"
" actions that support data, such as header modify and encap actions\n");
+ printf(" --meter-profile=cir,cbs,ebs: set CIR CBS EBS parameters in meter"
+ " profile, default values are %d,%d,%d\n", METER_CIR,
+ METER_CIR / 8, 0);
printf("To set flow attributes:\n");
printf(" --ingress: set ingress attribute in flows\n");
@@ -707,6 +711,7 @@ args_parse(int argc, char **argv)
{ "vxlan-encap", 0, 0, 0 },
{ "vxlan-decap", 0, 0, 0 },
{ "policy-mtr", 1, 0, 0 },
+ { "meter-profile", 1, 0, 0 },
};
RTE_ETH_FOREACH_DEV(i)
@@ -926,6 +931,17 @@ args_parse(int argc, char **argv)
}
if (strcmp(lgopts[opt_idx].name, "policy-mtr") == 0)
read_meter_policy(argv[0], optarg);
+ if (strcmp(lgopts[opt_idx].name,
+ "meter-profile") == 0) {
+ i = 0;
+ token = strsep(&optarg, ",\0");
+ while (token != NULL && i < sizeof(
+ meter_profile_values) /
+ sizeof(uint64_t)) {
+ meter_profile_values[i++] = atol(token);
+ token = strsep(&optarg, ",\0");
+ }
+ }
break;
default:
usage(argv[0]);
@@ -1251,9 +1267,11 @@ create_meter_profile(void)
if (!((ports_mask >> port_id) & 0x1))
continue;
mp.alg = RTE_MTR_SRTCM_RFC2697;
- mp.srtcm_rfc2697.cir = METER_CIR;
- mp.srtcm_rfc2697.cbs = METER_CIR / 8;
- mp.srtcm_rfc2697.ebs = 0;
+ mp.srtcm_rfc2697.cir = meter_profile_values[0] ?
+ meter_profile_values[0] : METER_CIR;
+ mp.srtcm_rfc2697.cbs = meter_profile_values[1] ?
+ meter_profile_values[1] : METER_CIR / 8;
+ mp.srtcm_rfc2697.ebs = meter_profile_values[2];
ret = rte_mtr_meter_profile_add
(port_id, DEFAULT_METER_PROF_ID, &mp, &error);
if (ret != 0) {
diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst
index e4083f053e..24f0fefcd8 100644
--- a/doc/guides/tools/flow-perf.rst
+++ b/doc/guides/tools/flow-perf.rst
@@ -134,6 +134,9 @@ The command line options are:
* ``--total-mbuf-count=N``
Set the count of total mbuf number, default count is 32000.
+* ``--meter-profile=N1,N2,N3``
+ Set the CIR, CBS and EBS parameters, default values are 1250000, 156250 and 0.
+
Attributes:
* ``--ingress``
--
2.27.0
next prev parent reply other threads:[~2021-11-11 14:24 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 6:50 [dpdk-dev] [PATCH] app/flow-perf: support meter policy API Haifei Luo
2021-05-09 10:47 ` Wisam Monther
2021-07-21 7:05 ` [dpdk-dev] [PATCH v2 0/3] support new format meter Rongwei Liu
2021-07-21 7:05 ` [dpdk-dev] [PATCH v2 1/3] app/flow-perf: support meter policy API Rongwei Liu
2021-09-26 9:45 ` Wisam Monther
2021-10-28 3:25 ` [dpdk-dev] [PATCH v3 0/3] add meter policy support in flow-perf Rongwei Liu
2021-10-28 3:25 ` [dpdk-dev] [PATCH v3 1/3] app/flow-perf: support meter policy API Rongwei Liu
2021-11-05 9:57 ` Thomas Monjalon
2021-11-05 10:24 ` Rongwei Liu
2021-11-05 10:34 ` Thomas Monjalon
2021-11-08 8:53 ` [dpdk-dev] [PATCH v4 0/3] add meter policy support in flow-perf Rongwei Liu
2021-11-08 8:53 ` [dpdk-dev] [PATCH v4 1/3] app/flow-perf: support meter policy API Rongwei Liu
2021-11-08 9:05 ` Thomas Monjalon
2021-11-08 9:23 ` [dpdk-dev] [PATCH v5 0/3] add meter policy support in flow-perf Rongwei Liu
2021-11-08 9:23 ` [dpdk-dev] [PATCH v5 1/3] app/flow-perf: support meter policy API Rongwei Liu
2021-11-08 9:23 ` [dpdk-dev] [PATCH v5 2/3] app/flow-perf: add meter-profile to support cir cbs and ebs Rongwei Liu
2021-11-08 9:23 ` [dpdk-dev] [PATCH v5 3/3] app/flow-perf: add packet mode metering mode Rongwei Liu
2021-11-08 9:35 ` [dpdk-dev] [PATCH v5 0/3] add meter policy support in flow-perf Thomas Monjalon
2021-11-08 9:39 ` Rongwei Liu
2021-11-08 9:40 ` Thomas Monjalon
2021-11-08 9:58 ` [dpdk-dev] [PATCH v6 " Rongwei Liu
2021-11-08 9:58 ` [dpdk-dev] [PATCH v6 1/3] app/flow-perf: support meter policy API Rongwei Liu
2021-11-08 10:08 ` Thomas Monjalon
2021-11-08 9:58 ` [dpdk-dev] [PATCH v6 2/3] app/flow-perf: add meter-profile to support cir cbs and ebs Rongwei Liu
2021-11-08 10:10 ` Thomas Monjalon
2021-11-08 9:58 ` [dpdk-dev] [PATCH v6 3/3] app/flow-perf: add packet mode metering mode Rongwei Liu
2021-11-08 11:10 ` [dpdk-dev] [PATCH v7 0/3] add meter policy support in flow-perf Rongwei Liu
2021-11-08 11:10 ` [dpdk-dev] [PATCH v7 1/3] app/flow-perf: support meter policy API Rongwei Liu
2021-11-08 11:10 ` [dpdk-dev] [PATCH v7 2/3] app/flow-perf: add meter-profile to support cir cbs and ebs Rongwei Liu
2021-11-08 11:10 ` [dpdk-dev] [PATCH v7 3/3] app/flow-perf: add packet mode metering mode Rongwei Liu
2021-11-10 12:57 ` [dpdk-dev] [PATCH v8 0/3] add meter policy support in flow-perf Rongwei Liu
2021-11-10 12:57 ` [dpdk-dev] [PATCH v8 1/3] app/flow-perf: support meter policy API Rongwei Liu
2021-11-10 12:57 ` [dpdk-dev] [PATCH v8 2/3] app/flow-perf: support dynamic values for meter profile Rongwei Liu
2021-11-10 12:57 ` [dpdk-dev] [PATCH v8 3/3] app/flow-perf: add packet metering mode Rongwei Liu
2021-11-11 14:23 ` [PATCH v9 0/5] add meter policy support in flow-perf Rongwei Liu
2021-11-11 14:23 ` [PATCH v9 1/5] app/flow-perf: define flow-options as global Rongwei Liu
2021-11-16 10:05 ` Wisam Monther
2021-11-11 14:23 ` [PATCH v9 2/5] app/flow-perf: support meter policy API Rongwei Liu
2021-11-16 10:05 ` Wisam Monther
2021-11-11 14:23 ` Rongwei Liu [this message]
2021-11-16 10:05 ` [PATCH v9 3/5] app/flow-perf: support dynamic values for meter profile Wisam Monther
2021-11-11 14:23 ` [PATCH v9 4/5] app/flow-perf: add packet metering mode Rongwei Liu
2021-11-16 10:05 ` Wisam Monther
2021-11-11 14:23 ` [PATCH v9 5/5] app/flow-perf: fix previous wrong indentation Rongwei Liu
2021-11-16 10:05 ` Wisam Monther
2021-11-16 10:07 ` Rongwei Liu
2021-11-16 11:33 ` [PATCH v9 0/5] add meter policy support in flow-perf Thomas Monjalon
2021-11-08 8:53 ` [dpdk-dev] [PATCH v4 2/3] app/flow-perf: add meter-profile to support cir cbs and ebs Rongwei Liu
2021-11-08 8:53 ` [dpdk-dev] [PATCH v4 3/3] app/flow-perf: add packet mode metering mode Rongwei Liu
2021-10-28 3:25 ` [dpdk-dev] [PATCH v3 2/3] app/flow-perf: add meter-profile to support cir cbs and ebs Rongwei Liu
2021-10-28 3:26 ` [dpdk-dev] [PATCH v3 3/3] app/flow-perf: add packet mode metering mode Rongwei Liu
2021-07-21 7:05 ` [dpdk-dev] [PATCH v2 2/3] app/flow-perf: add new meter CIR Configuration Rongwei Liu
2021-09-26 9:46 ` Wisam Monther
2021-07-21 7:05 ` [dpdk-dev] [PATCH v2 3/3] app/flow-perf: add the supports for meter PPS Rongwei Liu
2021-09-26 9:47 ` Wisam Monther
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=20211111142340.2209292-4-rongweil@nvidia.com \
--to=rongweil@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
--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).