From patchwork Fri Aug 18 07:21:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 27656 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 9E25C7D96; Fri, 18 Aug 2017 17:21:13 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C0D607D26 for ; Fri, 18 Aug 2017 17:21:04 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Aug 2017 08:20:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,393,1498546800"; d="scan'208";a="301831096" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by fmsmga004.fm.intel.com with ESMTP; 18 Aug 2017 08:20:56 -0700 From: Pablo de Lara To: declan.doherty@intel.com, jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Pablo de Lara Date: Fri, 18 Aug 2017 08:21:03 +0100 Message-Id: <20170818072103.1416-9-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170818072103.1416-1-pablo.de.lara.guarch@intel.com> References: <20170818072103.1416-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 8/8] test/crypto: do not allocate extra memory for digest 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" Now that PMDs do not need extra space in the mbuf to store temporarily the digest when verifying an authentication tag, it is not required to allocate more memory in the mbufs passed to cryptodev. Signed-off-by: Pablo de Lara --- test/test/test_cryptodev_blockcipher.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/test/test/test_cryptodev_blockcipher.c b/test/test/test_cryptodev_blockcipher.c index 6089af4..f8222bd 100644 --- a/test/test/test_cryptodev_blockcipher.c +++ b/test/test/test_cryptodev_blockcipher.c @@ -452,25 +452,13 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t, if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) { struct rte_mbuf *mbuf; uint8_t value; - uint32_t head_unchanged_len = 0, changed_len = 0; + uint32_t head_unchanged_len, changed_len = 0; uint32_t i; mbuf = sym_op->m_src; - if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY) { - /* white-box test: PMDs use some of the - * tailroom as temp storage in verify case - */ - head_unchanged_len = rte_pktmbuf_headroom(mbuf) - + rte_pktmbuf_data_len(mbuf); - changed_len = digest_len; - } else { - head_unchanged_len = mbuf->buf_len; - changed_len = 0; - } + head_unchanged_len = mbuf->buf_len; for (i = 0; i < mbuf->buf_len; i++) { - if (i == head_unchanged_len) - i += changed_len; value = *((uint8_t *)(mbuf->buf_addr)+i); if (value != tmp_src_buf[i]) { snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, @@ -531,19 +519,6 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t, if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_GEN) changed_len += digest_len; - if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY) { - /* white-box test: PMDs use some of the - * tailroom as temp storage in verify case - */ - if (t->op_mask & BLOCKCIPHER_TEST_OP_CIPHER) { - /* This is simplified, not checking digest*/ - changed_len += digest_len*2; - } else { - head_unchanged_len += digest_len; - changed_len += digest_len; - } - } - for (i = 0; i < mbuf->buf_len; i++) { if (i == head_unchanged_len) i += changed_len;