diff mbox series

[API-NEXT,v1,1/1] validation: pktio: test per queue pktin configuration

Message ID 1535018407-21420-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/1] validation: pktio: test per queue pktin configuration | expand

Commit Message

Github ODP bot Aug. 23, 2018, 10 a.m. UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 679 (bogdanPricope:api_next_pktin_queue_validation_pr)
 ** https://github.com/Linaro/odp/pull/679
 ** Patch: https://github.com/Linaro/odp/pull/679.patch
 ** Base sha: d42ef2c5a01d29a9877e0b487694f66e40c43624
 ** Merge commit sha: 2de86f4656e3c680bef6a36446cd23ba9258de80
 **/
 test/validation/api/pktio/pktio.c | 37 +++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
diff mbox series

Patch

diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c
index 09367d4ea..04232f84f 100644
--- a/test/validation/api/pktio/pktio.c
+++ b/test/validation/api/pktio/pktio.c
@@ -1391,6 +1391,42 @@  static void pktio_test_pktin_queue_config_sched(void)
 	CU_ASSERT_FATAL(odp_pktio_close(pktio) == 0);
 }
 
+static void pktio_test_pktin_queue_config_multi_sched(void)
+{
+	odp_pktio_t pktio;
+	odp_pktio_capability_t capa;
+	odp_pktin_queue_param_t queue_param;
+	odp_queue_t in_queues[MAX_QUEUES];
+	odp_pktin_queue_param_ovr_t queue_param_ovr[MAX_QUEUES];
+	int num_queues, i;
+
+	pktio = create_pktio(0, ODP_PKTIN_MODE_SCHED, ODP_PKTOUT_MODE_DIRECT);
+	CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID);
+
+	CU_ASSERT_FATAL(odp_pktio_capability(pktio, &capa) == 0 &&
+			capa.max_input_queues > 0);
+	num_queues = (capa.max_input_queues < MAX_QUEUES) ?
+		capa.max_input_queues : MAX_QUEUES;
+
+	odp_pktin_queue_param_init(&queue_param);
+
+	queue_param.hash_enable = 0;
+	queue_param.num_queues = num_queues;
+	queue_param.queue_param.sched.group = ODP_SCHED_GROUP_ALL;
+	queue_param.queue_param.sched.sync = ODP_SCHED_SYNC_ATOMIC;
+
+	for (i = 0; i < num_queues; i++)
+		queue_param_ovr[i].group = ODP_SCHED_GROUP_ALL;
+	queue_param.queue_param_ovr = queue_param_ovr;
+
+	CU_ASSERT_FATAL(odp_pktin_queue_config(pktio, &queue_param) == 0);
+
+	CU_ASSERT(odp_pktin_event_queue(pktio, in_queues, MAX_QUEUES)
+		  == num_queues);
+
+	CU_ASSERT_FATAL(odp_pktio_close(pktio) == 0);
+}
+
 static void pktio_test_pktin_queue_config_queue(void)
 {
 	odp_pktio_t pktio;
@@ -2446,6 +2482,7 @@  odp_testinfo_t pktio_suite_unsegmented[] = {
 	ODP_TEST_INFO(pktio_test_info),
 	ODP_TEST_INFO(pktio_test_pktin_queue_config_direct),
 	ODP_TEST_INFO(pktio_test_pktin_queue_config_sched),
+	ODP_TEST_INFO(pktio_test_pktin_queue_config_multi_sched),
 	ODP_TEST_INFO(pktio_test_pktin_queue_config_queue),
 	ODP_TEST_INFO(pktio_test_pktout_queue_config),
 	ODP_TEST_INFO(pktio_test_plain_queue),