From patchwork Mon Sep 26 12:57:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Trahe X-Patchwork-Id: 16116 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7045E5587; Mon, 26 Sep 2016 15:08:27 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 63B9637B8 for ; Mon, 26 Sep 2016 15:08:26 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 26 Sep 2016 06:08:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,399,1470726000"; d="scan'208";a="766041432" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 26 Sep 2016 06:08:24 -0700 Received: from linux.site (sisvmlab045.ir.intel.com [10.237.216.52]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u8QD8NNa028409; Mon, 26 Sep 2016 14:08:23 +0100 Received: by linux.site (Postfix, from userid 11342333) id E35A6E3BC2; Mon, 26 Sep 2016 13:57:35 +0100 (IST) From: Fiona Trahe To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com Date: Mon, 26 Sep 2016 13:57:20 +0100 Message-Id: <1474894640-9600-1-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1474036648-19999-1-git-send-email-fiona.trahe@intel.com> References: <1474036648-19999-1-git-send-email-fiona.trahe@intel.com> Subject: [dpdk-dev] [PATCH v2] app/test: improve error message in crypto test code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Improve error message if crypto PMD build is not enabled in config file Signed-off-by: Fiona Trahe Acked-by: Pablo de Lara --- app/test/test_cryptodev.c | 33 +++++++++++++++++++++++++++++++++ app/test/test_cryptodev_perf.c | 18 ++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index d744b37..77cf8a2 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -182,6 +182,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) { @@ -199,6 +204,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) { @@ -214,6 +224,11 @@ testsuite_setup(void) /* Create 2 SNOW 3G 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++) { @@ -228,6 +243,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++) { @@ -242,6 +262,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) { @@ -257,6 +282,14 @@ 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) { RTE_LOG(ERR, USER1, "No crypto devices found?"); diff --git a/app/test/test_cryptodev_perf.c b/app/test/test_cryptodev_perf.c index 20713d4..b97ab7e 100644 --- a/app/test/test_cryptodev_perf.c +++ b/app/test/test_cryptodev_perf.c @@ -245,6 +245,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++) { @@ -260,6 +265,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++) { @@ -273,6 +283,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?");