test/eventdev: avoid configuring port or queue twice

Message ID 20231107163926.55825-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series test/eventdev: avoid configuring port or queue twice |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Bruce Richardson Nov. 7, 2023, 4:39 p.m. UTC
  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.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/test_eventdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Pavan Nikhilesh Bhagavatula Nov. 7, 2023, 5:35 p.m. UTC | #1
> 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.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

> ---
>  app/test/test_eventdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
> index 993e49af3b..71de947ce4 100644
> --- a/app/test/test_eventdev.c
> +++ b/app/test/test_eventdev.c
> @@ -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);
>  	}
> --
> 2.39.2
  
Jerin Jacob Nov. 10, 2023, 7:19 a.m. UTC | #2
On Wed, Nov 8, 2023 at 12:22 AM Pavan Nikhilesh Bhagavatula
<pbhagavatula@marvell.com> wrote:
>
>
> > 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.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>


Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-eventdev/for-main. Thanks
  

Patch

diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index 993e49af3b..71de947ce4 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -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);
 	}