| 1053 | } |
| 1054 | |
| 1055 | static struct rte_pdcp_entity* |
| 1056 | test_entity_create(const struct pdcp_test_conf *t_conf, int *rc) |
| 1057 | { |
| 1058 | struct rte_pdcp_entity *pdcp_entity; |
| 1059 | int ret; |
| 1060 | |
| 1061 | if (t_conf->entity.pdcp_xfrm.sn_size != RTE_SECURITY_PDCP_SN_SIZE_12 && |
| 1062 | t_conf->entity.pdcp_xfrm.sn_size != RTE_SECURITY_PDCP_SN_SIZE_18) { |
| 1063 | *rc = -ENOTSUP; |
| 1064 | return NULL; |
| 1065 | } |
| 1066 | |
| 1067 | if (t_conf->entity.dev_id == CDEV_INVALID_ID) { |
| 1068 | RTE_LOG(DEBUG, USER1, "Could not find device with required capabilities\n"); |
| 1069 | *rc = -ENOTSUP; |
| 1070 | return NULL; |
| 1071 | } |
| 1072 | |
| 1073 | ret = cryptodev_init(t_conf->entity.dev_id); |
| 1074 | if (ret) { |
| 1075 | *rc = ret; |
| 1076 | RTE_LOG(DEBUG, USER1, "Could not initialize cryptodev\n"); |
| 1077 | return NULL; |
| 1078 | } |
| 1079 | |
| 1080 | rte_errno = 0; |
| 1081 | |
| 1082 | pdcp_entity = rte_pdcp_entity_establish(&t_conf->entity); |
| 1083 | if (pdcp_entity == NULL) { |
| 1084 | *rc = -rte_errno; |
| 1085 | RTE_LOG(DEBUG, USER1, "Could not establish PDCP entity\n"); |
| 1086 | return NULL; |
| 1087 | } |
| 1088 | |
| 1089 | return pdcp_entity; |
| 1090 | } |
| 1091 | |
| 1092 | static uint16_t |
| 1093 | test_process_packets(const struct rte_pdcp_entity *pdcp_entity, uint8_t cdev_id, |
no test coverage detected