The software eventdev can lock-up if not all queues are
linked to a port. For this reason, the software evendev
fails to start if queues are not linked to anything.

This commit creates dummy links from all queues to port
0 in the eventdev setup function and start/stop test,
which would otherwise fail due to unlinked queues.

Signed-off-by: Harry van Haaren <harry.van.haa...@intel.com>
---
 app/test/test_eventdev.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index 756bc32..7d4160d 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -545,6 +545,14 @@ test_eventdev_start_stop(void)
                TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
        }
 
+       for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+               uint8_t queue = i;
+               uint8_t prio  = 0;
+               ret = rte_event_port_link(TEST_DEV_ID, 0, &queue, &prio, 1);
+               TEST_ASSERT(ret == 1, "Failed to link port, device %d",
+                           TEST_DEV_ID);
+       }
+
        ret = rte_event_dev_start(TEST_DEV_ID);
        TEST_ASSERT_SUCCESS(ret, "Failed to start device%d", TEST_DEV_ID);
 
@@ -571,6 +579,14 @@ eventdev_setup_device(void)
                TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
        }
 
+       for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+               uint8_t queue = i;
+               uint8_t prio  = 0;
+               ret = rte_event_port_link(TEST_DEV_ID, 0, &queue, &prio, 1);
+               TEST_ASSERT(ret == 1, "Failed to link port, device %d",
+                           TEST_DEV_ID);
+       }
+
        ret = rte_event_dev_start(TEST_DEV_ID);
        TEST_ASSERT_SUCCESS(ret, "Failed to start device%d", TEST_DEV_ID);
 
-- 
2.7.4

Reply via email to