DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ankur Dwivedi <adwivedi@marvell.com>
To: <dev@dpdk.org>
Cc: <declan.doherty@intel.com>, <akhil.goyal@nxp.com>,
	<anoobj@marvell.com>, Ankur Dwivedi <adwivedi@marvell.com>
Subject: [dpdk-dev] [PATCH v2 7/8] test/crypto: remove PMD specific tests
Date: Fri, 3 Jul 2020 11:11:43 +0530	[thread overview]
Message-ID: <1593754904-1264-7-git-send-email-adwivedi@marvell.com> (raw)
In-Reply-To: <1593754904-1264-1-git-send-email-adwivedi@marvell.com>

From: Anoob Joseph <anoobj@marvell.com>

This patch removes the OCTEON TX and OCTEON TX2 PMDs specific
test cases related to null cipher.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test/test_cryptodev.c | 371 ----------------------------------------------
 1 file changed, 371 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 8f63146..92b0b87 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -9247,361 +9247,10 @@ struct multi_session_params {
 	return TEST_SUCCESS;
 }
 
-static int
-test_null_cipher_only_operation(void)
-{
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	struct crypto_unittest_params *ut_params = &unittest_params;
-
-	/* Verify the capabilities */
-	struct rte_cryptodev_sym_capability_idx cap_idx;
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
-		return -ENOTSUP;
-
-	/* Generate test mbuf data and space for digest */
-	ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
-			catch_22_quote, QUOTE_512_BYTES, 0);
-
-	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	ut_params->cipher_xform.next = NULL;
-
-	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
-	ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-
-	ut_params->sess = rte_cryptodev_sym_session_create(
-			ts_params->session_mpool);
-
-	/* Create Crypto session*/
-	rte_cryptodev_sym_session_init(ts_params->valid_devs[0],
-				ut_params->sess,
-				&ut_params->cipher_xform,
-				ts_params->session_priv_mpool);
-	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
-	/* Generate Crypto op data structure */
-	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
-			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
-	TEST_ASSERT_NOT_NULL(ut_params->op,
-			"Failed to allocate symmetric crypto operation struct");
-
-	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
-	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
-	/* set crypto operation source mbuf */
-	sym_op->m_src = ut_params->ibuf;
-
-	sym_op->cipher.data.offset = 0;
-	sym_op->cipher.data.length = QUOTE_512_BYTES;
-
-	/* Process crypto operation */
-	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->op);
-	TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned");
-
-	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
-			"crypto operation processing failed");
-
-	/* Validate obuf */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->op->sym->m_src, uint8_t *),
-			catch_22_quote,
-			QUOTE_512_BYTES,
-			"Ciphertext data not as expected");
-
-	return TEST_SUCCESS;
-}
 uint8_t orig_data[] = {0xab, 0xab, 0xab, 0xab,
 			0xab, 0xab, 0xab, 0xab,
 			0xab, 0xab, 0xab, 0xab,
 			0xab, 0xab, 0xab, 0xab};
