[dpdk-dev,v4,02/17] app/test: eventdev link all queues before start

Message ID 1489175012-101439-3-git-send-email-harry.van.haaren@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers

Checks

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

Commit Message

Van Haaren, Harry March 10, 2017, 7:43 p.m. UTC
  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.haaren@intel.com>
---
 app/test/test_eventdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Jerin Jacob March 20, 2017, 4:46 a.m. UTC | #1
On Fri, Mar 10, 2017 at 07:43:17PM +0000, Harry van Haaren wrote:
> 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.haaren@intel.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

> ---
>  app/test/test_eventdev.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
> index 042a446..324ef5a 100644
> --- a/app/test/test_eventdev.c
> +++ b/app/test/test_eventdev.c
> @@ -543,6 +543,10 @@ test_eventdev_start_stop(void)
>  		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
>  	}
>  
> +	ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
> +	TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
> +			"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);
>  
> @@ -569,6 +573,10 @@ eventdev_setup_device(void)
>  		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
>  	}
>  
> +	ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
> +	TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
> +			"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
>
  
Jerin Jacob March 23, 2017, 10:18 a.m. UTC | #2
On Mon, Mar 20, 2017 at 10:16:04AM +0530, Jerin Jacob wrote:
> On Fri, Mar 10, 2017 at 07:43:17PM +0000, Harry van Haaren wrote:
> > 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.haaren@intel.com>
> 
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied to dpdk-next-eventdev/master. Thanks.

> 
> > ---
> >  app/test/test_eventdev.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
> > index 042a446..324ef5a 100644
> > --- a/app/test/test_eventdev.c
> > +++ b/app/test/test_eventdev.c
> > @@ -543,6 +543,10 @@ test_eventdev_start_stop(void)
> >  		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
> >  	}
> >  
> > +	ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
> > +	TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
> > +			"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);
> >  
> > @@ -569,6 +573,10 @@ eventdev_setup_device(void)
> >  		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
> >  	}
> >  
> > +	ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
> > +	TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
> > +			"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
> >
  

Patch

diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index 042a446..324ef5a 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -543,6 +543,10 @@  test_eventdev_start_stop(void)
 		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
 	}
 
+	ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
+	TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
+			"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);
 
@@ -569,6 +573,10 @@  eventdev_setup_device(void)
 		TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
 	}
 
+	ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
+	TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
+			"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);