DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
@ 2020-09-24  9:10 Georgios Katsikas
  2020-09-24 12:01 ` Wisam Monther
  0 siblings, 1 reply; 11+ messages in thread
From: Georgios Katsikas @ 2020-09-24  9:10 UTC (permalink / raw)
  To: wisamm; +Cc: dev, Georgios Katsikas

* One can now configure the number of rules per batch
* Refactored flow_count variable to rules_count as it is
related to the newly added rules_batch variable
* Added default values to usage function

Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
---
 app/test-flow-perf/main.c | 87 +++++++++++++++++++++++----------------
 1 file changed, 51 insertions(+), 36 deletions(-)

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index c420da6a5..904feb80f 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -40,7 +40,8 @@
 
 #define MAX_ITERATIONS             100
 #define DEFAULT_RULES_COUNT    4000000
-#define DEFAULT_ITERATION       100000
+#define DEFAULT_RULES_BATCH     100000
+#define DEFAULT_GROUP                0
 
 struct rte_flow *flow;
 static uint8_t flow_group;
@@ -62,8 +63,8 @@ static bool enable_fwd;
 
 static struct rte_mempool *mbuf_mp;
 static uint32_t nb_lcores;
-static uint32_t flows_count;
-static uint32_t iterations_number;
+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;
 
@@ -98,8 +99,8 @@ usage(char *progname)
 {
 	printf("\nusage: %s\n", progname);
 	printf("\nControl configurations:\n");
-	printf("  --flows-count=N: to set the number of needed"
-		" flows to insert, default is 4,000,000\n");
+	printf("  --rules-count=N: to set the number of needed"
+		" rules to insert, default is %d\n", DEFAULT_RULES_COUNT);
 	printf("  --dump-iterations: To print rates for each"
 		" iteration\n");
 	printf("  --deletion-rate: Enable deletion rate"
@@ -108,13 +109,15 @@ usage(char *progname)
 	printf("  --enable-fwd: To enable packets forwarding"
 		" after insertion\n");
 	printf("  --portmask=N: hexadecimal bitmask of ports used\n");
+	printf("  --rules-batch=N: set number of batched rules,"
+		" default is %d\n", DEFAULT_RULES_BATCH);
 
 	printf("To set flow attributes:\n");
 	printf("  --ingress: set ingress attribute in flows\n");
 	printf("  --egress: set egress attribute in flows\n");
 	printf("  --transfer: set transfer attribute in flows\n");
 	printf("  --group=N: set group for all flows,"
-		" default is 0\n");
+		" default is %d\n", DEFAULT_GROUP);
 
 	printf("To set flow items:\n");
 	printf("  --ether: add ether layer in flow items\n");
@@ -527,7 +530,8 @@ args_parse(int argc, char **argv)
 	static const struct option lgopts[] = {
 		/* Control */
 		{ "help",                       0, 0, 0 },
-		{ "flows-count",                1, 0, 0 },
+		{ "rules-count",                1, 0, 0 },
+		{ "rules-batch",                1, 0, 0 },
 		{ "dump-iterations",            0, 0, 0 },
 		{ "deletion-rate",              0, 0, 0 },
 		{ "dump-socket-mem",            0, 0, 0 },
@@ -705,13 +709,24 @@ args_parse(int argc, char **argv)
 			}
 			/* Control */
 			if (strcmp(lgopts[opt_idx].name,
-					"flows-count") == 0) {
+					"rules-batch") == 0) {
 				n = atoi(optarg);
-				if (n > (int) iterations_number)
-					flows_count = n;
+				if (n >= DEFAULT_RULES_BATCH)
+					rules_batch = n;
 				else {
-					printf("\n\nflows_count should be > %d\n",
-						iterations_number);
+					printf("\n\nrules_batch should be >= %d\n",
+						DEFAULT_RULES_BATCH);
+					rte_exit(EXIT_SUCCESS, " ");
+				}
+			}
+			if (strcmp(lgopts[opt_idx].name,
+					"rules-count") == 0) {
+				n = atoi(optarg);
+				if (n >= (int) rules_batch)
+					rules_count = n;
+				else {
+					printf("\n\nrules_count should be >= %d\n",
+						rules_batch);
 					rte_exit(EXIT_SUCCESS, " ");
 				}
 			}
@@ -826,13 +841,13 @@ destroy_flows(int port_id, struct rte_flow **flow_list)
 	for (i = 0; i < MAX_ITERATIONS; i++)
 		cpu_time_per_iter[i] = -1;
 
-	if (iterations_number > flows_count)
-		iterations_number = flows_count;
+	if (rules_batch > rules_count)
+		rules_batch = rules_count;
 
 	/* Deletion Rate */
 	printf("Flows Deletion on port = %d\n", port_id);
 	start_iter = clock();
-	for (i = 0; i < flows_count; i++) {
+	for (i = 0; i < rules_count; i++) {
 		if (flow_list[i] == 0)
 			break;
 
@@ -842,11 +857,11 @@ destroy_flows(int port_id, struct rte_flow **flow_list)
 			rte_exit(EXIT_FAILURE, "Error in deleting flow");
 		}
 
-		if (i && !((i + 1) % iterations_number)) {
+		if (i && !((i + 1) % rules_batch)) {
 			/* Save the deletion rate of each iter */
 			end_iter = clock();
 			delta = (double) (end_iter - start_iter);
-			iter_id = ((i + 1) / iterations_number) - 1;
+			iter_id = ((i + 1) / rules_batch) - 1;
 			cpu_time_per_iter[iter_id] =
 				delta / CLOCKS_PER_SEC;
 			cpu_time_used += cpu_time_per_iter[iter_id];
@@ -859,21 +874,21 @@ destroy_flows(int port_id, struct rte_flow **flow_list)
 		for (i = 0; i < MAX_ITERATIONS; i++) {
 			if (cpu_time_per_iter[i] == -1)
 				continue;
-			delta = (double)(iterations_number /
+			delta = (double)(rules_batch /
 				cpu_time_per_iter[i]);
 			flows_rate = delta / 1000;
 			printf(":: Iteration #%d: %d flows "
 				"in %f sec[ Rate = %f K/Sec ]\n",
-				i, iterations_number,
+				i, rules_batch,
 				cpu_time_per_iter[i], flows_rate);
 		}
 
 	/* Deletion rate for all flows */
-	flows_rate = ((double) (flows_count / cpu_time_used) / 1000);
+	flows_rate = ((double) (rules_count / cpu_time_used) / 1000);
 	printf("\n:: Total flow deletion rate -> %f K/Sec\n",
 		flows_rate);
 	printf(":: The time for deleting %d in flows %f seconds\n",
-		flows_count, cpu_time_used);
+		rules_count, cpu_time_used);
 }
 
 static inline void
@@ -902,13 +917,13 @@ flows_handler(void)
 	for (i = 0; i < MAX_ITERATIONS; i++)
 		cpu_time_per_iter[i] = -1;
 
-	if (iterations_number > flows_count)
-		iterations_number = flows_count;
+	if (rules_batch > rules_count)
+		rules_batch = rules_count;
 
-	printf(":: Flows Count per port: %d\n", flows_count);
+	printf(":: Flows Count per port: %d\n", rules_count);
 
 	flow_list = rte_zmalloc("flow_list",
-		(sizeof(struct rte_flow *) * flows_count) + 1, 0);
+		(sizeof(struct rte_flow *) * rules_count) + 1, 0);
 	if (flow_list == NULL)
 		rte_exit(EXIT_FAILURE, "No Memory available!");
 
@@ -941,7 +956,7 @@ flows_handler(void)
 		/* Insertion Rate */
 		printf("Flows insertion on port = %d\n", port_id);
 		start_iter = clock();
-		for (i = 0; i < flows_count; i++) {
+		for (i = 0; i < rules_count; i++) {
 			flow = generate_flow(port_id, flow_group,
 				flow_attrs, flow_items, flow_actions,
 				JUMP_ACTION_TABLE, i,
@@ -950,7 +965,7 @@ flows_handler(void)
 				&error);
 
 			if (force_quit)
-				i = flows_count;
+				i = rules_count;
 
 			if (!flow) {
 				print_flow_error(error);
@@ -959,11 +974,11 @@ flows_handler(void)
 
 			flow_list[flow_index++] = flow;
 
-			if (i && !((i + 1) % iterations_number)) {
+			if (i && !((i + 1) % rules_batch)) {
 				/* Save the insertion rate of each iter */
 				end_iter = clock();
 				delta = (double) (end_iter - start_iter);
-				iter_id = ((i + 1) / iterations_number) - 1;
+				iter_id = ((i + 1) / rules_batch) - 1;
 				cpu_time_per_iter[iter_id] =
 					delta / CLOCKS_PER_SEC;
 				cpu_time_used += cpu_time_per_iter[iter_id];
@@ -976,21 +991,21 @@ flows_handler(void)
 			for (i = 0; i < MAX_ITERATIONS; i++) {
 				if (cpu_time_per_iter[i] == -1)
 					continue;
-				delta = (double)(iterations_number /
+				delta = (double)(rules_batch /
 					cpu_time_per_iter[i]);
 				flows_rate = delta / 1000;
 				printf(":: Iteration #%d: %d flows "
 					"in %f sec[ Rate = %f K/Sec ]\n",
-					i, iterations_number,
+					i, rules_batch,
 					cpu_time_per_iter[i], flows_rate);
 			}
 
 		/* Insertion rate for all flows */
-		flows_rate = ((double) (flows_count / cpu_time_used) / 1000);
+		flows_rate = ((double) (rules_count / cpu_time_used) / 1000);
 		printf("\n:: Total flow insertion rate -> %f K/Sec\n",
 						flows_rate);
 		printf(":: The time for creating %d in flows %f seconds\n",
-						flows_count, cpu_time_used);
+						rules_count, cpu_time_used);
 
 		if (delete_flag)
 			destroy_flows(port_id, flow_list);
@@ -1415,11 +1430,11 @@ main(int argc, char **argv)
 
 	force_quit = false;
 	dump_iterations = false;
-	flows_count = DEFAULT_RULES_COUNT;
-	iterations_number = DEFAULT_ITERATION;
+	rules_count = DEFAULT_RULES_COUNT;
+	rules_batch = DEFAULT_RULES_BATCH;
 	delete_flag = false;
 	dump_socket_mem_flag = false;
-	flow_group = 0;
+	flow_group = DEFAULT_GROUP;
 
 	signal(SIGINT, signal_handler);
 	signal(SIGTERM, signal_handler);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-09-24  9:10 [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches Georgios Katsikas
@ 2020-09-24 12:01 ` Wisam Monther
  2020-10-05 17:16   ` Georgios Katsikas
  0 siblings, 1 reply; 11+ messages in thread
From: Wisam Monther @ 2020-09-24 12:01 UTC (permalink / raw)
  To: Georgios Katsikas, wisamm; +Cc: dev

Hi,

>-----Original Message-----
>From: george.dit@gmail.com <george.dit@gmail.com> On Behalf Of Georgios
>Katsikas
>Sent: Thursday, September 24, 2020 12:11 PM
>To: wisamm@mellanox.com
>Cc: dev@dpdk.org; Georgios Katsikas <katsikas.gp@gmail.com>
>Subject: [PATCH] app/flow-perf: configurable rule batches
>
>* One can now configure the number of rules per batch
>* Refactored flow_count variable to rules_count as it is related to the newly
>added rules_batch variable
>* Added default values to usage function
>
>Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>

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

BRs,
Wisam Jaddo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-09-24 12:01 ` Wisam Monther
@ 2020-10-05 17:16   ` Georgios Katsikas
  2020-10-05 22:25     ` Thomas Monjalon
  0 siblings, 1 reply; 11+ messages in thread
