From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 080E71B1F8 for ; Thu, 4 Apr 2019 16:51:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2019 07:51:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,308,1549958400"; d="scan'208";a="158736709" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by fmsmga004.fm.intel.com with ESMTP; 04 Apr 2019 07:51:57 -0700 From: Bernard Iremonger To: dev@dpdk.org, konstantin.ananyev@intel.com, akhil.goyal@nxp.com Cc: Bernard Iremonger Date: Thu, 4 Apr 2019 15:51:51 +0100 Message-Id: <1554389511-6355-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1553262462-28370-1-git-send-email-bernard.iremonger@intel.com> References: <1553262462-28370-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v3] app/test/ipsec: fix test initialisation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 14:52:00 -0000 Fix xform initialisation. Fix testsuite_setup. Remove unused variables. Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") Fixes: 59d7353b0df0 ("test/ipsec: fix test suite setup") Signed-off-by: Bernard Iremonger --- Changes in v3: drop changes to logic around rte_cryptodev_dequeue_burst() app/test/test_ipsec.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index 80a2d25..29fab92 100644 --- a/app/test/test_ipsec.c +++ b/app/test/test_ipsec.c @@ -79,7 +79,6 @@ struct ipsec_unitest_params { struct rte_mbuf *obuf[BURST_SIZE], *ibuf[BURST_SIZE], *testbuf[BURST_SIZE]; - uint8_t *digest; uint16_t pkt_index; }; @@ -111,8 +110,6 @@ static struct ipsec_testsuite_params testsuite_params = { NULL }; static struct ipsec_unitest_params unittest_params; static struct user_params uparams; -static uint8_t global_key[128] = { 0 }; - struct supported_cipher_algo { const char *keyword; enum rte_crypto_cipher_algorithm algo; @@ -215,30 +212,26 @@ fill_crypto_xform(struct ipsec_unitest_params *ut_params, const struct supported_auth_algo *auth_algo, const struct supported_cipher_algo *cipher_algo) { - ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; - ut_params->auth_xform.auth.algo = auth_algo->algo; - ut_params->auth_xform.auth.key.data = global_key; - ut_params->auth_xform.auth.key.length = auth_algo->key_len; - ut_params->auth_xform.auth.digest_length = auth_algo->digest_len; - ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; - ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; ut_params->cipher_xform.cipher.algo = cipher_algo->algo; - ut_params->cipher_xform.cipher.key.data = global_key; - ut_params->cipher_xform.cipher.key.length = cipher_algo->key_len; - ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; - ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; - ut_params->cipher_xform.cipher.iv.length = cipher_algo->iv_len; + ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; + ut_params->auth_xform.auth.algo = auth_algo->algo; if (ut_params->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) { - ut_params->crypto_xforms = &ut_params->auth_xform; - ut_params->auth_xform.next = &ut_params->cipher_xform; + ut_params->cipher_xform.cipher.op = + RTE_CRYPTO_CIPHER_OP_DECRYPT; + ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; ut_params->cipher_xform.next = NULL; + ut_params->auth_xform.next = &ut_params->cipher_xform; + ut_params->crypto_xforms = &ut_params->auth_xform; } else { - ut_params->crypto_xforms = &ut_params->cipher_xform; - ut_params->cipher_xform.next = &ut_params->auth_xform; + ut_params->cipher_xform.cipher.op = + RTE_CRYPTO_CIPHER_OP_ENCRYPT; + ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; ut_params->auth_xform.next = NULL; + ut_params->cipher_xform.next = &ut_params->auth_xform; + ut_params->crypto_xforms = &ut_params->cipher_xform; } } @@ -287,9 +280,12 @@ testsuite_setup(void) int rc; memset(ts_params, 0, sizeof(*ts_params)); + memset(ut_params, 0, sizeof(*ut_params)); + memset(&uparams, 0, sizeof(struct user_params)); uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH; uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER; + uparams.aead = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED; strcpy(uparams.auth_algo, "null"); strcpy(uparams.cipher_algo, "null"); -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DC704A0679 for ; Thu, 4 Apr 2019 16:52:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F25A41B3D7; Thu, 4 Apr 2019 16:52:01 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 080E71B1F8 for ; Thu, 4 Apr 2019 16:51:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2019 07:51:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,308,1549958400"; d="scan'208";a="158736709" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by fmsmga004.fm.intel.com with ESMTP; 04 Apr 2019 07:51:57 -0700 From: Bernard Iremonger To: dev@dpdk.org, konstantin.ananyev@intel.com, akhil.goyal@nxp.com Cc: Bernard Iremonger Date: Thu, 4 Apr 2019 15:51:51 +0100 Message-Id: <1554389511-6355-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1553262462-28370-1-git-send-email-bernard.iremonger@intel.com> References: <1553262462-28370-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v3] app/test/ipsec: fix test initialisation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190404145151.6Hv4T6L9VeFj5b6i8IaP1qH3xEoq9sPiMVeHBVkDaJM@z> Fix xform initialisation. Fix testsuite_setup. Remove unused variables. Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test") Fixes: 59d7353b0df0 ("test/ipsec: fix test suite setup") Signed-off-by: Bernard Iremonger --- Changes in v3: drop changes to logic around rte_cryptodev_dequeue_burst() app/test/test_ipsec.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index 80a2d25..29fab92 100644 --- a/app/test/test_ipsec.c +++ b/app/test/test_ipsec.c @@ -79,7 +79,6 @@ struct ipsec_unitest_params { struct rte_mbuf *obuf[BURST_SIZE], *ibuf[BURST_SIZE], *testbuf[BURST_SIZE]; - uint8_t *digest; uint16_t pkt_index; }; @@ -111,8 +110,6 @@ static struct ipsec_testsuite_params testsuite_params = { NULL }; static struct ipsec_unitest_params unittest_params; static struct user_params uparams; -static uint8_t global_key[128] = { 0 }; - struct supported_cipher_algo { const char *keyword; enum rte_crypto_cipher_algorithm algo; @@ -215,30 +212,26 @@ fill_crypto_xform(struct ipsec_unitest_params *ut_params, const struct supported_auth_algo *auth_algo, const struct supported_cipher_algo *cipher_algo) { - ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; - ut_params->auth_xform.auth.algo = auth_algo->algo; - ut_params->auth_xform.auth.key.data = global_key; - ut_params->auth_xform.auth.key.length = auth_algo->key_len; - ut_params->auth_xform.auth.digest_length = auth_algo->digest_len; - ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; - ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; ut_params->cipher_xform.cipher.algo = cipher_algo->algo; - ut_params->cipher_xform.cipher.key.data = global_key; - ut_params->cipher_xform.cipher.key.length = cipher_algo->key_len; - ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_DECRYPT; - ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; - ut_params->cipher_xform.cipher.iv.length = cipher_algo->iv_len; + ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; + ut_params->auth_xform.auth.algo = auth_algo->algo; if (ut_params->ipsec_xform.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) { - ut_params->crypto_xforms = &ut_params->auth_xform; - ut_params->auth_xform.next = &ut_params->cipher_xform; + ut_params->cipher_xform.cipher.op = + RTE_CRYPTO_CIPHER_OP_DECRYPT; + ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_VERIFY; ut_params->cipher_xform.next = NULL; + ut_params->auth_xform.next = &ut_params->cipher_xform; + ut_params->crypto_xforms = &ut_params->auth_xform; } else { - ut_params->crypto_xforms = &ut_params->cipher_xform; - ut_params->cipher_xform.next = &ut_params->auth_xform; + ut_params->cipher_xform.cipher.op = + RTE_CRYPTO_CIPHER_OP_ENCRYPT; + ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE; ut_params->auth_xform.next = NULL; + ut_params->cipher_xform.next = &ut_params->auth_xform; + ut_params->crypto_xforms = &ut_params->cipher_xform; } } @@ -287,9 +280,12 @@ testsuite_setup(void) int rc; memset(ts_params, 0, sizeof(*ts_params)); + memset(ut_params, 0, sizeof(*ut_params)); + memset(&uparams, 0, sizeof(struct user_params)); uparams.auth = RTE_CRYPTO_SYM_XFORM_AUTH; uparams.cipher = RTE_CRYPTO_SYM_XFORM_CIPHER; + uparams.aead = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED; strcpy(uparams.auth_algo, "null"); strcpy(uparams.cipher_algo, "null"); -- 2.7.4