DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@nvidia.com>
To: dev@dpdk.org
Cc: Ori Kam <orika@nvidia.com>, Thomas Monjalon <thomas@monjalon.net>,
	Ophir Munk <ophirmu@mellanox.com>
Subject: [dpdk-dev] [PATCH v3 5/6] app/regex: support performance measurements per QP
Date: Sun, 10 Jan 2021 11:10:22 +0000	[thread overview]
Message-ID: <20210110111023.9525-6-ophirmu@nvidia.com> (raw)
In-Reply-To: <20210110111023.9525-1-ophirmu@nvidia.com>

Up to this commit measuring the parsing elapsed time and Giga bits per
second performance was done on the aggregation of all QPs (per core).
This commit separates the time measurements per individual QP.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-regex/main.c | 34 +++++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/app/test-regex/main.c b/app/test-regex/main.c
index 2948d3e..2fce55d 100644
--- a/app/test-regex/main.c
+++ b/app/test-regex/main.c
@@ -48,6 +48,8 @@ struct qp_params {
 	struct rte_regex_ops **ops;
 	struct job_ctx *jobs_ctx;
 	char *buf;
+	time_t start;
+	time_t end;
 };
 
 struct qps_per_lcore {
@@ -324,8 +326,6 @@ run_regex(void *args)
 	unsigned long d_ind = 0;
 	struct rte_mbuf_ext_shared_info shinfo;
 	int res = 0;
-	time_t start;
-	time_t end;
 	double time;
 	struct rte_mempool *mbuf_mp;
 	struct qp_params *qp;
@@ -418,9 +418,10 @@ run_regex(void *args)
 
 		qp->buf = buf;
 		qp->total_matches = 0;
+		qp->start = 0;
+		qp->end = 0;
 	}
 
-	start = clock();
 	for (i = 0; i < nb_iterations; i++) {
 		for (qp_id = 0; qp_id < nb_qps; qp_id++) {
 			qp = &qps[qp_id];
@@ -431,6 +432,8 @@ run_regex(void *args)
 			update = false;
 			for (qp_id = 0; qp_id < nb_qps; qp_id++) {
 				qp = &qps[qp_id];
+				if (!qp->start)
+					qp->start = clock();
 				if (qp->total_dequeue < actual_jobs) {
 					struct rte_regex_ops **
 						cur_ops_to_enqueue = qp->ops +
@@ -461,22 +464,31 @@ run_regex(void *args)
 							qp->total_enqueue -
 							qp->total_dequeue);
 					update = true;
+				} else {
+					if (!qp->end)
+						qp->end = clock();
 				}
+
 			}
 		} while (update);
 	}