From: Georgios Katsikas @ 2020-10-05 17:16 UTC (permalink / raw)
  To: Wisam Monther; +Cc: wisamm, dev

Hi,

What is the conclusion?
I haven't seen this patch being committed yet.

Thanks,
Georigos

On Thu, Sep 24, 2020 at 3:01 PM Wisam Monther <wisamm@nvidia.com> wrote:

> Hi,
>
> >-----Original Message-----
> >From: george.dit@gmail.com <george.dit@gmail.com> On Behalf Of Georgios
> >Katsikas
> >Sent: Thursday, September 24, 2020 12:11 PM
> >To: wisamm@mellanox.com
> >Cc: dev@dpdk.org; Georgios Katsikas <katsikas.gp@gmail.com>
> >Subject: [PATCH] app/flow-perf: configurable rule batches
> >
> >* One can now configure the number of rules per batch
> >* Refactored flow_count variable to rules_count as it is related to the
> newly
> >added rules_batch variable
> >* Added default values to usage function
> >
> >Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
>
> Acked-by: Wisam Jaddo <wisamm@nvidia.com>
>
> BRs,
> Wisam Jaddo
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-10-05 17:16   ` Georgios Katsikas
@ 2020-10-05 22:25     ` Thomas Monjalon
  2020-10-11 10:33       ` Georgios Katsikas
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2020-10-05 22:25 UTC (permalink / raw)
  To: Georgios Katsikas; +Cc: Wisam Monther, dev

05/10/2020 19:16, Georgios Katsikas:
> Hi,
> 
> What is the conclusion?
> I haven't seen this patch being committed yet.

You missed updating the file doc/guides/tools/flow-perf.rst


> On Thu, Sep 24, 2020 at 3:01 PM Wisam Monther <wisamm@nvidia.com> wrote:
> >From: Georgios Katsikas
> > >
> > >* One can now configure the number of rules per batch

Please develop a bit more what was the previous behaviour
and what you mean by "batch" in this context.

> > >* Refactored flow_count variable to rules_count as it is related to the
> > newly
> > >added rules_batch variable
> > >* Added default values to usage function
> > >
> > >Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
> >
> > Acked-by: Wisam Jaddo <wisamm@nvidia.com>

Wisam, you should not ack if the doc is not updated.
Otherwise you will have to complete the doc update yourself ;)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-10-05 22:25     ` Thomas Monjalon
@ 2020-10-11 10:33       ` Georgios Katsikas
  0 siblings, 0 replies; 11+ messages in thread
From: Georgios Katsikas @ 2020-10-11 10:33 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Wisam Monther, dev

Hi,

Thanks for the feedback Thomas.
Please see my updated patch, I hope it better explains the scope of this
work.

Best regards,
Georgios

On Tue, Oct 6, 2020 at 1:25 AM Thomas Monjalon <thomas@monjalon.net> wrote:

> 05/10/2020 19:16, Georgios Katsikas:
> > Hi,
> >
> > What is the conclusion?
> > I haven't seen this patch being committed yet.
>
> You missed updating the file doc/guides/tools/flow-perf.rst
>
>
> > On Thu, Sep 24, 2020 at 3:01 PM Wisam Monther <wisamm@nvidia.com> wrote:
> > >From: Georgios Katsikas
> > > >
> > > >* One can now configure the number of rules per batch
>
> Please develop a bit more what was the previous behaviour
> and what you mean by "batch" in this context.
>
> > > >* Refactored flow_count variable to rules_count as it is related to
> the
> > > newly
> > > >added rules_batch variable
> > > >* Added default values to usage function
> > > >
> > > >Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
> > >
> > > Acked-by: Wisam Jaddo <wisamm@nvidia.com>
>
> Wisam, you should not ack if the doc is not updated.
> Otherwise you will have to complete the doc update yourself ;)
>
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-11-04  8:04   ` Wisam Monther
  2020-11-04 11:11     ` Georgios Katsikas
@ 2020-11-04 20:46     ` Thomas Monjalon
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2020-11-04 20:46 UTC (permalink / raw)
  To: Georgios Katsikas, Wisam Monther; +Cc: dev

