| 369 | } |
| 370 | |
| 371 | static inline uint32_t |
| 372 | dma_dequeue(struct rte_mbuf *src[], struct rte_mbuf *dst[], uint32_t num, |
| 373 | uint16_t dev_id) |
| 374 | { |
| 375 | struct dma_bufs *dma = &dma_bufs[dev_id]; |
| 376 | uint16_t nb_dq, filled; |
| 377 | /* Dequeue the mbufs from DMA device. Since all memory |
| 378 | * is DPDK pinned memory and therefore all addresses should |
| 379 | * be valid, we don't check for copy errors |
| 380 | */ |
| 381 | nb_dq = rte_dma_completed(dev_id, 0, num, NULL, NULL); |
| 382 | |
| 383 | /* Return early if no work to do */ |
| 384 | if (unlikely(nb_dq == 0)) |
| 385 | return nb_dq; |
| 386 | |
| 387 | /* Populate pkts_copy with the copies bufs from dma->copies for tx */ |
| 388 | for (filled = 0; filled < nb_dq; filled++) { |
| 389 | src[filled] = dma->bufs[(dma->sent + filled) & MBUF_RING_MASK]; |
| 390 | dst[filled] = dma->copies[(dma->sent + filled) & MBUF_RING_MASK]; |
| 391 | } |
| 392 | dma->sent += nb_dq; |
| 393 | |
| 394 | return filled; |
| 395 | |
| 396 | } |
| 397 | |
| 398 | /* Receive packets on one port and enqueue to dmadev or rte_ring. 8< */ |
| 399 | static void |
no test coverage detected