DPDK patches and discussions
 help / color / mirror / Atom feed
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 3/3] app/flow-perf: add the supports for meter PPS
Date: Mon, 10 May 2021 19:17:23 +0300	[thread overview]
Message-ID: <20210510161723.27432-4-jiaweiw@nvidia.com> (raw)
In-Reply-To: <20210510161723.27432-1-jiaweiw@nvidia.com>

The flow perf application used the srtcm_rfc2697 as meter profile
while do the meter testing.
This patch adds the support new configuration parameter
'--packet-mode' to generate the meter flows with the packet mode.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
---
 app/test-flow-perf/main.c      | 8 +++++++-
 doc/guides/tools/flow-perf.rst | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 1836becbc8..5178f219d0 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -64,6 +64,7 @@ static bool dump_socket_mem_flag;
 static bool enable_fwd;
 static bool unique_data;
 static bool policy_mtr;
+static bool packet_mode;
 
 static struct rte_mempool *mbuf_mp;
 static uint32_t nb_lcores;
@@ -147,6 +148,7 @@ usage(char *progname)
 	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("  --packet-mode: To enable packet mode for meter profile\n");
 
 	printf("To set flow attributes:\n");
 	printf("  --ingress: set ingress attribute in flows\n");
@@ -588,6 +590,7 @@ args_parse(int argc, char **argv)
 		{ "cores",                      1, 0, 0 },
 		{ "policy-mtr",                 0, 0, 0 },
 		{ "meter-cir",                  1, 0, 0 },
+		{ "packet-mode",                0, 0, 0 },
 		/* Attributes */
 		{ "ingress",                    0, 0, 0 },
 		{ "egress",                     0, 0, 0 },
@@ -823,6 +826,8 @@ args_parse(int argc, char **argv)
 				n = atoi(optarg);
 				meter_cir = (uint64_t) n;
 			}
+			if (strcmp(lgopts[opt_idx].name, "packet-mode") == 0)
+				packet_mode = true;
 			break;
 		default:
 			usage(argv[0]);
@@ -990,7 +995,7 @@ create_meter_rule(int port_id, uint32_t counter)
 {
 	int ret;
 	struct rte_mtr_params params;
-	uint32_t default_prof_id = 100;
+	uint32_t default_prof_id = DEFAULT_METER_PROF_ID;
 	struct rte_mtr_error error;
 
 	memset(&params, 0, sizeof(struct rte_mtr_params));
@@ -1141,6 +1146,7 @@ create_meter_profile(void)
 		mp.srtcm_rfc2697.cir = meter_cir;
 		mp.srtcm_rfc2697.cbs = meter_cir / 8;
 		mp.srtcm_rfc2697.ebs = 0;
+		mp.packet_mode = packet_mode;
 
 		ret = rte_mtr_meter_profile_add
 			(port_id, DEFAULT_METER_PROF_ID, &mp, &error);
diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst
index c3e0e8e3ad..c6d7f15ace 100644
--- a/doc/guides/tools/flow-perf.rst
+++ b/doc/guides/tools/flow-perf.rst
@@ -108,6 +108,9 @@ The command line options are:
 *	``--meter-cir=N``
 	Set the committed information rate(CIR) parameter, default count is 1250000.
 
+*	``--packet-mode``
+	Enable packets mode for meter profile.
+
 Attributes:
 
 *	``--ingress``
-- 
2.18.1


      parent reply	other threads:[~2021-05-10 16:18 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 ` [dpdk-dev] [PATCH 2/3] app/flow-perf: add new meter CIR Configuration Jiawei Wang
2021-05-10 16:17 ` Jiawei Wang [this message]

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-4-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).