04/11/2020 09:04, Wisam Monther:
> Hi,
> 
> You can add my ack:
> 
> Acked-by: Wisam Jaddo <wisamm@nvidia.com<mailto:wisamm@nvidia.com>>
> 
> Thomas,
> Do you have comments left here?

No comment, it looks very good.

Applied, thanks



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-11-04 11:11     ` Georgios Katsikas
@ 2020-11-04 11:25       ` Wisam Monther
  0 siblings, 0 replies; 11+ messages in thread
From: Wisam Monther @ 2020-11-04 11:25 UTC (permalink / raw)
  To: Georgios Katsikas; +Cc: wisamm, NBU-Contact-Thomas Monjalon, dev

I think Thomas can add it if he want to merge it in this version.

Moreover I think you need to keep the ack between versions and the person who acked before should comment if newer version not ok with him, otherwise he is ok with it. “Using git commit —amend”.

Thomas, correct me if I’m wrong, At least this how I understood the procedure here.

Moreover I noticed that you sending the versions as new patch all the time, but for history and comments tracking you should send with versions. V2-v3 ...etc with reply to older version of the patch.

BRs,
Wisam Jaddo

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Georgios Katsikas <katsikas.gp@gmail.com>
Sent: Wednesday, November 4, 2020 1:11:09 PM
To: Wisam Monther <wisamm@nvidia.com>
Cc: wisamm@mellanox.com <wisamm@mellanox.com>; NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH] app/flow-perf: configurable rule batches

Hi,

Is what you are asking possible with a simple git commit --amend?

Thanks,
Georgios

On Wed, Nov 4, 2020 at 10:04 AM Wisam Monther <wisamm@nvidia.com<mailto:wisamm@nvidia.com>> wrote:

Hi,



You can add my ack:

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



Thomas,

Do you have comments left here?



BRs,

Wisam Jaddo



From: Georgios Katsikas <katsikas.gp@gmail.com<mailto:katsikas.gp@gmail.com>>
Sent: Tuesday, November 3, 2020 1:26 PM
To: wisamm@mellanox.com<mailto:wisamm@mellanox.com>
Cc: dev@dpdk.org<mailto:dev@dpdk.org>
Subject: Re: [PATCH] app/flow-perf: configurable rule batches



Hi,



Any news on this patch?

Is there anything else I could do?



Thanks,

Georgios





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-11-04  8:04   ` Wisam Monther
@ 2020-11-04 11:11     ` Georgios Katsikas
  2020-11-04 11:25       ` Wisam Monther
  2020-11-04 20:46     ` Thomas Monjalon
  1 sibling, 1 reply; 11+ messages in thread
From: Georgios Katsikas @ 2020-11-04 11:11 UTC (permalink / raw)
  To: Wisam Monther; +Cc: wisamm, NBU-Contact-Thomas Monjalon, dev

Hi,

Is what you are asking possible with a simple git commit --amend?

Thanks,
Georgios

On Wed, Nov 4, 2020 at 10:04 AM Wisam Monther <wisamm@nvidia.com> wrote:

