[3/3] test/event_crypto_adapter: free resources during exit
diff mbox series

Message ID 20200908091534.24305-4-adwivedi@marvell.com
State Superseded
Delegated to: Jerin Jacob
Headers show
Series
  • Bug fixes in event crypto adapter test application
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Ankur Dwivedi Sept. 8, 2020, 9:15 a.m. UTC
The resources held by crypto adapter should be freed when the
test suite exits.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Patch
diff mbox series

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 811710219..fe85a61fb 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -896,6 +896,20 @@  testsuite_setup(void)
 	return TEST_SUCCESS;
 }
 
+static void
+crypto_adapter_teardown(void)
+{
+	int ret;
+
+	crypto_adapter_setup_done = 0;
+	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
+					TEST_CDEV_ID, TEST_CDEV_QP_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
+
+	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
+}
+
 static void
 crypto_teardown(void)
 {
@@ -938,6 +952,7 @@  eventdev_teardown(void)
 static void
 testsuite_teardown(void)
 {
+	crypto_adapter_teardown();
 	crypto_teardown();
 	eventdev_teardown();
 }