[dpdk-dev,36/39] app/test: octeontx queue and flow based max stage pipeline

Message ID 1488562101-6658-37-git-send-email-jerin.jacob@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jerin Jacob March 3, 2017, 5:28 p.m. UTC
  Add queue and flow based pipeline test with maximum number of
stages available in the device.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test/test_eventdev_octeontx.c | 41 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
  

Comments

Van Haaren, Harry March 23, 2017, 12:09 p.m. UTC | #1
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Friday, March 3, 2017 5:28 PM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Richardson, Bruce <bruce.richardson@intel.com>; Van Haaren,
> Harry <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com; Eads, Gage <gage.eads@intel.com>;
> nipun.gupta@nxp.com; santosh.shukla@caviumnetworks.com; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 36/39] app/test: octeontx queue and flow based max stage pipeline
> 
> Add queue and flow based pipeline test with maximum number of
> stages available in the device.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
  

Patch

diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c
index f477bf2..1afb52e 100644
--- a/app/test/test_eventdev_octeontx.c
+++ b/app/test/test_eventdev_octeontx.c
@@ -1208,6 +1208,45 @@  test_multi_port_queue_max_stages_random_sched_type(void)
 	return launch_multi_port_max_stages_random_sched_type(
 		worker_queue_based_pipeline_max_stages_rand_sched_type);
 }
+
+static int
+worker_mixed_pipeline_max_stages_rand_sched_type(void *arg)
+{
+	struct test_core_param *param = arg;
+	struct rte_event ev;
+	uint16_t valid_event;
+	uint8_t port = param->port;
+	uint8_t nr_queues = rte_event_queue_count(evdev);
+	rte_atomic32_t *total_events = param->total_events;
+
+	while (rte_atomic32_read(total_events) > 0) {
+		valid_event = rte_event_dequeue_burst(evdev, port, &ev, 1, 0);
+		if (!valid_event)
+			continue;
+
+		if (ev.queue_id == nr_queues - 1) { /* Last stage */
+			rte_pktmbuf_free(ev.mbuf);
+			rte_atomic32_sub(total_events, 1);
+		} else {
+			ev.event_type = RTE_EVENT_TYPE_CPU;
+			ev.queue_id++;
+			ev.sub_event_type = rte_rand() % 256;
+			ev.sched_type =
+				rte_rand() % (RTE_SCHED_TYPE_PARALLEL + 1);
+			ev.op = RTE_EVENT_OP_FORWARD;
+			rte_event_enqueue_burst(evdev, port, &ev, 1);
+		}
+	}
+	return 0;
+}
+
+/* Queue and flow based pipeline with maximum stages with random sched type */
+static int
+test_multi_port_mixed_max_stages_random_sched_type(void)
+{
+	return launch_multi_port_max_stages_random_sched_type(
+		worker_mixed_pipeline_max_stages_rand_sched_type);
+}
 static struct unit_test_suite eventdev_octeontx_testsuite  = {
 	.suite_name = "eventdev octeontx unit test suite",
 	.setup = testsuite_setup,
@@ -1269,6 +1308,8 @@  static struct unit_test_suite eventdev_octeontx_testsuite  = {
 			test_multi_port_flow_max_stages_random_sched_type),
 		TEST_CASE_ST(eventdev_setup, eventdev_teardown,
 			test_multi_port_queue_max_stages_random_sched_type),
+		TEST_CASE_ST(eventdev_setup, eventdev_teardown,
+			test_multi_port_mixed_max_stages_random_sched_type),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };