MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_ipsec_proto_all

Function test_ipsec_proto_all

dpdk/app/test/test_cryptodev.c:10492–10562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10490}
10491
10492static int
10493test_ipsec_proto_all(const struct ipsec_test_flags *flags)
10494{
10495 struct ipsec_test_data td_outb[IPSEC_TEST_PACKETS_MAX];
10496 struct ipsec_test_data td_inb[IPSEC_TEST_PACKETS_MAX];
10497 unsigned int i, nb_pkts = 1, pass_cnt = 0;
10498 int ret;
10499
10500 if (flags->iv_gen ||
10501 flags->sa_expiry_pkts_soft ||
10502 flags->sa_expiry_pkts_hard)
10503 nb_pkts = IPSEC_TEST_PACKETS_MAX;
10504
10505 for (i = 0; i < RTE_DIM(alg_list); i++) {
10506 test_ipsec_td_prepare(alg_list[i].param1,
10507 alg_list[i].param2,
10508 flags,
10509 td_outb,
10510 nb_pkts);
10511
10512 if (!td_outb->aead) {
10513 enum rte_crypto_cipher_algorithm cipher_alg;
10514 enum rte_crypto_auth_algorithm auth_alg;
10515
10516 cipher_alg = td_outb->xform.chain.cipher.cipher.algo;
10517 auth_alg = td_outb->xform.chain.auth.auth.algo;
10518
10519 if (td_outb->aes_gmac && cipher_alg != RTE_CRYPTO_CIPHER_NULL)
10520 continue;
10521
10522 /* ICV is not applicable for NULL auth */
10523 if (flags->icv_corrupt &&
10524 auth_alg == RTE_CRYPTO_AUTH_NULL)
10525 continue;
10526
10527 /* IV is not applicable for NULL cipher */
10528 if (flags->iv_gen &&
10529 cipher_alg == RTE_CRYPTO_CIPHER_NULL)
10530 continue;
10531 }
10532
10533 ret = test_ipsec_proto_process(td_outb, td_inb, nb_pkts, true,
10534 flags);
10535 if (ret == TEST_SKIPPED)
10536 continue;
10537
10538 if (ret == TEST_FAILED)
10539 return TEST_FAILED;
10540
10541 test_ipsec_td_update(td_inb, td_outb, nb_pkts, flags);
10542
10543 ret = test_ipsec_proto_process(td_inb, NULL, nb_pkts, true,
10544 flags);
10545 if (ret == TEST_SKIPPED)
10546 continue;
10547
10548 if (ret == TEST_FAILED)
10549 return TEST_FAILED;

Calls 4

test_ipsec_td_prepareFunction · 0.85
test_ipsec_proto_processFunction · 0.85
test_ipsec_td_updateFunction · 0.85
test_ipsec_display_algFunction · 0.85

Tested by

no test coverage detected