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

Function packet_prepare

dpdk/app/test/test_ipsec_perf.c:263–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263static int
264packet_prepare(struct rte_mbuf **buf, struct ipsec_sa *sa,
265 uint16_t num_pkts)
266{
267 uint64_t time_stamp;
268 uint16_t k = 0, i;
269
270 for (i = 0; i < num_pkts; i++) {
271
272 sa->cop[i] = rte_crypto_op_alloc(cop_pool,
273 RTE_CRYPTO_OP_TYPE_SYMMETRIC);
274
275 if (sa->cop[i] == NULL) {
276
277 RTE_LOG(ERR, USER1,
278 "Failed to allocate symmetric crypto op\n");
279
280 return k;
281 }
282 }
283
284 time_stamp = rte_rdtsc_precise();
285
286 k = rte_ipsec_pkt_crypto_prepare(&sa->ss[0], buf,
287 sa->cop, num_pkts);
288
289 time_stamp = rte_rdtsc_precise() - time_stamp;
290
291 if (k != num_pkts) {
292 RTE_LOG(ERR, USER1, "rte_ipsec_pkt_crypto_prepare fail\n");
293 return k;
294 }
295
296 sa->cnt.prepare_ticks_elapsed += time_stamp;
297 sa->cnt.nb_prepare_call++;
298 sa->cnt.nb_prepare_pkt += k;
299
300 for (i = 0; i < num_pkts; i++)
301 rte_crypto_op_free(sa->cop[i]);
302
303 return k;
304}
305
306static int
307packet_process(struct rte_mbuf **buf, struct ipsec_sa *sa,

Callers 1

create_trafficFunction · 0.85

Calls 4

rte_crypto_op_allocFunction · 0.85
rte_crypto_op_freeFunction · 0.85
rte_rdtsc_preciseFunction · 0.50

Tested by

no test coverage detected