1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2015-2017 Intel Corporation
5 #include <rte_common.h>
6 #include <rte_hexdump.h>
8 #include <rte_malloc.h>
9 #include <rte_memcpy.h>
10 #include <rte_pause.h>
12 #include <rte_crypto.h>
13 #include <rte_cryptodev.h>
14 #include <rte_cryptodev_pmd.h>
17 #include "test_cryptodev.h"
18 #include "test_cryptodev_blockcipher.h"
19 #include "test_cryptodev_aes_test_vectors.h"
20 #include "test_cryptodev_des_test_vectors.h"
21 #include "test_cryptodev_hash_test_vectors.h"
24 test_blockcipher_one_case(const struct blockcipher_test_case *t,
25 struct rte_mempool *mbuf_pool,
26 struct rte_mempool *op_mpool,
27 struct rte_mempool *sess_mpool,
32 struct rte_mbuf *ibuf = NULL;
33 struct rte_mbuf *obuf = NULL;
34 struct rte_mbuf *iobuf;
35 struct rte_crypto_sym_xform *cipher_xform = NULL;
36 struct rte_crypto_sym_xform *auth_xform = NULL;
37 struct rte_crypto_sym_xform *init_xform = NULL;
38 struct rte_crypto_sym_op *sym_op = NULL;
39 struct rte_crypto_op *op = NULL;
40 struct rte_cryptodev_info dev_info;
41 struct rte_cryptodev_sym_session *sess = NULL;
43 int status = TEST_SUCCESS;
44 const struct blockcipher_test_data *tdata = t->test_data;
45 uint8_t cipher_key[tdata->cipher_key.len];
46 uint8_t auth_key[tdata->auth_key.len];
47 uint32_t buf_len = tdata->ciphertext.len;
48 uint32_t digest_len = 0;
50 uint8_t src_pattern = 0xa5;
51 uint8_t dst_pattern = 0xb6;
52 uint8_t tmp_src_buf[MBUF_SIZE];
53 uint8_t tmp_dst_buf[MBUF_SIZE];
55 int openssl_pmd = rte_cryptodev_driver_id_get(
56 RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
57 int scheduler_pmd = rte_cryptodev_driver_id_get(
58 RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
59 int armv8_pmd = rte_cryptodev_driver_id_get(
60 RTE_STR(CRYPTODEV_NAME_ARMV8_PMD));
61 int aesni_mb_pmd = rte_cryptodev_driver_id_get(
62 RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
63 int qat_pmd = rte_cryptodev_driver_id_get(
64 RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
65 int dpaa2_sec_pmd = rte_cryptodev_driver_id_get(
66 RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
67 int dpaa_sec_pmd = rte_cryptodev_driver_id_get(
68 RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
69 int mrvl_pmd = rte_cryptodev_driver_id_get(
70 RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
74 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SG) {
75 rte_cryptodev_info_get(dev_id, &dev_info);
76 if (!(dev_info.feature_flags &
77 RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) {
78 printf("Device doesn't support scatter-gather. "
85 if (tdata->cipher_key.len)
86 memcpy(cipher_key, tdata->cipher_key.data,
87 tdata->cipher_key.len);
88 if (tdata->auth_key.len)
89 memcpy(auth_key, tdata->auth_key.data,
92 if (driver_id == dpaa2_sec_pmd ||
93 driver_id == dpaa_sec_pmd ||
94 driver_id == qat_pmd ||
95 driver_id == openssl_pmd ||
96 driver_id == armv8_pmd ||
97 driver_id == mrvl_pmd) { /* Fall through */
98 digest_len = tdata->digest.len;
99 } else if (driver_id == aesni_mb_pmd ||
100 driver_id == scheduler_pmd) {
101 digest_len = tdata->digest.truncated_len;
103 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
104 "line %u FAILED: %s",
105 __LINE__, "Unsupported PMD type");
106 status = TEST_FAILED;
111 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH)
112 buf_len += digest_len;
114 /* for contiguous mbuf, nb_segs is 1 */
115 ibuf = create_segmented_mbuf(mbuf_pool,
116 tdata->ciphertext.len, nb_segs, src_pattern);
118 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
119 "line %u FAILED: %s",
120 __LINE__, "Cannot create source mbuf");
121 status = TEST_FAILED;
125 /* only encryption requires plaintext.data input,
126 * decryption/(digest gen)/(digest verify) use ciphertext.data
129 if (t->op_mask & BLOCKCIPHER_TEST_OP_ENCRYPT)
130 pktmbuf_write(ibuf, 0, tdata->plaintext.len,
131 tdata->plaintext.data);
133 pktmbuf_write(ibuf, 0, tdata->ciphertext.len,
134 tdata->ciphertext.data);
136 buf_p = rte_pktmbuf_append(ibuf, digest_len);
137 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY)
138 rte_memcpy(buf_p, tdata->digest.data, digest_len);
140 memset(buf_p, 0, digest_len);
142 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) {
143 obuf = rte_pktmbuf_alloc(mbuf_pool);
145 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
146 "FAILED: %s", __LINE__,
147 "Allocation of rte_mbuf failed");
148 status = TEST_FAILED;
151 memset(obuf->buf_addr, dst_pattern, obuf->buf_len);
153 buf_p = rte_pktmbuf_append(obuf, buf_len);
155 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
156 "FAILED: %s", __LINE__,
157 "No room to append mbuf");
158 status = TEST_FAILED;
161 memset(buf_p, 0, buf_len);
164 /* Generate Crypto op data structure */
165 op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC);
167 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
168 "line %u FAILED: %s",
169 __LINE__, "Failed to allocate symmetric crypto "
171 status = TEST_FAILED;
177 sym_op->m_src = ibuf;
179 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) {
180 sym_op->m_dst = obuf;
183 sym_op->m_dst = NULL;
187 /* sessionless op requires allocate xform using
188 * rte_crypto_op_sym_xforms_alloc(), otherwise rte_zmalloc()
191 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS) {
192 uint32_t n_xforms = 0;
194 if (t->op_mask & BLOCKCIPHER_TEST_OP_CIPHER)
196 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH)
199 if (rte_crypto_op_sym_xforms_alloc(op, n_xforms)
201 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
202 "FAILED: %s", __LINE__, "Failed to "
203 "allocate space for crypto transforms");
204 status = TEST_FAILED;
208 cipher_xform = rte_zmalloc(NULL,
209 sizeof(struct rte_crypto_sym_xform), 0);
211 auth_xform = rte_zmalloc(NULL,
212 sizeof(struct rte_crypto_sym_xform), 0);
214 if (!cipher_xform || !auth_xform) {
215 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
216 "FAILED: %s", __LINE__, "Failed to "
217 "allocate memory for crypto transforms");
218 status = TEST_FAILED;
223 /* preparing xform, for sessioned op, init_xform is initialized
224 * here and later as param in rte_cryptodev_sym_session_create() call
226 if (t->op_mask == BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN) {
227 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS) {
228 cipher_xform = op->sym->xform;
229 auth_xform = cipher_xform->next;
230 auth_xform->next = NULL;
232 cipher_xform->next = auth_xform;
233 auth_xform->next = NULL;
234 init_xform = cipher_xform;
236 } else if (t->op_mask == BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC) {
237 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS) {
238 auth_xform = op->sym->xform;
239 cipher_xform = auth_xform->next;
240 cipher_xform->next = NULL;
242 auth_xform->next = cipher_xform;
243 cipher_xform->next = NULL;
244 init_xform = auth_xform;
246 } else if ((t->op_mask == BLOCKCIPHER_TEST_OP_ENCRYPT) ||
247 (t->op_mask == BLOCKCIPHER_TEST_OP_DECRYPT)) {
248 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS)
249 cipher_xform = op->sym->xform;
251 init_xform = cipher_xform;
252 cipher_xform->next = NULL;
253 } else if ((t->op_mask == BLOCKCIPHER_TEST_OP_AUTH_GEN) ||
254 (t->op_mask == BLOCKCIPHER_TEST_OP_AUTH_VERIFY)) {
255 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS)
256 auth_xform = op->sym->xform;
258 init_xform = auth_xform;
259 auth_xform->next = NULL;
261 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
262 "line %u FAILED: %s",
263 __LINE__, "Unrecognized operation");
264 status = TEST_FAILED;
268 /*configure xforms & sym_op cipher and auth data*/
269 if (t->op_mask & BLOCKCIPHER_TEST_OP_CIPHER) {
270 cipher_xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;
271 cipher_xform->cipher.algo = tdata->crypto_algo;
272 if (t->op_mask & BLOCKCIPHER_TEST_OP_ENCRYPT)
273 cipher_xform->cipher.op =
274 RTE_CRYPTO_CIPHER_OP_ENCRYPT;
276 cipher_xform->cipher.op =
277 RTE_CRYPTO_CIPHER_OP_DECRYPT;
278 cipher_xform->cipher.key.data = cipher_key;
279 cipher_xform->cipher.key.length = tdata->cipher_key.len;
280 cipher_xform->cipher.iv.offset = IV_OFFSET;
281 cipher_xform->cipher.iv.length = tdata->iv.len;
283 sym_op->cipher.data.offset = 0;
284 sym_op->cipher.data.length = tdata->ciphertext.len;
285 rte_memcpy(rte_crypto_op_ctod_offset(op, uint8_t *, IV_OFFSET),
290 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH) {
291 uint32_t digest_offset = tdata->ciphertext.len;
293 auth_xform->type = RTE_CRYPTO_SYM_XFORM_AUTH;
294 auth_xform->auth.algo = tdata->auth_algo;
295 auth_xform->auth.key.length = tdata->auth_key.len;
296 auth_xform->auth.key.data = auth_key;
297 auth_xform->auth.digest_length = digest_len;
299 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_GEN) {
300 auth_xform->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
301 sym_op->auth.digest.data = pktmbuf_mtod_offset
302 (iobuf, digest_offset);
303 sym_op->auth.digest.phys_addr =
304 pktmbuf_iova_offset(iobuf,
307 auth_xform->auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;
308 sym_op->auth.digest.data = pktmbuf_mtod_offset
309 (sym_op->m_src, digest_offset);
310 sym_op->auth.digest.phys_addr =
311 pktmbuf_iova_offset(sym_op->m_src,
315 sym_op->auth.data.offset = 0;
316 sym_op->auth.data.length = tdata->ciphertext.len;
319 /* create session for sessioned op */
320 if (!(t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS)) {
321 sess = rte_cryptodev_sym_session_create(sess_mpool);
323 rte_cryptodev_sym_session_init(dev_id, sess, init_xform,
326 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
327 "FAILED: %s", __LINE__,
328 "Session creation failed");
329 status = TEST_FAILED;
333 /* attach symmetric crypto session to crypto operations */
334 rte_crypto_op_attach_sym_session(op, sess);
337 debug_hexdump(stdout, "m_src(before):",
338 sym_op->m_src->buf_addr, sym_op->m_src->buf_len);
339 rte_memcpy(tmp_src_buf, sym_op->m_src->buf_addr,
340 sym_op->m_src->buf_len);
341 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) {
342 debug_hexdump(stdout, "m_dst(before):",
343 sym_op->m_dst->buf_addr, sym_op->m_dst->buf_len);
344 rte_memcpy(tmp_dst_buf, sym_op->m_dst->buf_addr,
345 sym_op->m_dst->buf_len);
348 /* Process crypto operation */
349 if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {
350 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
351 "line %u FAILED: %s",
352 __LINE__, "Error sending packet for encryption");
353 status = TEST_FAILED;
359 while (rte_cryptodev_dequeue_burst(dev_id, 0, &op, 1) == 0)
363 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
364 "line %u FAILED: %s",
365 __LINE__, "Failed to process sym crypto op");
366 status = TEST_FAILED;
370 debug_hexdump(stdout, "m_src(after):",
371 sym_op->m_src->buf_addr, sym_op->m_src->buf_len);
372 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP)
373 debug_hexdump(stdout, "m_dst(after):",
374 sym_op->m_dst->buf_addr, sym_op->m_dst->buf_len);
377 if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
378 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY)
379 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
380 "FAILED: Digest verification failed "
381 "(0x%X)", __LINE__, op->status);
383 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
384 "FAILED: Digest verification failed "
385 "(0x%X)", __LINE__, op->status);
386 status = TEST_FAILED;
390 if (t->op_mask & BLOCKCIPHER_TEST_OP_CIPHER) {
391 uint8_t buffer[2048];
392 const uint8_t *compare_ref;
393 uint32_t compare_len;
395 if (t->op_mask & BLOCKCIPHER_TEST_OP_ENCRYPT) {
396 compare_ref = tdata->ciphertext.data;
397 compare_len = tdata->ciphertext.len;
399 compare_ref = tdata->plaintext.data;
400 compare_len = tdata->plaintext.len;
403 if (memcmp(rte_pktmbuf_read(iobuf, 0, compare_len,
404 buffer), compare_ref, compare_len)) {
405 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
406 "FAILED: %s", __LINE__,
407 "Crypto data not as expected");
408 status = TEST_FAILED;
413 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_GEN) {
414 uint8_t *auth_res = pktmbuf_mtod_offset(iobuf,
415 tdata->ciphertext.len);
417 if (memcmp(auth_res, tdata->digest.data, digest_len)) {
418 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
419 "FAILED: %s", __LINE__, "Generated "
420 "digest data not as expected");
421 status = TEST_FAILED;
426 /* The only parts that should have changed in the buffer are
427 * plaintext/ciphertext and digest.
428 * In OOP only the dest buffer should change.
430 if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) {
431 struct rte_mbuf *mbuf;
433 uint32_t head_unchanged_len, changed_len = 0;
436 mbuf = sym_op->m_src;
437 head_unchanged_len = mbuf->buf_len;
439 for (i = 0; i < mbuf->buf_len; i++) {
440 value = *((uint8_t *)(mbuf->buf_addr)+i);
441 if (value != tmp_src_buf[i]) {
442 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
443 "line %u FAILED: OOP src outer mbuf data (0x%x) not as expected (0x%x)",
444 __LINE__, value, tmp_src_buf[i]);
445 status = TEST_FAILED;
450 mbuf = sym_op->m_dst;
451 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH) {
452 head_unchanged_len = rte_pktmbuf_headroom(mbuf) +
453 sym_op->auth.data.offset;
454 changed_len = sym_op->auth.data.length;
455 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_GEN)
456 changed_len += digest_len;
459 head_unchanged_len = rte_pktmbuf_headroom(mbuf) +
460 sym_op->cipher.data.offset;
461 changed_len = sym_op->cipher.data.length;
464 for (i = 0; i < mbuf->buf_len; i++) {
465 if (i == head_unchanged_len)
467 value = *((uint8_t *)(mbuf->buf_addr)+i);
468 if (value != tmp_dst_buf[i]) {
469 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
470 "line %u FAILED: OOP dst outer mbuf data "
471 "(0x%x) not as expected (0x%x)",
472 __LINE__, value, tmp_dst_buf[i]);
473 status = TEST_FAILED;
478 /* In-place operation */
479 struct rte_mbuf *mbuf;
481 uint32_t head_unchanged_len = 0, changed_len = 0;
484 mbuf = sym_op->m_src;
485 if (t->op_mask & BLOCKCIPHER_TEST_OP_CIPHER) {
486 head_unchanged_len = rte_pktmbuf_headroom(mbuf) +
487 sym_op->cipher.data.offset;
488 changed_len = sym_op->cipher.data.length;
491 head_unchanged_len = rte_pktmbuf_headroom(mbuf) +
492 sym_op->auth.data.offset +
493 sym_op->auth.data.length;
497 if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_GEN)
498 changed_len += digest_len;
500 for (i = 0; i < mbuf->buf_len; i++) {
501 if (i == head_unchanged_len)
503 value = *((uint8_t *)(mbuf->buf_addr)+i);
504 if (value != tmp_src_buf[i]) {
505 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
506 "line %u FAILED: outer mbuf data (0x%x) "
507 "not as expected (0x%x)",
508 __LINE__, value, tmp_src_buf[i]);
509 status = TEST_FAILED;
515 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "PASS");
518 if (!(t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS)) {
520 rte_cryptodev_sym_session_clear(dev_id, sess);
521 rte_cryptodev_sym_session_free(sess);
524 rte_free(cipher_xform);
526 rte_free(auth_xform);
530 rte_crypto_op_free(op);
533 rte_pktmbuf_free(obuf);
536 rte_pktmbuf_free(ibuf);
542 test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
543 struct rte_mempool *op_mpool,
544 struct rte_mempool *sess_mpool,
547 enum blockcipher_test_type test_type)
549 int status, overall_status = TEST_SUCCESS;
550 uint32_t i, test_index = 0;
551 char test_msg[BLOCKCIPHER_TEST_MSG_LEN + 1];
552 uint32_t n_test_cases = 0;
553 uint32_t target_pmd_mask = 0;
554 const struct blockcipher_test_case *tcs = NULL;
556 int openssl_pmd = rte_cryptodev_driver_id_get(
557 RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
558 int dpaa2_sec_pmd = rte_cryptodev_driver_id_get(
559 RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
560 int dpaa_sec_pmd = rte_cryptodev_driver_id_get(
561 RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
562 int scheduler_pmd = rte_cryptodev_driver_id_get(
563 RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
564 int armv8_pmd = rte_cryptodev_driver_id_get(
565 RTE_STR(CRYPTODEV_NAME_ARMV8_PMD));
566 int aesni_mb_pmd = rte_cryptodev_driver_id_get(
567 RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
568 int qat_pmd = rte_cryptodev_driver_id_get(
569 RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
570 int mrvl_pmd = rte_cryptodev_driver_id_get(
571 RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
574 case BLKCIPHER_AES_CHAIN_TYPE:
575 n_test_cases = sizeof(aes_chain_test_cases) /
576 sizeof(aes_chain_test_cases[0]);
577 tcs = aes_chain_test_cases;
579 case BLKCIPHER_AES_CIPHERONLY_TYPE:
580 n_test_cases = sizeof(aes_cipheronly_test_cases) /
581 sizeof(aes_cipheronly_test_cases[0]);
582 tcs = aes_cipheronly_test_cases;
584 case BLKCIPHER_AES_DOCSIS_TYPE:
585 n_test_cases = sizeof(aes_docsis_test_cases) /
586 sizeof(aes_docsis_test_cases[0]);
587 tcs = aes_docsis_test_cases;
589 case BLKCIPHER_3DES_CHAIN_TYPE:
590 n_test_cases = sizeof(triple_des_chain_test_cases) /
591 sizeof(triple_des_chain_test_cases[0]);
592 tcs = triple_des_chain_test_cases;
594 case BLKCIPHER_3DES_CIPHERONLY_TYPE:
595 n_test_cases = sizeof(triple_des_cipheronly_test_cases) /
596 sizeof(triple_des_cipheronly_test_cases[0]);
597 tcs = triple_des_cipheronly_test_cases;
599 case BLKCIPHER_DES_CIPHERONLY_TYPE:
600 n_test_cases = sizeof(des_cipheronly_test_cases) /
601 sizeof(des_cipheronly_test_cases[0]);
602 tcs = des_cipheronly_test_cases;
604 case BLKCIPHER_DES_DOCSIS_TYPE:
605 n_test_cases = sizeof(des_docsis_test_cases) /
606 sizeof(des_docsis_test_cases[0]);
607 tcs = des_docsis_test_cases;
609 case BLKCIPHER_AUTHONLY_TYPE:
610 n_test_cases = sizeof(hash_test_cases) /
611 sizeof(hash_test_cases[0]);
612 tcs = hash_test_cases;
618 if (driver_id == aesni_mb_pmd)
619 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MB;
620 else if (driver_id == qat_pmd)
621 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT;
622 else if (driver_id == openssl_pmd)
623 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL;
624 else if (driver_id == armv8_pmd)
625 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_ARMV8;
626 else if (driver_id == scheduler_pmd)
627 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER;
628 else if (driver_id == dpaa2_sec_pmd)
629 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC;
630 else if (driver_id == dpaa_sec_pmd)
631 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC;
632 else if (driver_id == mrvl_pmd)
633 target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MRVL;
635 TEST_ASSERT(0, "Unrecognized cryptodev type");
637 for (i = 0; i < n_test_cases; i++) {
638 const struct blockcipher_test_case *tc = &tcs[i];
640 if (!(tc->pmd_mask & target_pmd_mask))
643 status = test_blockcipher_one_case(tc, mbuf_pool, op_mpool,
644 sess_mpool, dev_id, driver_id, test_msg);
646 printf(" %u) TestCase %s %s\n", test_index ++,
647 tc->test_descr, test_msg);
649 if (status != TEST_SUCCESS) {
650 if (overall_status == TEST_SUCCESS)
651 overall_status = status;
653 if (tc->feature_mask & BLOCKCIPHER_TEST_FEATURE_STOPPER)
658 return overall_status;