| 329 | } |
| 330 | |
| 331 | static int |
| 332 | create_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 | |
| 379 | static void |
| 380 | fill_ipsec_sa_out(const struct ipsec_test_cfg *test_cfg, |
no test coverage detected