| 872 | } |
| 873 | |
| 874 | static int |
| 875 | create_test_conf_from_index(const int index, struct pdcp_test_conf *conf, |
| 876 | enum pdcp_test_suite_type suite_type) |
| 877 | { |
| 878 | const struct pdcp_testsuite_params *ts_params = &testsuite_params; |
| 879 | struct rte_crypto_sym_xform c_xfrm, a_xfrm; |
| 880 | const uint8_t *data, *expected; |
| 881 | uint32_t sn, expected_len; |
| 882 | int pdcp_hdr_sz; |
| 883 | |
| 884 | memset(conf, 0, sizeof(*conf)); |
| 885 | memset(&c_xfrm, 0, sizeof(c_xfrm)); |
| 886 | memset(&a_xfrm, 0, sizeof(a_xfrm)); |
| 887 | |
| 888 | conf->entity.sess_mpool = ts_params->sess_pool; |
| 889 | conf->entity.cop_pool = ts_params->cop_pool; |
| 890 | conf->entity.ctrl_pdu_pool = ts_params->mbuf_pool; |
| 891 | conf->entity.pdcp_xfrm.bearer = pdcp_test_bearer_get(suite_type, index); |
| 892 | conf->entity.pdcp_xfrm.en_ordering = 0; |
| 893 | conf->entity.pdcp_xfrm.remove_duplicates = 0; |
| 894 | conf->entity.pdcp_xfrm.domain = pdcp_test_param_domain_get(suite_type, index); |
| 895 | conf->entity.t_reordering = t_reorder_timer; |
| 896 | |
| 897 | if (pdcp_test_packet_direction_get(suite_type, index) == PDCP_DIR_UPLINK) |
| 898 | conf->entity.pdcp_xfrm.pkt_dir = RTE_SECURITY_PDCP_UPLINK; |
| 899 | else |
| 900 | conf->entity.pdcp_xfrm.pkt_dir = RTE_SECURITY_PDCP_DOWNLINK; |
| 901 | |
| 902 | conf->entity.pdcp_xfrm.sn_size = pdcp_test_data_sn_size_get(suite_type, index); |
| 903 | |
| 904 | /* Zero initialize unsupported flags */ |
| 905 | conf->entity.pdcp_xfrm.hfn_threshold = 0; |
| 906 | conf->entity.pdcp_xfrm.hfn_ovrd = 0; |
| 907 | |
| 908 | conf->entity.pdcp_xfrm.sdap_enabled = (suite_type == PDCP_TEST_SUITE_TY_SDAP); |
| 909 | |
| 910 | c_xfrm.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 911 | c_xfrm.cipher.algo = pdcp_test_param_cipher_alg_get(suite_type, index); |
| 912 | c_xfrm.cipher.key.length = pdcp_test_param_cipher_key_len_get(suite_type, index); |
| 913 | c_xfrm.cipher.key.data = pdcp_test_crypto_key_get(suite_type, index); |
| 914 | |
| 915 | a_xfrm.type = RTE_CRYPTO_SYM_XFORM_AUTH; |
| 916 | |
| 917 | if (pdcp_test_param_auth_alg_get(suite_type, index) == 0) { |
| 918 | conf->is_integrity_protected = false; |
| 919 | } else { |
| 920 | a_xfrm.auth.algo = pdcp_test_param_auth_alg_get(suite_type, index); |
| 921 | a_xfrm.auth.key.data = pdcp_test_auth_key_get(suite_type, index); |
| 922 | a_xfrm.auth.key.length = pdcp_test_param_auth_key_len_get(suite_type, index); |
| 923 | conf->is_integrity_protected = true; |
| 924 | } |
| 925 | |
| 926 | pdcp_hdr_sz = pdcp_hdr_size_get(pdcp_test_data_sn_size_get(suite_type, index)); |
| 927 | |
| 928 | /* |
| 929 | * Uplink means PDCP entity is configured for transmit. Downlink means PDCP entity is |
| 930 | * configured for receive. When integrity protecting is enabled, PDCP always performs |
| 931 | * digest-encrypted or auth-gen-encrypt for uplink (and decrypt-auth-verify for downlink). |
no test coverage detected