-static int
-test_null_auth_only_operation(void)
-{
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	struct crypto_unittest_params *ut_params = &unittest_params;
-	uint8_t *digest;
-
-	/* Verify the capabilities */
-	struct rte_cryptodev_sym_capability_idx cap_idx;
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
-		return -ENOTSUP;
-
-	/* Generate test mbuf data and space for digest */
-	ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
-			catch_22_quote, QUOTE_512_BYTES, 0);
-
-	/* create a pointer for digest, but don't expect anything to be written
-	 * here in a NULL auth algo so no mbuf append done.
-	 */
-	digest = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *,
-			QUOTE_512_BYTES);
-	/* prefill the memory pointed to by digest */
-	memcpy(digest, orig_data, sizeof(orig_data));
-
-	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	ut_params->auth_xform.next = NULL;
-
-	ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL;
-	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
-
-	ut_params->sess = rte_cryptodev_sym_session_create(
-			ts_params->session_mpool);
-
-	/* Create Crypto session*/
-	rte_cryptodev_sym_session_init(ts_params->valid_devs[0],
-			ut_params->sess, &ut_params->auth_xform,
-			ts_params->session_priv_mpool);
-	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
-	/* Generate Crypto op data structure */
-	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
-			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
-	TEST_ASSERT_NOT_NULL(ut_params->op,
-			"Failed to allocate symmetric crypto operation struct");
-
-	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
-	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
-	sym_op->m_src = ut_params->ibuf;
-
-	sym_op->auth.data.offset = 0;
-	sym_op->auth.data.length = QUOTE_512_BYTES;
-	sym_op->auth.digest.data = digest;
-	sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(ut_params->ibuf,
-			QUOTE_512_BYTES);
-
-	/* Process crypto operation */
-	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->op);
-	TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned");
-
-	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
-			"crypto operation processing failed");
-	/* Make sure memory pointed to by digest hasn't been overwritten */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			orig_data,
-			digest,
-			sizeof(orig_data),
-			"Memory at digest ptr overwritten unexpectedly");
-
-	return TEST_SUCCESS;
-}
-
-
-static int
-test_null_cipher_auth_operation(void)
-{
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	struct crypto_unittest_params *ut_params = &unittest_params;
-	uint8_t *digest;
-
-	/* Verify the capabilities */
-	struct rte_cryptodev_sym_capability_idx cap_idx;
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
-		return -ENOTSUP;
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
-		return -ENOTSUP;
-
-	/* Generate test mbuf data and space for digest */
-	ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
-			catch_22_quote, QUOTE_512_BYTES, 0);
-
-	/* create a pointer for digest, but don't expect anything to be written
-	 * here in a NULL auth algo so no mbuf append done.
-	 */
-	digest = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *,
-			QUOTE_512_BYTES);
-	/* prefill the memory pointed to by digest */
-	memcpy(digest, orig_data, sizeof(orig_data));
-
-	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	ut_params->cipher_xform.next = &ut_params->auth_xform;
-
-	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
-	ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-
-	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	ut_params->auth_xform.next = NULL;
-
-	ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL;
-	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
-
-	ut_params->sess = rte_cryptodev_sym_session_create(
-			ts_params->session_mpool);
-
-	/* Create Crypto session*/
-	rte_cryptodev_sym_session_init(ts_params->valid_devs[0],
-			ut_params->sess, &ut_params->cipher_xform,
-			ts_params->session_priv_mpool);
-	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
-	/* Generate Crypto op data structure */
-	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
-			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
-	TEST_ASSERT_NOT_NULL(ut_params->op,
-			"Failed to allocate symmetric crypto operation struct");
-
-	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
-	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
-	sym_op->m_src = ut_params->ibuf;
-
-	sym_op->cipher.data.offset = 0;
-	sym_op->cipher.data.length = QUOTE_512_BYTES;
-
-	sym_op->auth.data.offset = 0;
-	sym_op->auth.data.length = QUOTE_512_BYTES;
-	sym_op->auth.digest.data = digest;
-	sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(ut_params->ibuf,
-			QUOTE_512_BYTES);
-
-	/* Process crypto operation */
-	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->op);
-	TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned");
-
-	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
-			"crypto operation processing failed");
-
-	/* Validate obuf */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->op->sym->m_src, uint8_t *),
-			catch_22_quote,
-			QUOTE_512_BYTES,
-			"Ciphertext data not as expected");
-	/* Make sure memory pointed to by digest hasn't been overwritten */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			orig_data,
-			digest,
-			sizeof(orig_data),
-			"Memory at digest ptr overwritten unexpectedly");
-
-	return TEST_SUCCESS;
-}
-
-static int
-test_null_auth_cipher_operation(void)
-{
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	struct crypto_unittest_params *ut_params = &unittest_params;
-	uint8_t *digest;
-
-	/* Verify the capabilities */
-	struct rte_cryptodev_sym_capability_idx cap_idx;
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
-		return -ENOTSUP;
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
-		return -ENOTSUP;
-
-	/* Generate test mbuf data */
-	ut_params->ibuf = setup_test_string(ts_params->mbuf_pool,
-			catch_22_quote, QUOTE_512_BYTES, 0);
-
-	/* create a pointer for digest, but don't expect anything to be written
-	 * here in a NULL auth algo so no mbuf append done.
-	 */
-	digest = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *,
-				QUOTE_512_BYTES);
-	/* prefill the memory pointed to by digest */
-	memcpy(digest, orig_data, sizeof(orig_data));
-
-	/* Setup Cipher Parameters */
-	ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	ut_params->cipher_xform.next = NULL;
-
-	ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
-	ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
-
-	/* Setup HMAC Parameters */
-	ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	ut_params->auth_xform.next = &ut_params->cipher_xform;
-
-	ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL;
-	ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
-
-	ut_params->sess = rte_cryptodev_sym_session_create(
-			ts_params->session_mpool);
-
-	/* Create Crypto session*/
-	rte_cryptodev_sym_session_init(ts_params->valid_devs[0],
-			ut_params->sess, &ut_params->cipher_xform,
-			ts_params->session_priv_mpool);
-	TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
-
-	/* Generate Crypto op data structure */
-	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
-			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
-	TEST_ASSERT_NOT_NULL(ut_params->op,
-			"Failed to allocate symmetric crypto operation struct");
-
-	/* Set crypto operation data parameters */
-	rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
-
-	struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
-	sym_op->m_src = ut_params->ibuf;
-
-	sym_op->cipher.data.offset = 0;
-	sym_op->cipher.data.length = QUOTE_512_BYTES;
-
-	sym_op->auth.data.offset = 0;
-	sym_op->auth.data.length = QUOTE_512_BYTES;
-	sym_op->auth.digest.data = digest;
-	sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(ut_params->ibuf,
-					QUOTE_512_BYTES);
-
-	/* Process crypto operation */
-	ut_params->op = process_crypto_request(ts_params->valid_devs[0],
-			ut_params->op);
-	TEST_ASSERT_NOT_NULL(ut_params->op, "no crypto operation returned");
-
-	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
-			"crypto operation processing failed");
-
-	/* Validate obuf */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			rte_pktmbuf_mtod(ut_params->op->sym->m_src, uint8_t *),
-			catch_22_quote,
-			QUOTE_512_BYTES,
-			"Ciphertext data not as expected");
-	/* Make sure memory pointed to by digest hasn't been overwritten */
-	TEST_ASSERT_BUFFERS_ARE_EQUAL(
-			orig_data,
-			digest,
-			sizeof(orig_data),
-			"Memory at digest ptr overwritten unexpectedly");
-
-	return TEST_SUCCESS;
-}
-
 
 static int
 test_null_invalid_operation(void)
