From: Fiona Trahe <fiona.trahe@intel.com (fiona.trahe@intel.com)>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com
Subject: [dpdk-dev] [PATCH] app/test: improve error message in crypto test code
Date: Fri, 16 Sep 2016 13:01:29 +0100 [thread overview]
Message-ID: <1474027289-4162-1-git-send-email-fiona.trahe@intel.com> (raw)
From: Fiona Trahe <fiona.trahe@intel.com>
Improve error message if crypto PMD build is not enabled in config file
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
app/test/test_cryptodev.c | 37 +++++++++++++++++++++++++++++++++++++
app/test/test_cryptodev_perf.c | 23 +++++++++++++++++++++++
2 files changed, 60 insertions(+)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index f17c84c..c30a421 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -189,6 +189,11 @@ testsuite_setup(void)
/* Create 2 AESNI MB devices if required */
if (gbl_cryptodev_type == RTE_CRYPTODEV_AESNI_MB_PMD) {
+#ifndef RTE_LIBRTE_PMD_AESNI_MB
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_AESNI_MB must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(
RTE_CRYPTODEV_AESNI_MB_PMD);
if (nb_devs < 2) {
@@ -206,6 +211,11 @@ testsuite_setup(void)
/* Create 2 LIBCRYPTO devices if required */
if (gbl_cryptodev_type == RTE_CRYPTODEV_LIBCRYPTO_PMD) {
+#ifndef RTE_LIBRTE_PMD_LIBCRYPTO
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_LIBCRYPTO must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(
RTE_CRYPTODEV_LIBCRYPTO_PMD);
if (nb_devs < 2) {
@@ -223,6 +233,11 @@ testsuite_setup(void)
/* Create 2 AESNI GCM devices if required */
if (gbl_cryptodev_type == RTE_CRYPTODEV_AESNI_GCM_PMD) {
+#ifndef RTE_LIBRTE_PMD_AESNI_GCM
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_AESNI_GCM must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(
RTE_CRYPTODEV_AESNI_GCM_PMD);
if (nb_devs < 2) {
@@ -238,6 +253,11 @@ testsuite_setup(void)
/* Create 2 Snow3G devices if required */
if (gbl_cryptodev_type == RTE_CRYPTODEV_SNOW3G_PMD) {
+#ifndef RTE_LIBRTE_PMD_SNOW3G
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_SNOW3G must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(RTE_CRYPTODEV_SNOW3G_PMD);
if (nb_devs < 2) {
for (i = nb_devs; i < 2; i++) {
@@ -252,6 +272,11 @@ testsuite_setup(void)
/* Create 2 KASUMI devices if required */
if (gbl_cryptodev_type == RTE_CRYPTODEV_KASUMI_PMD) {
+#ifndef RTE_LIBRTE_PMD_KASUMI
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_KASUMI must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(RTE_CRYPTODEV_KASUMI_PMD);
if (nb_devs < 2) {
for (i = nb_devs; i < 2; i++) {
@@ -266,6 +291,11 @@ testsuite_setup(void)
/* Create 2 NULL devices if required */
if (gbl_cryptodev_type == RTE_CRYPTODEV_NULL_PMD) {
+#ifndef RTE_LIBRTE_PMD_NULL_CRYPTO
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(
RTE_CRYPTODEV_NULL_PMD);
if (nb_devs < 2) {
@@ -281,6 +311,13 @@ testsuite_setup(void)
}
}
+#ifndef RTE_LIBRTE_PMD_QAT
+ if (gbl_cryptodev_type == RTE_CRYPTODEV_QAT_SYM_PMD) {
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_QAT must be enabled "
+ "in config file to run this testsuite.\n");
+ return TEST_FAILED;
+ }
+#endif
nb_devs = rte_cryptodev_count();
if (nb_devs < 1) {
diff --git a/app/test/test_cryptodev_perf.c b/app/test/test_cryptodev_perf.c
index 0a0085d..c80c335 100644
--- a/app/test/test_cryptodev_perf.c
+++ b/app/test/test_cryptodev_perf.c
@@ -261,6 +261,11 @@ testsuite_setup(void)
/* Create 2 AESNI MB devices if required */
if (gbl_cryptodev_perftest_devtype == RTE_CRYPTODEV_AESNI_MB_PMD) {
+#ifndef RTE_LIBRTE_PMD_AESNI_MB
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_AESNI_MB must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(RTE_CRYPTODEV_AESNI_MB_PMD);
if (nb_devs < 2) {
for (i = nb_devs; i < 2; i++) {
@@ -276,6 +281,11 @@ testsuite_setup(void)
/* Create 2 SNOW3G devices if required */
if (gbl_cryptodev_perftest_devtype == RTE_CRYPTODEV_SNOW3G_PMD) {
+#ifndef RTE_LIBRTE_PMD_SNOW3G
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_SNOW3G must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(RTE_CRYPTODEV_SNOW3G_PMD);
if (nb_devs < 2) {
for (i = nb_devs; i < 2; i++) {
@@ -291,6 +301,11 @@ testsuite_setup(void)
/* Create 2 LIBCRYPTO devices if required */
if (gbl_cryptodev_perftest_devtype == RTE_CRYPTODEV_LIBCRYPTO_PMD) {
+#ifndef RTE_LIBRTE_PMD_LIBCRYPTO
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_LIBCRYPTO must be"
+ " enabled in config file to run this testsuite.\n");
+ return TEST_FAILED;
+#endif
nb_devs = rte_cryptodev_count_devtype(RTE_CRYPTODEV_LIBCRYPTO_PMD);
if (nb_devs < 2) {
for (i = nb_devs; i < 2; i++) {
@@ -304,6 +319,14 @@ testsuite_setup(void)
}
}
+#ifndef RTE_LIBRTE_PMD_QAT
+ if (gbl_cryptodev_perftest_devtype == RTE_CRYPTODEV_QAT_SYM_PMD) {
+ RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_QAT must be enabled "
+ "in config file to run this testsuite.\n");
+ return TEST_FAILED;
+ }
+#endif
+
nb_devs = rte_cryptodev_count();
if (nb_devs < 1) {
RTE_LOG(ERR, USER1, "No crypto devices found?\n");
--
2.5.0
next reply other threads:[~2016-09-16 12:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-16 12:01 Fiona Trahe [this message]
2016-09-16 14:37 Fiona Trahe
2016-09-16 15:50 ` Trahe, Fiona
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474027289-4162-1-git-send-email-fiona.trahe@intel.com \
--to=fiona.trahe@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).