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

Function dma_dequeue

dpdk/examples/dma/dmafwd.c:371–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371static inline uint32_t
372dma_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< */
399static void

Callers 1

dma_rx_portFunction · 0.85

Calls 1

rte_dma_completedFunction · 0.85

Tested by

no test coverage detected