From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7F1925699 for ; Tue, 5 Sep 2017 12:20:06 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2017 03:20:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,479,1498546800"; d="scan'208";a="125667176" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by orsmga004.jf.intel.com with ESMTP; 05 Sep 2017 03:20:04 -0700 From: Pablo de Lara To: declan.doherty@intel.com, roy.fan.zhang@intel.com, jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Pablo de Lara Date: Tue, 5 Sep 2017 03:20:07 +0100 Message-Id: <20170905022007.55749-9-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170905022007.55749-1-pablo.de.lara.guarch@intel.com> References: <20170818072103.1416-1-pablo.de.lara.guarch@intel.com> <20170905022007.55749-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v2 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: , X-List-Received-Date: Tue, 05 Sep 2017 10:20:07 -0000 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; -- 2.9.4