[v2] app/eventdev: use proper teardown sequence

Message ID 20180719114120.23750-1-pbhagavatula@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v2] app/eventdev: use proper teardown sequence |

Checks

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

Commit Message

Pavan Nikhilesh July 19, 2018, 11:41 a.m. UTC
  Use proper teardown sequence when SIGINT is caught to prevent
eventdev from going into undefined state.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 v2 Changes:
 - Only stopping the ethdev(producer) is sufficient.(Jerin)

 app/test-eventdev/evt_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.18.0
  

Patch

diff --git a/app/test-eventdev/evt_main.c b/app/test-eventdev/evt_main.c
index 57bb94570..18941f0ca 100644
--- a/app/test-eventdev/evt_main.c
+++ b/app/test-eventdev/evt_main.c
@@ -27,6 +27,9 @@  signal_handler(int signum)
 		*(int *)test->test_priv = true;
 		rte_wmb();

+		if (test->ops.ethdev_destroy)
+			test->ops.ethdev_destroy(test, &opt);
+
 		rte_eal_mp_wait_lcore();

 		if (test->ops.test_result)
@@ -35,9 +38,6 @@  signal_handler(int signum)
 		if (test->ops.eventdev_destroy)
 			test->ops.eventdev_destroy(test, &opt);

-		if (test->ops.ethdev_destroy)
-			test->ops.ethdev_destroy(test, &opt);
-
 		if (test->ops.mempool_destroy)
 			test->ops.mempool_destroy(test, &opt);