MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_process_packets

Function test_process_packets

dpdk/app/test/test_pdcp.c:1092–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1090}
1091
1092static uint16_t
1093test_process_packets(const struct rte_pdcp_entity *pdcp_entity, uint8_t cdev_id,
1094 struct rte_mbuf *in_mb[], uint16_t nb_in,
1095 struct rte_mbuf *out_mb[], uint16_t *nb_err)
1096{
1097 struct rte_crypto_op *cop, *cop_out;
1098 struct rte_pdcp_group grp[1];
1099 uint16_t nb_success, nb_grp;
1100 struct rte_mbuf *mbuf, *mb;
1101
1102 if (nb_in != 1)
1103 return -ENOTSUP;
1104
1105 mbuf = in_mb[0];
1106
1107 nb_success = rte_pdcp_pkt_pre_process(pdcp_entity, &mbuf, &cop_out, 1, nb_err);
1108 if (nb_success != 1 || *nb_err != 0) {
1109 RTE_LOG(ERR, USER1, "Could not pre process PDCP packet\n");
1110 return TEST_FAILED;
1111 }
1112
1113#ifdef VEC_DUMP
1114 printf("Pre-processed vector:\n");
1115 rte_pktmbuf_dump(stdout, mbuf, rte_pktmbuf_pkt_len(mbuf));
1116#endif
1117
1118 cop = process_crypto_request(cdev_id, cop_out);
1119 if (cop == NULL) {
1120 RTE_LOG(ERR, USER1, "Could not process crypto request\n");
1121 return -EIO;
1122 }
1123
1124 grp[0].id.val = 0;
1125
1126 nb_grp = rte_pdcp_pkt_crypto_group(&cop_out, &mb, grp, 1);
1127 if (nb_grp != 1 || grp[0].cnt != 1) {
1128 RTE_LOG(ERR, USER1, "Could not group PDCP crypto results\n");
1129 return -ENOTRECOVERABLE;
1130 }
1131
1132 if ((uintptr_t)pdcp_entity != grp[0].id.val) {
1133 RTE_LOG(ERR, USER1, "PDCP entity not matching the one from crypto_op\n");
1134 return -ENOTRECOVERABLE;
1135 }
1136
1137#ifdef VEC_DUMP
1138 printf("Crypto processed vector:\n");
1139 rte_pktmbuf_dump(stdout, cop->sym->m_dst, rte_pktmbuf_pkt_len(mbuf));
1140#endif
1141
1142 return rte_pdcp_pkt_post_process(grp[0].id.ptr, grp[0].m, out_mb, grp[0].cnt, nb_err);
1143}
1144
1145static struct rte_mbuf*
1146mbuf_from_data_create(uint8_t *data, uint16_t data_len)

Calls 6

rte_pdcp_pkt_pre_processFunction · 0.85
rte_pktmbuf_dumpFunction · 0.85
process_crypto_requestFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected