Skip to contentSkip to conversation

test/crypto: close PMD after tests

PATCH Superseded Adam Dybkowski 3 participants 10 messages Mar 1, 2021 – Apr 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 test/crypto: close PMD after tests

This patch adds closing of the PMD after running the tests.

---
 app/test/test_cryptodev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
app/test/test_cryptodev.c +2 -1
index f91debc16..7dcd255de 100644
@@ -976,8 +976,9 @@ ut_teardown(void)
 
 	rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats);
 
-	/* Stop the device */
+	/* Stop and close the device */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
+	rte_cryptodev_close(ts_params->valid_devs[0]);
 }
 
 static int
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 2/2 app/crypto-perf: close PMD after benchmark run

This patch adds closing of the PMD after running the benchmark.

---
 app/test-crypto-perf/main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
app/test-crypto-perf/main.c +6 -2
index 49af812d8..c1d338fa4 100644
@@ -738,8 +738,10 @@ main(int argc, char **argv)
 	}
 
 	for (i = 0; i < nb_cryptodevs &&
-			i < RTE_CRYPTO_MAX_DEVS; i++)
+			i < RTE_CRYPTO_MAX_DEVS; i++) {
 		rte_cryptodev_stop(enabled_cdevs[i]);
+		rte_cryptodev_close(enabled_cdevs[i]);
+	}
 
 	free_test_vector(t_vec, &opts);
 
@@ -758,8 +760,10 @@ main(int argc, char **argv)
 	}
 
 	for (i = 0; i < nb_cryptodevs &&
-			i < RTE_CRYPTO_MAX_DEVS; i++)
+			i < RTE_CRYPTO_MAX_DEVS; i++) {
 		rte_cryptodev_stop(enabled_cdevs[i]);
+		rte_cryptodev_close(enabled_cdevs[i]);
+	}
 	rte_free(opts.imix_buffer_sizes);
 	free_test_vector(t_vec, &opts);
 
Signature · 1 line
2.25.1
#2 lore raw

v2 cover test/crypto: close PMD after tests

In reply to Adam Dybkowski

This patch adds closing of the PMD after running the tests.

--
v2:
* display error message on close error

Adam Dybkowski (2):
test/crypto: close PMD after tests
app/crypto-perf: close PMD after benchmark run

 app/test-crypto-perf/main.c | 15 +++++++++++++--
 app/test/test_cryptodev.c   |  6 +++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
#3 lore raw

PATCH v2 1/2 test/crypto: close PMD after tests

This patch adds closing of the PMD after running the tests.

---
 app/test/test_cryptodev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
app/test/test_cryptodev.c +5 -1
index f91debc16..ea965a64a 100644
@@ -928,6 +928,7 @@ ut_teardown(void)
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
 	struct rte_cryptodev_stats stats;
+	int res;
 
 	/* free crypto session structure */
 #ifdef RTE_LIB_SECURITY
@@ -976,8 +977,11 @@ ut_teardown(void)
 
 	rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats);
 
-	/* Stop the device */
+	/* Stop and close the device */
 	rte_cryptodev_stop(ts_params->valid_devs[0]);
+	res = rte_cryptodev_close(ts_params->valid_devs[0]);
+	if (res)
+		RTE_LOG(ERR, USER1, "Crypto device close error %d\n", res);
 }
 
 static int
Signature · 1 line
2.25.1
#4 lore raw

PATCH v2 2/2 app/crypto-perf: close PMD after benchmark run

In reply to Adam Dybkowski

This patch adds closing of the PMD after running the benchmark.

---
 app/test-crypto-perf/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
app/test-crypto-perf/main.c +13 -2
index 49af812d8..70cb04a21 100644
@@ -738,8 +738,13 @@ main(int argc, char **argv)
 	}
 
 	for (i = 0; i < nb_cryptodevs &&
-			i < RTE_CRYPTO_MAX_DEVS; i++)
+			i < RTE_CRYPTO_MAX_DEVS; i++) {
 		rte_cryptodev_stop(enabled_cdevs[i]);
+		ret = rte_cryptodev_close(enabled_cdevs[i]);
+		if (ret)
+			RTE_LOG(ERR, USER1,
+					"Crypto device close error %d\n", ret);
+	}
 
 	free_test_vector(t_vec, &opts);
 