-	end = clock();
-	time = ((double)end - start) / CLOCKS_PER_SEC;
-	printf("Job len = %ld Bytes\n",  job_len);
-	printf("Time = %lf sec\n",  time);
-	printf("Perf = %lf Gbps\n",
-	       (((double)actual_jobs * job_len * nb_iterations * 8) / time) /
-		1000000000.0);
+	for (qp_id = 0; qp_id < nb_qps; qp_id++) {
+		qp = &qps[qp_id];
+		time = ((double)qp->end - qp->start) / CLOCKS_PER_SEC;
+		printf("Core=%u QP=%u\n", rte_lcore_id(), qp_id + qp_id_base);
+		printf("Job len = %ld Bytes\n",  job_len);
+		printf("Time = %lf sec\n",  time);
+		printf("Perf = %lf Gbps\n\n",
+				(((double)actual_jobs * job_len *
+				nb_iterations * 8) / time) /
+				1000000000.0);
+	}
 
 	if (rgxc->perf_mode)
 		goto end;
 	for (qp_id = 0; qp_id < nb_qps; qp_id++) {
-		printf("\n############ QP id=%u ############\n", qp_id);
+		printf("\n############ Core=%u QP=%u ############\n",
+		       rte_lcore_id(), qp_id + qp_id_base);
 		qp = &qps[qp_id];
 		/* Log results per job. */
 		for (d_ind = 0; d_ind < qp->total_dequeue; d_ind++) {
-- 
2.8.4


  parent reply	other threads:[~2021-01-10 11:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 16:49 [dpdk-dev] [PATCH v1 0/6] regex multi Q with multi cores support Ophir Munk
2020-12-16 16:49 ` [dpdk-dev] [PATCH v1 1/6] app/regex: move mem pool creation to worker routine Ophir Munk
2020-12-20 10:41   ` [dpdk-dev] [PATCH v2 0/6] regex multi Q with multi cores support Ophir Munk
2020-12-20 10:41     ` [dpdk-dev] [PATCH v2 1/6] app/regex: move mem pool creation to worker routine Ophir Munk
2021-01-10 11:10       ` [dpdk-dev] [PATCH v3 0/6] regex multi Q with multi cores support Ophir Munk
2021-01-10 11:10         ` [dpdk-dev] [PATCH v3 1/6] app/regex: move mem pool creation to worker routine Ophir Munk
2021-01-10 11:10         ` [dpdk-dev] [PATCH v3 2/6] app/regex: support multi QPs Ophir Munk
2021-01-10 11:10         ` [dpdk-dev] [PATCH v3 3/6] app/regex: read data file once at startup Ophir Munk
2021-01-10 11:10         ` [dpdk-dev] [PATCH v3 4/6] app/regex: support multi cores Ophir Munk
2021-01-10 11:10         ` Ophir Munk [this message]
2021-01-10 11:10         ` [dpdk-dev] [PATCH v3 6/6] app/regex: replace Linux clock() API with rdtsc Ophir Munk
2021-01-12 23:05         ` [dpdk-dev] [PATCH v3 0/6] regex multi Q with multi cores support Thomas Monjalon
2020-12-20 10:41     ` [dpdk-dev] [PATCH v2 2/6] app/regex: support multi QPs Ophir Munk
2020-12-20 10:41     ` [dpdk-dev] [PATCH v2 3/6] app/regex: read data file once at startup Ophir Munk
2020-12-20 10:41     ` [dpdk-dev] [PATCH v2 4/6] app/regex: support multi cores Ophir Munk
2020-12-20 10:41     ` [dpdk-dev] [PATCH v2 5/6] app/regex: support performance measurements per QP Ophir Munk
2021-01-08  9:08       ` Thomas Monjalon
2021-01-10 11:16         ` Ophir Munk
2021-01-10 22:55           ` Thomas Monjalon
2021-01-11 19:07             ` David Christensen
2020-12-20 10:41     ` [dpdk-dev] [PATCH v2 6/6] app/regex: replace Linux clock() API with rdtsc Ophir Munk
2021-01-04 14:01     ` [dpdk-dev] [PATCH v2 0/6] regex multi Q with multi cores support Ori Kam
2020-12-16 16:49 ` [dpdk-dev] [PATCH v1 2/6] app/regex: support multi QPs Ophir Munk
2020-12-16 16:49 ` [dpdk-dev] [PATCH v1 3/6] app/regex: read data file once at startup Ophir Munk
2020-12-16 16:49 ` [dpdk-dev] [PATCH v1 4/6] app/regex: support multi cores Ophir Munk
2020-12-16 16:49 ` [dpdk-dev] [PATCH v1 5/6] app/regex: support performance measurements per QP Ophir Munk
2020-12-16 16:49 ` [dpdk-dev] [PATCH v1 6/6] app/regex: replace Linux clock() API with rdtsc Ophir Munk
2020-12-17 11:52 ` [dpdk-dev] [PATCH v1 0/6] regex multi Q with multi cores support Ori Kam

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=20210110111023.9525-6-ophirmu@nvidia.com \
    --to=ophirmu@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=ophirmu@mellanox.com \
    --cc=orika@nvidia.com \
    --cc=thomas@monjalon.net \
    /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).