[v2,3/3] app/flow-perf: add the supports for meter PPS

Message ID 20210721070542.1153843-4-rongweil@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series support new format meter |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing fail Testing issues

Commit Message

Rongwei Liu July 21, 2021, 7:05 a.m. UTC
  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>
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
---
 app/test-flow-perf/main.c      | 6 ++++++
 doc/guides/tools/flow-perf.rst | 3 +++
 2 files changed, 9 insertions(+)
  

Comments

Wisam Monther Sept. 26, 2021, 9:47 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Rongwei Liu <rongweil@nvidia.com>
> Sent: Wednesday, July 21, 2021 10:06 AM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> Thomas Monjalon <thomas@monjalon.net>; Wisam Monther
> <wisamm@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Jiawei(Jonny)
> Wang <jiaweiw@nvidia.com>
> Subject: [PATCH v2 3/3] app/flow-perf: add the supports for meter PPS
> 
> 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>
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>

Reviewed-by: Wisam Jaddo <wisamm@nvidia.com>

Please send new versions to fix the first two patches, and you can add my ack to the third patch for this version.

BRs,
Wisam Jaddo
  

Patch

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index dd0aac8b06..d2003108cc 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -66,6 +66,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;
@@ -143,6 +144,7 @@  usage(char *progname)
 	printf("  --policy-g_actions: To set meter policy green color actions\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");
@@ -585,6 +587,7 @@  args_parse(int argc, char **argv)
 		{ "policy-mtr",                 0, 0, 0 },
 		{ "policy-g_actions",           1, 0, 0 },
 		{ "meter-cir",                  1, 0, 0 },
+		{ "packet-mode",                0, 0, 0 },
 		/* Attributes */
 		{ "ingress",                    0, 0, 0 },
 		{ "egress",                     0, 0, 0 },
@@ -820,6 +823,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;
 			if (strcmp(lgopts[opt_idx].name,
 					"policy-g_actions") == 0) {
 				token = strtok(optarg, ",");
@@ -1165,6 +1170,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);
 		if (ret != 0) {
diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst
index 113e078eb5..1ec0d5d408 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``