@@ -758,8 +763,14 @@ main(int argc, char **argv)
 	}
 
 	for (i = 0; i < nb_cryptodevs &&
-			i < RTE_CRYPTO_MAX_DEVS; i++)
+			i < RTE_CRYPTO_MAX_DEVS; i++) {
 		rte_cryptodev_stop(enabled_cdevs[i]);
+		ret = rte_cryptodev_close(enabled_cdevs[i]);
+		if (ret)
+			RTE_LOG(ERR, USER1,
+					"Crypto device close error %d\n", ret);
+
+	}
 	rte_free(opts.imix_buffer_sizes);
 	free_test_vector(t_vec, &opts);
 
Signature · 1 line
2.25.1
#5 lore raw
In reply to Adam Dybkowski
Quoted 21 lines

-----Original Message-----
From: Dybkowski, AdamX <[email protected]>
Sent: Monday, March 8, 2021 1:57 PM
To: [email protected]; Doherty, Declan <[email protected]>; Kusztal, ArkadiuszX <[email protected]>
Cc: Dybkowski, AdamX <[email protected]>
Subject: [PATCH v2 0/2] test/crypto: close PMD after tests

This patch adds closing of the PMD after running the tests.

--
v2:
* display error message on close error

Adam Dybkowski (2):
test/crypto: close PMD after tests app/crypto-perf: close PMD after benchmark run

Quoted 6 lines
 app/test-crypto-perf/main.c | 15 +++++++++++++--
 app/test/test_cryptodev.c   |  6 +++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

--
2.25.1

Series Acked-by: Arek Kusztal <[email protected]>

#6 lore raw

v3 cover test/crypto: close PMD after tests

In reply to Adam Dybkowski

This patch adds closing of the PMD after running the tests.

--
v3:
* move the call from ut_teardown to testsuite_teardown v2:
* display error message on close error

Adam Dybkowski (2):
test/crypto: close PMD after tests
app/crypto-perf: close PMD after benchmark run

 app/test-crypto-perf/main.c | 15 +++++++++++++--
 app/test/test_cryptodev.c   |  5 +++++
 2 files changed, 18 insertions(+), 2 deletions(-)
Signature · 1 line
2.25.1
#7 lore raw

PATCH v3 1/2 test/crypto: close PMD after tests

This patch adds closing of the PMD after running the tests.

---
 app/test/test_cryptodev.c | 5 +++++
 1 file changed, 5 insertions(+)
app/test/test_cryptodev.c +5 -0
index f91debc168..d68855c442 100644
@@ -842,6 +842,7 @@ static void
 testsuite_teardown(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int res;
 
 	if (ts_params->mbuf_pool != NULL) {
 		RTE_LOG(DEBUG, USER1, "CRYPTO_MBUFPOOL count %u\n",
@@ -863,6 +864,10 @@ testsuite_teardown(void)
 		rte_mempool_free(ts_params->session_mpool);
 		ts_params->session_mpool = NULL;
 	}
+
+	res = rte_cryptodev_close(ts_params->valid_devs[0]);
+	if (res)
+		RTE_LOG(ERR, USER1, "Crypto device close error %d\n", res);
 }
 
 static int
Signature · 1 line
2.25.1
#8 lore raw

PATCH v3 2/2 app/crypto-perf: close PMD after benchmark run

In reply to Adam Dybkowski

This patch adds closing of the PMD after running the benchmark.

---
 app/test-crypto-perf/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
app/test-crypto-perf/main.c +13 -2
index 49af812d8b..70cb04a214 100644
@@ -738,8 +738,13 @@ main(int argc, char **argv)
 	}
 
 	for (i = 0; i < nb_cryptodevs &&
-			i < RTE_CRYPTO_MAX_DEVS; i++)
+			i < RTE_CRYPTO_MAX_DEVS; i++) {
 		rte_cryptodev_stop(enabled_cdevs[i]);
+		ret = rte_cryptodev_close(enabled_cdevs[i]);
+		if (ret)
+			RTE_LOG(ERR, USER1,
+					"Crypto device close error %d\n", ret);
+	}
 
 	free_test_vector(t_vec, &opts);
 
@@ -758,8 +763,14 @@ main(int argc, char **argv)
 	}
 
 	for (i = 0; i < nb_cryptodevs &&
-			i < RTE_CRYPTO_MAX_DEVS; i++)
+			i < RTE_CRYPTO_MAX_DEVS; i++) {
 		rte_cryptodev_stop(enabled_cdevs[i]);
+		ret = rte_cryptodev_close(enabled_cdevs[i]);
+		if (ret)
+			RTE_LOG(ERR, USER1,
+					"Crypto device close error %d\n", ret);
+
+	}
 	rte_free(opts.imix_buffer_sizes);
 	free_test_vector(t_vec, &opts);
 
Signature · 1 line
2.25.1