| 706 | } |
| 707 | |
| 708 | static int |
| 709 | create_sa(enum rte_security_session_action_type action_type, |
| 710 | uint32_t replay_win_sz, uint64_t flags, uint32_t j) |
| 711 | { |
| 712 | struct ipsec_testsuite_params *ts = &testsuite_params; |
| 713 | struct ipsec_unitest_params *ut = &unittest_params; |
| 714 | size_t sz; |
| 715 | int rc; |
| 716 | |
| 717 | memset(&ut->ss[j], 0, sizeof(ut->ss[j])); |
| 718 | |
| 719 | rc = fill_ipsec_param(replay_win_sz, flags); |
| 720 | if (rc != 0) |
| 721 | return TEST_FAILED; |
| 722 | |
| 723 | /* create rte_ipsec_sa*/ |
| 724 | sz = rte_ipsec_sa_size(&ut->sa_prm); |
| 725 | TEST_ASSERT(sz > 0, "rte_ipsec_sa_size() failed\n"); |
| 726 | |
| 727 | ut->ss[j].sa = rte_zmalloc(NULL, sz, RTE_CACHE_LINE_SIZE); |
| 728 | TEST_ASSERT_NOT_NULL(ut->ss[j].sa, |
| 729 | "failed to allocate memory for rte_ipsec_sa\n"); |
| 730 | |
| 731 | ut->ss[j].type = action_type; |
| 732 | rc = create_session(ut, &ts->qp_conf, ts->valid_dev, j); |
| 733 | if (rc != 0) |
| 734 | return rc; |
| 735 | |
| 736 | rc = rte_ipsec_sa_init(ut->ss[j].sa, &ut->sa_prm, sz); |
| 737 | rc = (rc > 0 && (uint32_t)rc <= sz) ? 0 : -EINVAL; |
| 738 | if (rc == 0) |
| 739 | rc = rte_ipsec_session_prepare(&ut->ss[j]); |
| 740 | |
| 741 | return rc; |
| 742 | } |
| 743 | |
| 744 | static int |
| 745 | crypto_dequeue_burst(uint16_t num_pkts) |
no test coverage detected