| 765 | } |
| 766 | |
| 767 | static int |
| 768 | crypto_ipsec(uint16_t num_pkts) |
| 769 | { |
| 770 | struct ipsec_testsuite_params *ts_params = &testsuite_params; |
| 771 | struct ipsec_unitest_params *ut_params = &unittest_params; |
| 772 | uint32_t k, ng; |
| 773 | struct rte_ipsec_group grp[1]; |
| 774 | |
| 775 | /* call crypto prepare */ |
| 776 | k = rte_ipsec_pkt_crypto_prepare(&ut_params->ss[0], ut_params->ibuf, |
| 777 | ut_params->cop, num_pkts); |
| 778 | if (k != num_pkts) { |
| 779 | RTE_LOG(ERR, USER1, "rte_ipsec_pkt_crypto_prepare fail\n"); |
| 780 | return TEST_FAILED; |
| 781 | } |
| 782 | |
| 783 | k = rte_cryptodev_enqueue_burst(ts_params->valid_dev, 0, |
| 784 | ut_params->cop, num_pkts); |
| 785 | if (k != num_pkts) { |
| 786 | RTE_LOG(ERR, USER1, "rte_cryptodev_enqueue_burst fail\n"); |
| 787 | return TEST_FAILED; |
| 788 | } |
| 789 | |
| 790 | if (crypto_dequeue_burst(num_pkts) == TEST_FAILED) |
| 791 | return TEST_FAILED; |
| 792 | |
| 793 | ng = rte_ipsec_pkt_crypto_group( |
| 794 | (const struct rte_crypto_op **)(uintptr_t)ut_params->cop, |
| 795 | ut_params->obuf, grp, num_pkts); |
| 796 | if (ng != 1 || |
| 797 | grp[0].m[0] != ut_params->obuf[0] || |
| 798 | grp[0].cnt != num_pkts || |
| 799 | grp[0].id.ptr != &ut_params->ss[0]) { |
| 800 | RTE_LOG(ERR, USER1, "rte_ipsec_pkt_crypto_group fail\n"); |
| 801 | return TEST_FAILED; |
| 802 | } |
| 803 | |
| 804 | /* call crypto process */ |
| 805 | k = rte_ipsec_pkt_process(grp[0].id.ptr, grp[0].m, grp[0].cnt); |
| 806 | if (k != num_pkts) { |
| 807 | RTE_LOG(ERR, USER1, "rte_ipsec_pkt_process fail\n"); |
| 808 | return TEST_FAILED; |
| 809 | } |
| 810 | |
| 811 | return TEST_SUCCESS; |
| 812 | } |
| 813 | |
| 814 | static int |
| 815 | lksd_proto_ipsec(uint16_t num_pkts) |
no test coverage detected