| 885 | } |
| 886 | |
| 887 | static int |
| 888 | crypto_ipsec_2sa(void) |
| 889 | { |
| 890 | struct ipsec_testsuite_params *ts_params = &testsuite_params; |
| 891 | struct ipsec_unitest_params *ut_params = &unittest_params; |
| 892 | struct rte_ipsec_group grp[BURST_SIZE]; |
| 893 | uint32_t k, ng, i, r; |
| 894 | |
| 895 | for (i = 0; i < BURST_SIZE; i++) { |
| 896 | r = i % 2; |
| 897 | /* call crypto prepare */ |
| 898 | k = rte_ipsec_pkt_crypto_prepare(&ut_params->ss[r], |
| 899 | ut_params->ibuf + i, ut_params->cop + i, 1); |
| 900 | if (k != 1) { |
| 901 | RTE_LOG(ERR, USER1, |
| 902 | "rte_ipsec_pkt_crypto_prepare fail\n"); |
| 903 | return TEST_FAILED; |
| 904 | } |
| 905 | k = rte_cryptodev_enqueue_burst(ts_params->valid_dev, 0, |
| 906 | ut_params->cop + i, 1); |
| 907 | if (k != 1) { |
| 908 | RTE_LOG(ERR, USER1, |
| 909 | "rte_cryptodev_enqueue_burst fail\n"); |
| 910 | return TEST_FAILED; |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | if (crypto_dequeue_burst(BURST_SIZE) == TEST_FAILED) |
| 915 | return TEST_FAILED; |
| 916 | |
| 917 | ng = rte_ipsec_pkt_crypto_group( |
| 918 | (const struct rte_crypto_op **)(uintptr_t)ut_params->cop, |
| 919 | ut_params->obuf, grp, BURST_SIZE); |
| 920 | if (ng != BURST_SIZE) { |
| 921 | RTE_LOG(ERR, USER1, "rte_ipsec_pkt_crypto_group fail ng=%d\n", |
| 922 | ng); |
| 923 | return TEST_FAILED; |
| 924 | } |
| 925 | |
| 926 | /* call crypto process */ |
| 927 | for (i = 0; i < ng; i++) { |
| 928 | k = rte_ipsec_pkt_process(grp[i].id.ptr, grp[i].m, grp[i].cnt); |
| 929 | if (k != grp[i].cnt) { |
| 930 | dump_grp_pkt(i, grp, k); |
| 931 | return TEST_FAILED; |
| 932 | } |
| 933 | } |
| 934 | return TEST_SUCCESS; |
| 935 | } |
| 936 | |
| 937 | #define PKT_4 4 |
| 938 | #define PKT_12 12 |
no test coverage detected