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

Function create_traffic

dpdk/app/test/test_ipsec_perf.c:331–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331static int
332create_traffic(struct ipsec_sa *sa, struct rte_ring *deq_ring,
333 struct rte_ring *enq_ring, struct rte_ring *ring)
334{
335 struct rte_mbuf *mbuf[BURST_SIZE];
336 uint16_t num_pkts, n;
337
338 while (rte_ring_empty(deq_ring) == 0) {
339
340 num_pkts = rte_ring_sc_dequeue_burst(deq_ring, (void **)mbuf,
341 RTE_DIM(mbuf), NULL);
342
343 if (num_pkts == 0)
344 return TEST_FAILED;
345
346 n = packet_prepare(mbuf, sa, num_pkts);
347 if (n != num_pkts)
348 return TEST_FAILED;
349
350 num_pkts = rte_ring_sp_enqueue_burst(enq_ring, (void **)mbuf,
351 num_pkts, NULL);
352 if (num_pkts == 0)
353 return TEST_FAILED;
354 }
355
356 deq_ring = enq_ring;
357 enq_ring = ring;
358
359 while (rte_ring_empty(deq_ring) == 0) {
360
361 num_pkts = rte_ring_sc_dequeue_burst(deq_ring, (void **)mbuf,
362 RTE_DIM(mbuf), NULL);
363 if (num_pkts == 0)
364 return TEST_FAILED;
365
366 n = packet_process(mbuf, sa, num_pkts);
367 if (n != num_pkts)
368 return TEST_FAILED;
369
370 num_pkts = rte_ring_sp_enqueue_burst(enq_ring, (void **)mbuf,
371 num_pkts, NULL);
372 if (num_pkts == 0)
373 return TEST_FAILED;
374 }
375
376 return TEST_SUCCESS;
377}
378
379static void
380fill_ipsec_sa_out(const struct ipsec_test_cfg *test_cfg,

Callers 1

measure_performanceFunction · 0.85

Calls 5

rte_ring_emptyFunction · 0.85
packet_prepareFunction · 0.85
packet_processFunction · 0.85

Tested by

no test coverage detected