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

Function dma_enqueue_packets

dpdk/examples/dma/dmafwd.c:320–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318/* >8 End of perform packet copy there is a user-defined function. */
319
320static uint32_t
321dma_enqueue_packets(struct rte_mbuf *pkts[], struct rte_mbuf *pkts_copy[],
322 uint32_t nb_rx, uint16_t dev_id)
323{
324 struct dma_bufs *dma = &dma_bufs[dev_id];
325 int ret;
326 uint32_t i;
327
328 for (i = 0; i < nb_rx; i++) {
329 /* Perform data copy */
330 ret = rte_dma_copy(dev_id, 0,
331 rte_pktmbuf_iova(pkts[i]),
332 rte_pktmbuf_iova(pkts_copy[i]),
333 RTE_MAX(rte_pktmbuf_data_len(pkts[i]),
334 force_min_copy_size),
335 0);
336
337 if (ret < 0)
338 break;
339
340 dma->bufs[ret & MBUF_RING_MASK] = pkts[i];
341 dma->copies[ret & MBUF_RING_MASK] = pkts_copy[i];
342 }
343
344 ret = i;
345 return ret;
346}
347
348static inline uint32_t
349dma_enqueue(struct rte_mbuf *pkts[], struct rte_mbuf *pkts_copy[],

Callers 1

dma_enqueueFunction · 0.85

Calls 1

rte_dma_copyFunction · 0.85

Tested by

no test coverage detected