[dpdk-dev] [PATCH v6 01/14] app/eventdev: add packet distribution logs

Pavan Nikhilesh pbhagavatula at caviumnetworks.com
Tue Jan 16 16:39:50 CET 2018


Add logs for packet distribution across worker cores to be printed
along with the test results.

Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
---

 v6 Changes:
 - Missed retaining acks when sending previous patchset.

 v5 Changes:
 - Split generic and lockfree diagrams for pipeline queue and atq in
   documentation.
 - Update release notes.

 v4 Changes:
 - remove Tx queue locking by using Tx service ml discussion :
   http://dpdk.org/ml/archives/dev/2018-January/086730.html

 v3 Changes:
 - Add SPDX licence tags
 - Redo atq test

 app/test-eventdev/evt_main.c         |  3 +++
 app/test-eventdev/test_perf_common.c | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c
index 3c27f3216..57bb94570 100644
--- a/app/test-eventdev/evt_main.c
+++ b/app/test-eventdev/evt_main.c
@@ -29,6 +29,9 @@ signal_handler(int signum)

 		rte_eal_mp_wait_lcore();

+		if (test->ops.test_result)
+			test->ops.test_result(test, &opt);
+
 		if (test->ops.eventdev_destroy)
 			test->ops.eventdev_destroy(test, &opt);

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index e82cc9301..e279d81a5 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -8,8 +8,20 @@ int
 perf_test_result(struct evt_test *test, struct evt_options *opt)
 {
 	RTE_SET_USED(opt);
+	int i;
+	uint64_t total = 0;
 	struct test_perf *t = evt_test_priv(test);

+	printf("Packet distribution across worker cores :\n");
+	for (i = 0; i < t->nb_workers; i++)
+		total += t->worker[i].processed_pkts;
+	for (i = 0; i < t->nb_workers; i++)
+		printf("Worker %d packets: "CLGRN"%"PRIx64" "CLNRM"percentage:"
+				CLGRN" %3.2f\n"CLNRM, i,
+				t->worker[i].processed_pkts,
+				(((double)t->worker[i].processed_pkts)/total)
+				* 100);
+
 	return t->result;
 }

--
2.14.1



More information about the dev mailing list