DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/ipsec: fix test suite setup function
@ 2019-01-15 11:19 Bernard Iremonger
  2019-01-15 11:55 ` Ananyev, Konstantin
  2019-01-17 10:15 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
  0 siblings, 2 replies; 14+ messages in thread
From: Bernard Iremonger @ 2019-01-15 11:19 UTC (permalink / raw)
  To: dev, konstantin.ananyev; +Cc: Bernard Iremonger

Check for valid crypto_null devices before continuing.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 test/test/test_ipsec.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/test/test/test_ipsec.c b/test/test/test_ipsec.c
index ff1a1c4..4dfc55b 100644
--- a/test/test/test_ipsec.c
+++ b/test/test/test_ipsec.c
@@ -46,6 +46,8 @@
 #define BURST_SIZE		32
 #define REORDER_PKTS	1
 
+static int gbl_driver_id;
+
 struct user_params {
 	enum rte_crypto_sym_xform_type auth;
 	enum rte_crypto_sym_xform_type cipher;
@@ -218,7 +220,7 @@ testsuite_setup(void)
 {
 	struct ipsec_testsuite_params *ts_params = &testsuite_params;
 	struct rte_cryptodev_info info;
-	uint32_t nb_devs, dev_id;
+	uint32_t i, nb_devs, dev_id;
 	size_t sess_sz;
 
 	memset(ts_params, 0, sizeof(*ts_params));
@@ -251,7 +253,18 @@ testsuite_setup(void)
 		return TEST_FAILED;
 	}
 
-	ts_params->valid_devs[ts_params->valid_dev_count++] = 0;
+	gbl_driver_id = rte_cryptodev_driver_id_get(
+				RTE_STR(CRYPTODEV_NAME_NULL_PMD));
+
+	/* Create list of valid crypto devs */
+	for (i = 0; i < nb_devs; i++) {
+		rte_cryptodev_info_get(i, &info);
+		if (info.driver_id == gbl_driver_id)
+			ts_params->valid_devs[ts_params->valid_dev_count++] = i;
+	}
+
+	if (ts_params->valid_dev_count < 1)
+		return TEST_FAILED;
 
 	/* Set up all the qps on the first of the valid devices found */
 	dev_id = ts_params->valid_devs[0];
-- 
2.7.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-01-17 23:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 11:19 [dpdk-dev] [PATCH] test/ipsec: fix test suite setup function Bernard Iremonger
2019-01-15 11:55 ` Ananyev, Konstantin
2019-01-15 12:34   ` Iremonger, Bernard
2019-01-15 12:49     ` Ananyev, Konstantin
2019-01-17 10:04       ` Iremonger, Bernard
2019-01-17 10:30         ` Ananyev, Konstantin
2019-01-17 11:12           ` Iremonger, Bernard
2019-01-17 10:15 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
2019-01-17 10:34   ` Ananyev, Konstantin
2019-01-17 11:20     ` Iremonger, Bernard
2019-01-17 15:35       ` Iremonger, Bernard
2019-01-17 16:03   ` [dpdk-dev] [PATCH v3] " Bernard Iremonger
2019-01-17 17:05     ` Ananyev, Konstantin
2019-01-17 23:30       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).