> Hi,
>
>
>
> You can add my ack:
>
> Acked-by: Wisam Jaddo <wisamm@nvidia.com>
>
>
>
> Thomas,
>
> Do you have comments left here?
>
>
>
> BRs,
>
> Wisam Jaddo
>
>
>
> *From:* Georgios Katsikas <katsikas.gp@gmail.com>
> *Sent:* Tuesday, November 3, 2020 1:26 PM
> *To:* wisamm@mellanox.com
> *Cc:* dev@dpdk.org
> *Subject:* Re: [PATCH] app/flow-perf: configurable rule batches
>
>
>
> Hi,
>
>
>
> Any news on this patch?
>
> Is there anything else I could do?
>
>
>
> Thanks,
>
> Georgios
>
>
>
>
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-11-03 11:26 ` Georgios Katsikas
@ 2020-11-04  8:04   ` Wisam Monther
  2020-11-04 11:11     ` Georgios Katsikas
  2020-11-04 20:46     ` Thomas Monjalon
  0 siblings, 2 replies; 11+ messages in thread
From: Wisam Monther @ 2020-11-04  8:04 UTC (permalink / raw)
  To: Georgios Katsikas, wisamm, NBU-Contact-Thomas Monjalon; +Cc: dev

Hi,

You can add my ack:

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

Thomas,
Do you have comments left here?

BRs,
Wisam Jaddo

From: Georgios Katsikas <katsikas.gp@gmail.com>
Sent: Tuesday, November 3, 2020 1:26 PM
To: wisamm@mellanox.com
Cc: dev@dpdk.org
Subject: Re: [PATCH] app/flow-perf: configurable rule batches

Hi,

Any news on this patch?
Is there anything else I could do?

Thanks,
Georgios



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
  2020-10-11 10:03 Georgios Katsikas
@ 2020-11-03 11:26 ` Georgios Katsikas
  2020-11-04  8:04   ` Wisam Monther
  0 siblings, 1 reply; 11+ messages in thread
From: Georgios Katsikas @ 2020-11-03 11:26 UTC (permalink / raw)
  To: wisamm; +Cc: dev

Hi,

Any news on this patch?
Is there anything else I could do?

Thanks,
Georgios

On Sun, Oct 11, 2020 at 1:03 PM Georgios Katsikas <katsikas.gp@gmail.com>
wrote:

