Skip to contentSkip to conversation

test/eventdev: avoid configuring port or queue twice

PATCH Applied Bruce Richardson 3 participants 3 messages Nov 7, 2023 – Nov 10, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/eventdev: avoid configuring port or queue twice

In the basic sanity tests of eventdev for queue and port setup, queue 0 was configured separately before running a loop to configure the rest of the queues. This loop started from 0, so reconfigured queue 0, and a similar reconfiguration happens with port 0 in the later port setup test. While most eventdevs should handle this reconfiguration without stop/start correctly, it can cause issues, and should be tested separately from basic config tests.

Therefore, adjust loops to start at 1 rather than 0 and avoid configuring queue 0 and port 0 twice.

---
 app/test/test_eventdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_eventdev.c +2 -2
index 993e49af3b..71de947ce4 100644
@@ -313,7 +313,7 @@ test_eventdev_queue_setup(void)
 			    RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
 			    "Queue count get failed");
 
-	for (i = 0; i < (int)queue_count; i++) {
+	for (i = 1; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL);
 		TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i);
 	}
@@ -786,7 +786,7 @@ test_eventdev_port_setup(void)
 				RTE_EVENT_DEV_ATTR_PORT_COUNT,
 				&port_count), "Port count get failed");
 
-	for (i = 0; i < (int)port_count; i++) {
+	for (i = 1; i < (int)port_count; i++) {
 		ret = rte_event_port_setup(TEST_DEV_ID, i, NULL);
 		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
 	}
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

In the basic sanity tests of eventdev for queue and port setup, queue 0 was configured separately before running a loop to configure the rest of the queues. This loop started from 0, so reconfigured queue 0, and a similar reconfiguration happens with port 0 in the later port setup test. While most eventdevs should handle this reconfiguration without stop/start correctly, it can cause issues, and should be tested separately from basic config tests.

Quoted 4 lines

Therefore, adjust loops to start at 1 rather than 0 and avoid configuring queue 0 and port 0 twice.

Quoted 29 lines
---
 app/test/test_eventdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test/test_eventdev.c +1 -1
index 993e49af3b..71de947ce4 100644
@@ -313,7 +313,7 @@ test_eventdev_queue_setup(void)
 			    RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
 &queue_count),
 			    "Queue count get failed");
 
-	for (i = 0; i < (int)queue_count; i++) {
+	for (i = 1; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL);
 		TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i);
app/test/test_eventdev.c +1 -2
 	}
@@ -786,7 +786,7 @@ test_eventdev_port_setup(void)
 				RTE_EVENT_DEV_ATTR_PORT_COUNT,
 				&port_count), "Port count get failed");
 
-	for (i = 0; i < (int)port_count; i++) {
+	for (i = 1; i < (int)port_count; i++) {
 		ret = rte_event_port_setup(TEST_DEV_ID, i, NULL);
 		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
 	}
--

2.39.2

Acked-by Applied
#2 lore raw
Quoted 10 lines · Pavan Nikhilesh Bhagavatula
Quoted 10 lines

In the basic sanity tests of eventdev for queue and port setup, queue 0 was configured separately before running a loop to configure the rest of the queues. This loop started from 0, so reconfigured queue 0, and a similar reconfiguration happens with port 0 in the later port setup test. While most eventdevs should handle this reconfiguration without stop/start correctly, it can cause issues, and should be tested separately from basic config tests.

Quoted 6 lines
Quoted 4 lines

Therefore, adjust loops to start at 1 rather than 0 and avoid configuring queue 0 and port 0 twice.

Applied to dpdk-next-eventdev/for-main. Thanks