[v3,3/3] app/flow-perf: add packet mode metering mode

Message ID 20211028032600.638212-4-rongweil@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series add meter policy support in flow-perf |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-spell-check-testing warning Testing issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Rongwei Liu Oct. 28, 2021, 3:26 a.m. UTC
  The flow perf application used the srtcm_rfc2697 as meter profile
while doing 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: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Wisam Monther <wisamm@nvidia.com>
---
 app/test-flow-perf/main.c      | 6 ++++++
 doc/guides/tools/flow-perf.rst | 3 +++
 2 files changed, 9 insertions(+)
  

Patch

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 8b8fc0fea3..d63328ef11 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -67,6 +67,7 @@  static bool dump_socket_mem_flag;
 static bool enable_fwd;
 static bool unique_data;
 static bool policy_mtr;
+static bool packet_mode;
 
 static uint8_t rx_queues_count;
 static uint8_t tx_queues_count;
@@ -152,6 +153,7 @@  usage(char *progname)
 		"color actions\n");
 	printf("  --meter-profile=cir,cbs,ebs: set CIR CBS EBS parameters in meter"
 		" profile, default is %d,%d,%d\n", METER_CIR, METER_CIR / 8, 0);
+	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");
@@ -665,6 +667,7 @@  args_parse(int argc, char **argv)
 		{ "vxlan-decap",                0, 0, 0 },
 		{ "policy-mtr",                 1, 0, 0 },
 		{ "meter-profile",              1, 0, 0 },
+		{ "packet-mode",                0, 0, 0 },
 	};
 
 	RTE_ETH_FOREACH_DEV(i)
@@ -879,6 +882,8 @@  args_parse(int argc, char **argv)
 					token = strsep(&arg, ",\0");
 				}
 			}
+			if (strcmp(lgopts[opt_idx].name, "packet-mode") == 0)
+				packet_mode = true;
 			if (strcmp(lgopts[opt_idx].name, "policy-mtr") == 0) {
 				j = 0;
 				k = 0;
@@ -1243,6 +1248,7 @@  create_meter_profile(void)
 		mp.srtcm_rfc2697.cbs = meter_profile_values[1] ?
 			meter_profile_values[1] : METER_CIR / 8;
 		mp.srtcm_rfc2697.ebs = meter_profile_values[2];
+		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 a38dda2fb7..e942a4400b 100644
--- a/doc/guides/tools/flow-perf.rst
+++ b/doc/guides/tools/flow-perf.rst
@@ -133,6 +133,9 @@  The command line options are:
 *	``--meter-profile=N1,N2,N3``
 	Set the CIR, CBS and EBS parameter, default value is 1250000, 156250 and 0.
 
+*	``--packet-mode``
+	Enable packets mode for meter profile.
+
 *	``--ingress``
 	Set Ingress attribute to all flows attributes.