app/test-eventdev: wait for workers before cryptodev destroy

Message ID cafd91ddf913c856bd92f77a9c99dc1da35627db.1654170277.git.sthotton@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series app/test-eventdev: wait for workers before cryptodev destroy |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Shijith Thotton June 2, 2022, 11:45 a.m. UTC
  Destroying cryptodev resources before exiting workers are not safe.
Moved cryptodev destroy after worker thread exit in main thread.

Fixes: de2bc16e1bd1 ("app/eventdev: add crypto producer mode")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 app/test-eventdev/evt_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Pavan Nikhilesh Bhagavatula June 13, 2022, 6:38 a.m. UTC | #1
> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Thursday, June 2, 2022 5:15 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org; Pavan
> Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Subject: [PATCH] app/test-eventdev: wait for workers before cryptodev
> destroy
> 
> Destroying cryptodev resources before exiting workers are not safe.
> Moved cryptodev destroy after worker thread exit in main thread.
> 
> Fixes: de2bc16e1bd1 ("app/eventdev: add crypto producer mode")
> 
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>

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

> ---
>  app/test-eventdev/evt_main.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c
> index c5d63061bf..b785e603ee 100644
> --- a/app/test-eventdev/evt_main.c
> +++ b/app/test-eventdev/evt_main.c
> @@ -159,9 +159,6 @@ main(int argc, char **argv)
>  	if (test->ops.ethdev_rx_stop)
>  		test->ops.ethdev_rx_stop(test, &opt);
> 
> -	if (test->ops.cryptodev_destroy)
> -		test->ops.cryptodev_destroy(test, &opt);
> -
>  	rte_eal_mp_wait_lcore();
> 
>  	if (test->ops.test_result)
> @@ -173,6 +170,9 @@ main(int argc, char **argv)
>  	if (test->ops.eventdev_destroy)
>  		test->ops.eventdev_destroy(test, &opt);
> 
> +	if (test->ops.cryptodev_destroy)
> +		test->ops.cryptodev_destroy(test, &opt);
> +
>  	if (test->ops.mempool_destroy)
>  		test->ops.mempool_destroy(test, &opt);
> 
> --
> 2.25.1
  
Jerin Jacob June 13, 2022, 6:59 a.m. UTC | #2
On Mon, Jun 13, 2022 at 12:08 PM Pavan Nikhilesh Bhagavatula
<pbhagavatula@marvell.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Shijith Thotton <sthotton@marvell.com>
> > Sent: Thursday, June 2, 2022 5:15 PM
> > To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> > Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org; Pavan
> > Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> > Subject: [PATCH] app/test-eventdev: wait for workers before cryptodev
> > destroy
> >
> > Destroying cryptodev resources before exiting workers are not safe.
> > Moved cryptodev destroy after worker thread exit in main thread.
> >
> > Fixes: de2bc16e1bd1 ("app/eventdev: add crypto producer mode")

Cc: stable@dpdk.org

> >
> > Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

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


>
> > ---
> >  app/test-eventdev/evt_main.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c
> > index c5d63061bf..b785e603ee 100644
> > --- a/app/test-eventdev/evt_main.c
> > +++ b/app/test-eventdev/evt_main.c
> > @@ -159,9 +159,6 @@ main(int argc, char **argv)
> >       if (test->ops.ethdev_rx_stop)
> >               test->ops.ethdev_rx_stop(test, &opt);
> >
> > -     if (test->ops.cryptodev_destroy)
> > -             test->ops.cryptodev_destroy(test, &opt);
> > -
> >       rte_eal_mp_wait_lcore();
> >
> >       if (test->ops.test_result)
> > @@ -173,6 +170,9 @@ main(int argc, char **argv)
> >       if (test->ops.eventdev_destroy)
> >               test->ops.eventdev_destroy(test, &opt);
> >
> > +     if (test->ops.cryptodev_destroy)
> > +             test->ops.cryptodev_destroy(test, &opt);
> > +
> >       if (test->ops.mempool_destroy)
> >               test->ops.mempool_destroy(test, &opt);
> >
> > --
> > 2.25.1
>
  

Patch

diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c
index c5d63061bf..b785e603ee 100644
--- a/app/test-eventdev/evt_main.c
+++ b/app/test-eventdev/evt_main.c
@@ -159,9 +159,6 @@  main(int argc, char **argv)
 	if (test->ops.ethdev_rx_stop)
 		test->ops.ethdev_rx_stop(test, &opt);
 
-	if (test->ops.cryptodev_destroy)
-		test->ops.cryptodev_destroy(test, &opt);
-
 	rte_eal_mp_wait_lcore();
 
 	if (test->ops.test_result)
@@ -173,6 +170,9 @@  main(int argc, char **argv)
 	if (test->ops.eventdev_destroy)
 		test->ops.eventdev_destroy(test, &opt);
 
+	if (test->ops.cryptodev_destroy)
+		test->ops.cryptodev_destroy(test, &opt);
+
 	if (test->ops.mempool_destroy)
 		test->ops.mempool_destroy(test, &opt);