> Currently, flow-perf measures the performance of
> rule installation/deletion operations by breaking
> down the entire number of operations into windows
> of fixed size (i.e., 100000 operations per window).
> Then, flow-perf measures the total time per window
> and computes an average time across all windows.
>
> This commit allows flow-perf users to configure
> the number of rules per window instead of using
> a fixed pre-compiled value. To do so, users must
> pass --rules-batch=N, where N is the number of
> rules per window (or batch).
> For consistency reasons, flow_count variable is
> now renamed to rules_count. This variable is the
> total number of rules to be installed/deleted.
>
> For example, if a user wants to measure how much
> time it takes to install 1M rules in a certain NIC,
> he/she can input:
> --rules-count=1000000
> This way flow-perf will break down 1M flow rules into
> 10 batches of 100k flow rules each (this is the default
> batch size) and compute an average across the 10
> measurements.
> Now, if the user modifies the number of rules per
> batch as follows:
> --rules-count=1000000 --rules-batch=500000
> then flow-perf will break down 1M flow rules into
> 2 batches of 500k flow rules each and compute the
> average across the 2 measurements.
>
> Finally, this commit also adds default variables
> to the usage function instead of hardcoded values.
>
> Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
> ---
>  app/test-flow-perf/main.c      | 86 ++++++++++++++++++++--------------
>  doc/guides/tools/flow-perf.rst | 42 ++++++++++++-----
>  2 files changed, 79 insertions(+), 49 deletions(-)
>
> diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
> index c420da6a5..4cdab2c93 100644
> --- a/app/test-flow-perf/main.c
> +++ b/app/test-flow-perf/main.c
> @@ -40,7 +40,8 @@
>
>  #define MAX_ITERATIONS             100
>  #define DEFAULT_RULES_COUNT    4000000
> -#define DEFAULT_ITERATION       100000
> +#define DEFAULT_RULES_BATCH     100000
> +#define DEFAULT_GROUP                0
>
>  struct rte_flow *flow;
>  static uint8_t flow_group;
> @@ -62,8 +63,8 @@ static bool enable_fwd;
>
>  static struct rte_mempool *mbuf_mp;
>  static uint32_t nb_lcores;
> -static uint32_t flows_count;
> -static uint32_t iterations_number;
> +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;
>
> @@ -98,8 +99,10 @@ usage(char *progname)
>  {
>         printf("\nusage: %s\n", progname);
>         printf("\nControl configurations:\n");
> -       printf("  --flows-count=N: to set the number of needed"
> -               " flows to insert, default is 4,000,000\n");
> +       printf("  --rules-count=N: to set the number of needed"
> +               " rules to insert, default is %d\n", DEFAULT_RULES_COUNT);
> +       printf("  --rules-batch=N: set number of batched rules,"
> +               " default is %d\n", DEFAULT_RULES_BATCH);
>         printf("  --dump-iterations: To print rates for each"
>                 " iteration\n");
>         printf("  --deletion-rate: Enable deletion rate"
> @@ -114,7 +117,7 @@ usage(char *progname)
>         printf("  --egress: set egress attribute in flows\n");
>         printf("  --transfer: set transfer attribute in flows\n");
>         printf("  --group=N: set group for all flows,"
> -               " default is 0\n");
> +               " default is %d\n", DEFAULT_GROUP);
>
>         printf("To set flow items:\n");
>         printf("  --ether: add ether layer in flow items\n");
> @@ -527,7 +530,8 @@ args_parse(int argc, char **argv)
>         static const struct option lgopts[] = {
>                 /* Control */
>                 { "help",                       0, 0, 0 },
> -               { "flows-count",                1, 0, 0 },
> +               { "rules-count",                1, 0, 0 },
> +               { "rules-batch",                1, 0, 0 },
>                 { "dump-iterations",            0, 0, 0 },
>                 { "deletion-rate",              0, 0, 0 },
>                 { "dump-socket-mem",            0, 0, 0 },
> @@ -705,16 +709,26 @@ args_parse(int argc, char **argv)
>                         }
>                         /* Control */
>                         if (strcmp(lgopts[opt_idx].name,
> -                                       "flows-count") == 0) {
> +                                       "rules-batch") == 0) {
>                                 n = atoi(optarg);
> -                               if (n > (int) iterations_number)
> -                                       flows_count = n;
> +                               if (n >= DEFAULT_RULES_BATCH)
> +                                       rules_batch = n;
>                                 else {
> -                                       printf("\n\nflows_count should be
> > %d\n",
> -                                               iterations_number);
> +                                       printf("\n\nrules_batch should be
> >= %d\n",
> +                                               DEFAULT_RULES_BATCH);
>                                         rte_exit(EXIT_SUCCESS, " ");
>                                 }
>                         }
> +                       if (strcmp(lgopts[opt_idx].name,
> +                                       "rules-count") == 0) {
> +                               n = atoi(optarg);
> +                               if (n >= (int) rules_batch)
> +                                       rules_count = n;
> +                               else {
> +                                       printf("\n\nrules_count should be
> >= %d\n",
> +                                               rules_batch);
> +                               }
> +                       }
>                         if (strcmp(lgopts[opt_idx].name,
>                                         "dump-iterations") == 0)
>                                 dump_iterations = true;
> @@ -826,13 +840,13 @@ destroy_flows(int port_id, struct rte_flow
> **flow_list)
>         for (i = 0; i < MAX_ITERATIONS; i++)
>                 cpu_time_per_iter[i] = -1;
>
> -       if (iterations_number > flows_count)
> -               iterations_number = flows_count;
> +       if (rules_batch > rules_count)
> +               rules_batch = rules_count;
>
>         /* Deletion Rate */
>         printf("Flows Deletion on port = %d\n", port_id);
>         start_iter = clock();
> -       for (i = 0; i < flows_count; i++) {
> +       for (i = 0; i < rules_count; i++) {
>                 if (flow_list[i] == 0)
>                         break;
>
> @@ -842,11 +856,11 @@ destroy_flows(int port_id, struct rte_flow
> **flow_list)
>                         rte_exit(EXIT_FAILURE, "Error in deleting flow");
>                 }
>
> -               if (i && !((i + 1) % iterations_number)) {
> +               if (i && !((i + 1) % rules_batch)) {
>                         /* Save the deletion rate of each iter */
>                         end_iter = clock();
>                         delta = (double) (end_iter - start_iter);
> -                       iter_id = ((i + 1) / iterations_number) - 1;
> +                       iter_id = ((i + 1) / rules_batch) - 1;
>                         cpu_time_per_iter[iter_id] =
>                                 delta / CLOCKS_PER_SEC;
>                         cpu_time_used += cpu_time_per_iter[iter_id];
> @@ -859,21 +873,21 @@ destroy_flows(int port_id, struct rte_flow
> **flow_list)
>                 for (i = 0; i < MAX_ITERATIONS; i++) {
>                         if (cpu_time_per_iter[i] == -1)
>                                 continue;
> -                       delta = (double)(iterations_number /
> +                       delta = (double)(rules_batch /
>                                 cpu_time_per_iter[i]);
>                         flows_rate = delta / 1000;
>                         printf(":: Iteration #%d: %d flows "
>                                 "in %f sec[ Rate = %f K/Sec ]\n",
> -                               i, iterations_number,
> +                               i, rules_batch,
>                                 cpu_time_per_iter[i], flows_rate);
>                 }
>
>         /* Deletion rate for all flows */
> -       flows_rate = ((double) (flows_count / cpu_time_used) / 1000);
> +       flows_rate = ((double) (rules_count / cpu_time_used) / 1000);
>         printf("\n:: Total flow deletion rate -> %f K/Sec\n",
>                 flows_rate);
>         printf(":: The time for deleting %d in flows %f seconds\n",
> -               flows_count, cpu_time_used);
> +               rules_count, cpu_time_used);
>  }
>
>  static inline void
> @@ -902,13 +916,13 @@ flows_handler(void)
>         for (i = 0; i < MAX_ITERATIONS; i++)
>                 cpu_time_per_iter[i] = -1;
>
> -       if (iterations_number > flows_count)
> -               iterations_number = flows_count;
> +       if (rules_batch > rules_count)
> +               rules_batch = rules_count;
>
> -       printf(":: Flows Count per port: %d\n", flows_count);
> +       printf(":: Flows Count per port: %d\n", rules_count);
>
>         flow_list = rte_zmalloc("flow_list",
> -               (sizeof(struct rte_flow *) * flows_count) + 1, 0);
> +               (sizeof(struct rte_flow *) * rules_count) + 1, 0);
>         if (flow_list == NULL)
>                 rte_exit(EXIT_FAILURE, "No Memory available!");
>
> @@ -941,7 +955,7 @@ flows_handler(void)
>                 /* Insertion Rate */
>                 printf("Flows insertion on port = %d\n", port_id);
>                 start_iter = clock();
> -               for (i = 0; i < flows_count; i++) {
> +               for (i = 0; i < rules_count; i++) {
>                         flow = generate_flow(port_id, flow_group,
>                                 flow_attrs, flow_items, flow_actions,
>                                 JUMP_ACTION_TABLE, i,
> @@ -950,7 +964,7 @@ flows_handler(void)
>                                 &error);
>
>                         if (force_quit)
> -                               i = flows_count;
> +                               i = rules_count;
>
>                         if (!flow) {
>                                 print_flow_error(error);
> @@ -959,11 +973,11 @@ flows_handler(void)
>
>                         flow_list[flow_index++] = flow;
>
> -                       if (i && !((i + 1) % iterations_number)) {
> +                       if (i && !((i + 1) % rules_batch)) {
>                                 /* Save the insertion rate of each iter */
>                                 end_iter = clock();
>                                 delta = (double) (end_iter - start_iter);
> -                               iter_id = ((i + 1) / iterations_number) -
> 1;
> +                               iter_id = ((i + 1) / rules_batch) - 1;
>                                 cpu_time_per_iter[iter_id] =
>                                         delta / CLOCKS_PER_SEC;
>                                 cpu_time_used +=
> cpu_time_per_iter[iter_id];
> @@ -976,21 +990,21 @@ flows_handler(void)
>                         for (i = 0; i < MAX_ITERATIONS; i++) {
>                                 if (cpu_time_per_iter[i] == -1)
>                                         continue;
> -                               delta = (double)(iterations_number /
> +                               delta = (double)(rules_batch /
>                                         cpu_time_per_iter[i]);
>                                 flows_rate = delta / 1000;
>                                 printf(":: Iteration #%d: %d flows "
>                                         "in %f sec[ Rate = %f K/Sec ]\n",
> -                                       i, iterations_number,
> +                                       i, rules_batch,
>                                         cpu_time_per_iter[i], flows_rate);
>                         }
>
>                 /* Insertion rate for all flows */
> -               flows_rate = ((double) (flows_count / cpu_time_used) /
> 1000);
> +               flows_rate = ((double) (rules_count / cpu_time_used) /
> 1000);
>                 printf("\n:: Total flow insertion rate -> %f K/Sec\n",
>                                                 flows_rate);
>                 printf(":: The time for creating %d in flows %f seconds\n",
> -                                               flows_count,
> cpu_time_used);
> +                                               rules_count,
> cpu_time_used);
>
>                 if (delete_flag)
>                         destroy_flows(port_id, flow_list);
> @@ -1415,11 +1429,11 @@ main(int argc, char **argv)
>
>         force_quit = false;
>         dump_iterations = false;
> -       flows_count = DEFAULT_RULES_COUNT;
> -       iterations_number = DEFAULT_ITERATION;
> +       rules_count = DEFAULT_RULES_COUNT;
> +       rules_batch = DEFAULT_RULES_BATCH;
>         delete_flag = false;
>         dump_socket_mem_flag = false;
> -       flow_group = 0;
> +       flow_group = DEFAULT_GROUP;
>
>         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 7e5dc0c54..018358ac1 100644
> --- a/doc/guides/tools/flow-perf.rst
> +++ b/doc/guides/tools/flow-perf.rst
> @@ -5,19 +5,25 @@ Flow Performance Tool
>  =====================
>
>  Application for rte_flow performance testing.
> -The application provide the ability to test insertion rate of specific
> -rte_flow rule, by stressing it to the NIC, and calculate the insertion
> -rate.
> +The application provides the ability to test insertion rate of specific
> +rte_flow rule, by stressing it to the NIC, and calculates the insertion
> +and deletion rates.
>
> -The application offers some options in the command line, to configure
> -which rule to apply.
> +The application allows to configure which rule to apply through several
> +options of the command line.
>
>  After that the application will start producing rules with same pattern
>  but increasing the outer IP source address by 1 each time, thus it will
>  give different flow each time, and all other items will have open masks.
>
> -The application also provide the ability to measure rte flow deletion
> rate,
> -in addition to memory consumption before and after the flows creation.
> +To assess the rule insertion rate, the flow performance tool breaks
> +down the entire number of flow rule operations into windows of fixed size
> +(defaults to 100000 flow rule operations per window, but can be
> configured).
> +Then, the flow performance tool measures the total time per window and
> +computes an average time across all windows.
> +
> +The application also provides the ability to measure rte flow deletion
> rate,
> +in addition to memory consumption before and after the flow rules'
> creation.
>
>  The app supports single and multi core performance measurements.
>
> @@ -59,21 +65,31 @@ with a ``--`` separator:
>
>  .. code-block:: console
>
> -       sudo ./dpdk-test-flow_perf -n 4 -w 08:00.0 -- --ingress --ether
> --ipv4 --queue --flows-count=1000000
> +       sudo ./dpdk-test-flow_perf -n 4 -w 08:00.0 -- --ingress --ether
> --ipv4 --queue --rules-count=1000000
>
>  The command line options are:
>
>  *      ``--help``
>         Display a help message and quit.
>
> -*      ``--flows-count=N``
> -       Set the number of needed flows to insert,
> -       where 1 <= N <= "number of flows".
> +*      ``--rules-count=N``
> +       Set the total number of flow rules to insert,
> +       where 1 <= N <= "number of flow rules".
>         The default value is 4,000,000.
>
> +*      ``--rules-batch=N``
> +       Set the number of flow rules to insert per iteration window,
> +       where 1 <= N <= "number of flow rules per iteration window".
> +       The default value is 100,000 flow rules per iteration window.
> +       For a total of --rules-count=1000000 flow rules to be inserted
> +       and an iteration window size of --rules-batch=100000 flow rules,
> +       the application will measure the insertion rate 10 times
> +       (i.e., once every 100000 flow rules) and then report an average
> +       insertion rate across the 10 measurements.
> +
>  *      ``--dump-iterations``
> -       Print rates for each iteration of flows.
> -       Default iteration is 1,00,000.
> +       Print rates for each iteration window.
> +       Default iteration window equals to the rules-batch size (i.e.,
> 100,000).
>
>  *      ``--deletion-rate``
>         Enable deletion rate calculations.
> --
> 2.17.1
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches
@ 2020-10-11 10:03 Georgios Katsikas
  2020-11-03 11:26 ` Georgios Katsikas
  0 siblings, 1 reply; 11+ messages in thread
From: Georgios Katsikas @ 2020-10-11 10:03 UTC (permalink / raw)
  To: wisamm; +Cc: dev, Georgios Katsikas

Currently, flow-perf measures the performance of
rule installation/deletion operations by breaking
down the entire number of operations into windows
of fixed size (i.e., 100000 operations per window).
Then, flow-perf measures the total time per window
and computes an average time across all windows.

This commit allows flow-perf users to configure
the number of rules per window instead of using
a fixed pre-compiled value. To do so, users must
pass --rules-batch=N, where N is the number of
rules per window (or batch).
For consistency reasons, flow_count variable is
now renamed to rules_count. This variable is the
total number of rules to be installed/deleted.

For example, if a user wants to measure how much
time it takes to install 1M rules in a certain NIC,
he/she can input:
--rules-count=1000000
This way flow-perf will break down 1M flow rules into
10 batches of 100k flow rules each (this is the default
batch size) and compute an average across the 10
measurements.
Now, if the user modifies the number of rules per
batch as follows:
--rules-count=1000000 --rules-batch=500000
then flow-perf will break down 1M flow rules into
2 batches of 500k flow rules each and compute the
average across the 2 measurements.

Finally, this commit also adds default variables
to the usage function instead of hardcoded values.

Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
---
 app/test-flow-perf/main.c      | 86 ++++++++++++++++++++--------------
 doc/guides/tools/flow-perf.rst | 42 ++++++++++++-----
 2 files changed, 79 insertions(+), 49 deletions(-)

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index c420da6a5..4cdab2c93 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -40,7 +40,8 @@
 
 #define MAX_ITERATIONS             100
 #define DEFAULT_RULES_COUNT    4000000
-#define DEFAULT_ITERATION       100000
+#define DEFAULT_RULES_BATCH     100000
+#define DEFAULT_GROUP                0
 
 struct rte_flow *flow;
 static uint8_t flow_group;
@@ -62,8 +63,8 @@ static bool enable_fwd;
 
 static struct rte_mempool *mbuf_mp;
 static uint32_t nb_lcores;
-static uint32_t flows_count;
-static uint32_t iterations_number;
+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;
 
@@ -98,8 +99,10 @@ usage(char *progname)
 {
 	printf("\nusage: %s\n", progname);
 	printf("\nControl configurations:\n");
-	printf("  --flows-count=N: to set the number of needed"
-		" flows to insert, default is 4,000,000\n");
+	printf("  --rules-count=N: to set the number of needed"
+		" rules to insert, default is %d\n", DEFAULT_RULES_COUNT);
+	printf("  --rules-batch=N: set number of batched rules,"
+		" default is %d\n", DEFAULT_RULES_BATCH);
 	printf("  --dump-iterations: To print rates for each"
 		" iteration\n");
 	printf("  --deletion-rate: Enable deletion rate"
@@ -114,7 +117,7 @@ usage(char *progname)
 	printf("  --egress: set egress attribute in flows\n");
 	printf("  --transfer: set transfer attribute in flows\n");
 	printf("  --group=N: set group for all flows,"
-		" default is 0\n");
+		" default is %d\n", DEFAULT_GROUP);
 
 	printf("To set flow items:\n");
 	printf("  --ether: add ether layer in flow items\n");
@@ -527,7 +530,8 @@ args_parse(int argc, char **argv)
 	static const struct option lgopts[] = {
 		/* Control */
 		{ "help",                       0, 0, 0 },
-		{ "flows-count",                1, 0, 0 },
+		{ "rules-count",                1, 0, 0 },
+		{ "rules-batch",                1, 0, 0 },
 		{ "dump-iterations",            0, 0, 0 },
 		{ "deletion-rate",              0, 0, 0 },
 		{ "dump-socket-mem",            0, 0, 0 },
@@ -705,16 +709,26 @@ args_parse(int argc, char **argv)
 			}
 			/* Control */
 			if (strcmp(lgopts[opt_idx].name,
-					"flows-count") == 0) {
+					"rules-batch") == 0) {
 				n = atoi(optarg);
-				if (n > (int) iterations_number)
-					flows_count = n;
+				if (n >= DEFAULT_RULES_BATCH)
+					rules_batch = n;
 				else {
-					printf("\n\nflows_count should be > %d\n",
-						iterations_number);
+					printf("\n\nrules_batch should be >= %d\n",
+						DEFAULT_RULES_BATCH);
 					rte_exit(EXIT_SUCCESS, " ");
 				}
 			}
+			if (strcmp(lgopts[opt_idx].name,
+					"rules-count") == 0) {
+				n = atoi(optarg);
+				if (n >= (int) rules_batch)
+					rules_count = n;
+				else {
+					printf("\n\nrules_count should be >= %d\n",
+						rules_batch);
+				}
+			}
 			if (strcmp(lgopts[opt_idx].name,
 					"dump-iterations") == 0)
 				dump_iterations = true;
@@ -826,13 +840,13 @@ destroy_flows(int port_id, struct rte_flow **flow_list)
 	for (i = 0; i < MAX_ITERATIONS; i++)
 		cpu_time_per_iter[i] = -1;
 
-	if (iterations_number > flows_count)
-		iterations_number = flows_count;
+	if (rules_batch > rules_count)
+		rules_batch = rules_count;
 
 	/* Deletion Rate */
 	printf("Flows Deletion on port = %d\n", port_id);
 	start_iter = clock();
-	for (i = 0; i < flows_count; i++) {
+	for (i = 0; i < rules_count; i++) {
 		if (flow_list[i] == 0)
 			break;
 
@@ -842,11 +856,11 @@ destroy_flows(int port_id, struct rte_flow **flow_list)
 			rte_exit(EXIT_FAILURE, "Error in deleting flow");
 		}
 
-		if (i && !((i + 1) % iterations_number)) {
+		if (i && !((i + 1) % rules_batch)) {
 			/* Save the deletion rate of each iter */
 			end_iter = clock();
 			delta = (double) (end_iter - start_iter);
-			iter_id = ((i + 1) / iterations_number) - 1;
+			iter_id = ((i + 1) / rules_batch) - 1;
 			cpu_time_per_iter[iter_id] =
 				delta / CLOCKS_PER_SEC;
 			cpu_time_used += cpu_time_per_iter[iter_id];
@@ -859,21 +873,21 @@ destroy_flows(int port_id, struct rte_flow **flow_list)
 		for (i = 0; i < MAX_ITERATIONS; i++) {
 			if (cpu_time_per_iter[i] == -1)
 				continue;
-			delta = (double)(iterations_number /
+			delta = (double)(rules_batch /
 				cpu_time_per_iter[i]);
 			flows_rate = delta / 1000;
 			printf(":: Iteration #%d: %d flows "
 				"in %f sec[ Rate = %f K/Sec ]\n",
-				i, iterations_number,
+				i, rules_batch,
 				cpu_time_per_iter[i], flows_rate);
 		}
 
 	/* Deletion rate for all flows */
-	flows_rate = ((double) (flows_count / cpu_time_used) / 1000);
+	flows_rate = ((double) (rules_count / cpu_time_used) / 1000);
 	printf("\n:: Total flow deletion rate -> %f K/Sec\n",
 		flows_rate);
 	printf(":: The time for deleting %d in flows %f seconds\n",
-		flows_count, cpu_time_used);
+		rules_count, cpu_time_used);
 }
 
 static inline void
@@ -902,13 +916,13 @@ flows_handler(void)
 	for (i = 0; i < MAX_ITERATIONS; i++)
 		cpu_time_per_iter[i] = -1;
 
-	if (iterations_number > flows_count)
-		iterations_number = flows_count;
+	if (rules_batch > rules_count)
+		rules_batch = rules_count;
 
-	printf(":: Flows Count per port: %d\n", flows_count);
+	printf(":: Flows Count per port: %d\n", rules_count);
 
 	flow_list = rte_zmalloc("flow_list",
-		(sizeof(struct rte_flow *) * flows_count) + 1, 0);
+		(sizeof(struct rte_flow *) * rules_count) + 1, 0);
 	if (flow_list == NULL)
 		rte_exit(EXIT_FAILURE, "No Memory available!");
 
@@ -941,7 +955,7 @@ flows_handler(void)
 		/* Insertion Rate */
 		printf("Flows insertion on port = %d\n", port_id);
 		start_iter = clock();
-		for (i = 0; i < flows_count; i++) {
+		for (i = 0; i < rules_count; i++) {
 			flow = generate_flow(port_id, flow_group,
 				flow_attrs, flow_items, flow_actions,
 				JUMP_ACTION_TABLE, i,
@@ -950,7 +964,7 @@ flows_handler(void)
 				&error);
 
 			if (force_quit)
-				i = flows_count;
+				i = rules_count;
 
 			if (!flow) {
 				print_flow_error(error);
@@ -959,11 +973,11 @@ flows_handler(void)
 
 			flow_list[flow_index++] = flow;
 
-			if (i && !((i + 1) % iterations_number)) {
+			if (i && !((i + 1) % rules_batch)) {
 				/* Save the insertion rate of each iter */
 				end_iter = clock();
 				delta = (double) (end_iter - start_iter);
-				iter_id = ((i + 1) / iterations_number) - 1;
+				iter_id = ((i + 1) / rules_batch) - 1;
 				cpu_time_per_iter[iter_id] =
 					delta / CLOCKS_PER_SEC;
 				cpu_time_used += cpu_time_per_iter[iter_id];
@@ -976,21 +990,21 @@ flows_handler(void)
 			for (i = 0; i < MAX_ITERATIONS; i++) {
 				if (cpu_time_per_iter[i] == -1)
 					continue;
-				delta = (double)(iterations_number /
+				delta = (double)(rules_batch /
 					cpu_time_per_iter[i]);
 				flows_rate = delta / 1000;
 				printf(":: Iteration #%d: %d flows "
 					"in %f sec[ Rate = %f K/Sec ]\n",
-					i, iterations_number,
+					i, rules_batch,
 					cpu_time_per_iter[i], flows_rate);
 			}
 
 		/* Insertion rate for all flows */
-		flows_rate = ((double) (flows_count / cpu_time_used) / 1000);
+		flows_rate = ((double) (rules_count / cpu_time_used) / 1000);
 		printf("\n:: Total flow insertion rate -> %f K/Sec\n",
 						flows_rate);
 		printf(":: The time for creating %d in flows %f seconds\n",
-						flows_count, cpu_time_used);
+						rules_count, cpu_time_used);
 
 		if (delete_flag)
 			destroy_flows(port_id, flow_list);
@@ -1415,11 +1429,11 @@ main(int argc, char **argv)
 
 	force_quit = false;
 	dump_iterations = false;
-	flows_count = DEFAULT_RULES_COUNT;
-	iterations_number = DEFAULT_ITERATION;
+	rules_count = DEFAULT_RULES_COUNT;
+	rules_batch = DEFAULT_RULES_BATCH;
 	delete_flag = false;
 	dump_socket_mem_flag = false;
-	flow_group = 0;
+	flow_group = DEFAULT_GROUP;
 
 	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 7e5dc0c54..018358ac1 100644
--- a/doc/guides/tools/flow-perf.rst
+++ b/doc/guides/tools/flow-perf.rst
@@ -5,19 +5,25 @@ Flow Performance Tool
 =====================
 
 Application for rte_flow performance testing.
-The application provide the ability to test insertion rate of specific
-rte_flow rule, by stressing it to the NIC, and calculate the insertion
-rate.
+The application provides the ability to test insertion rate of specific
+rte_flow rule, by stressing it to the NIC, and calculates the insertion
+and deletion rates.
 
-The application offers some options in the command line, to configure
-which rule to apply.
+The application allows to configure which rule to apply through several
+options of the command line.
 
 After that the application will start producing rules with same pattern
 but increasing the outer IP source address by 1 each time, thus it will
 give different flow each time, and all other items will have open masks.
 
-The application also provide the ability to measure rte flow deletion rate,
-in addition to memory consumption before and after the flows creation.
+To assess the rule insertion rate, the flow performance tool breaks
+down the entire number of flow rule operations into windows of fixed size
+(defaults to 100000 flow rule operations per window, but can be configured).
+Then, the flow performance tool measures the total time per window and
+computes an average time across all windows.
+
+The application also provides the ability to measure rte flow deletion rate,
+in addition to memory consumption before and after the flow rules' creation.
 
 The app supports single and multi core performance measurements.
 
@@ -59,21 +65,31 @@ with a ``--`` separator:
 
 .. code-block:: console
 
-	sudo ./dpdk-test-flow_perf -n 4 -w 08:00.0 -- --ingress --ether --ipv4 --queue --flows-count=1000000
+	sudo ./dpdk-test-flow_perf -n 4 -w 08:00.0 -- --ingress --ether --ipv4 --queue --rules-count=1000000
 
 The command line options are:
 
 *	``--help``
 	Display a help message and quit.
 
-*	``--flows-count=N``
-	Set the number of needed flows to insert,
-	where 1 <= N <= "number of flows".
+*	``--rules-count=N``
+	Set the total number of flow rules to insert,
+	where 1 <= N <= "number of flow rules".
 	The default value is 4,000,000.
 
+*	``--rules-batch=N``
+	Set the number of flow rules to insert per iteration window,
+	where 1 <= N <= "number of flow rules per iteration window".
+	The default value is 100,000 flow rules per iteration window.
+	For a total of --rules-count=1000000 flow rules to be inserted
+	and an iteration window size of --rules-batch=100000 flow rules,
+	the application will measure the insertion rate 10 times
+	(i.e., once every 100000 flow rules) and then report an average
+	insertion rate across the 10 measurements.
+
 *	``--dump-iterations``
-	Print rates for each iteration of flows.
-	Default iteration is 1,00,000.
+	Print rates for each iteration window.
+	Default iteration window equals to the rules-batch size (i.e., 100,000).
 
 *	``--deletion-rate``
 	Enable deletion rate calculations.
-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-11-04 20:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24  9:10 [dpdk-dev] [PATCH] app/flow-perf: configurable rule batches Georgios Katsikas
2020-09-24 12:01 ` Wisam Monther
2020-10-05 17:16   ` Georgios Katsikas
2020-10-05 22:25     ` Thomas Monjalon
2020-10-11 10:33       ` Georgios Katsikas
2020-10-11 10:03 Georgios Katsikas
2020-11-03 11:26 ` Georgios Katsikas
2020-11-04  8:04   ` Wisam Monther
2020-11-04 11:11     ` Georgios Katsikas
2020-11-04 11:25       ` Wisam Monther
2020-11-04 20:46     ` Thomas Monjalon

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