@@ -12631,16 +12280,6 @@ struct test_crypto_vector {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_kasumi_hash_verify_test_case_5),
 
-		/** NULL tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_cipher_only_operation),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_auth_only_operation),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_cipher_auth_operation),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_auth_cipher_operation),
-
 		/** Negative tests */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			authentication_verify_HMAC_SHA1_fail_data_corrupt),
@@ -12854,16 +12493,6 @@ struct test_crypto_vector {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_kasumi_hash_verify_test_case_5),
 
-		/** NULL tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_cipher_only_operation),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_auth_only_operation),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_cipher_auth_operation),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			test_null_auth_cipher_operation),
-
 		/** Negative tests */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-- 
1.9.3


  parent reply	other threads:[~2020-07-03  5:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11  5:38 [dpdk-dev] [PATCH 0/7] test/crypto: use generic crypto auto test framework Ankur Dwivedi
2020-06-11  5:38 ` [dpdk-dev] [PATCH 1/7] common/cpt: fix encryption offset Ankur Dwivedi
2020-07-01 20:24   ` Akhil Goyal
2020-07-02 13:18     ` Ankur Dwivedi
2020-06-11  5:38 ` [dpdk-dev] [PATCH 2/7] crypto/octeontx: remove stats callback Ankur Dwivedi
2020-06-11  5:38 ` [dpdk-dev] [PATCH 3/7] crypto/octeontx: set session private data Ankur Dwivedi
2020-06-11  5:38 ` [dpdk-dev] [PATCH 4/7] crypto/octeontx2: " Ankur Dwivedi
2020-06-11  5:38 ` [dpdk-dev] [PATCH 5/7] crypto/octeontx: remove unsupported feature Ankur Dwivedi
2020-07-01 20:27   ` Akhil Goyal
2020-07-02 13:20     ` Ankur Dwivedi
2020-06-11  5:38 ` [dpdk-dev] [PATCH 6/7] crypto/octeontx2: " Ankur Dwivedi
2020-06-11  5:38 ` [dpdk-dev] [PATCH 7/7] test/crypto: use generic cryptotests for OCTEON TX PMDs Ankur Dwivedi
2020-07-01 20:23   ` Akhil Goyal
2020-07-02 13:15     ` Ankur Dwivedi
2020-07-03  5:41 ` [dpdk-dev] [PATCH v2 1/8] common/cpt: fix encryption offset Ankur Dwivedi
2020-07-03  5:41   ` [dpdk-dev] [PATCH v2 2/8] crypto/octeontx: remove stats callback Ankur Dwivedi
2020-07-03  5:41   ` [dpdk-dev] [PATCH v2 3/8] crypto/octeontx: set session private data Ankur Dwivedi
2020-07-03  5:41   ` [dpdk-dev] [PATCH v2 4/8] crypto/octeontx2: " Ankur Dwivedi
2020-07-03  5:41   ` [dpdk-dev] [PATCH v2 5/8] crypto/octeontx: revert non-byte aligned data feature Ankur Dwivedi
2020-07-03  5:41   ` [dpdk-dev] [PATCH v2 6/8] crypto/octeontx2: " Ankur Dwivedi
2020-07-03  5:41   ` Ankur Dwivedi [this message]
2020-07-03  5:41   ` [dpdk-dev] [PATCH v2 8/8] test/crypto: use generic testsuite for OCTEON TX/TX2 Ankur Dwivedi
2020-07-04 19:57   ` [dpdk-dev] [PATCH v2 1/8] common/cpt: fix encryption offset Akhil Goyal

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=1593754904-1264-7-git-send-email-adwivedi@marvell.com \
    --to=adwivedi@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /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).