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

Function rte_malloc_virt2iova

dpdk/lib/eal/common/rte_malloc.c:358–378  ·  view source on GitHub ↗

* Return the IO address of a virtual address obtained through rte_malloc */

Source from the content-addressed store, hash-verified

356 * Return the IO address of a virtual address obtained through rte_malloc
357 */
358rte_iova_t
359rte_malloc_virt2iova(const void *addr)
360{
361 const struct rte_memseg *ms;
362 struct malloc_elem *elem = malloc_elem_from_data(addr);
363
364 if (elem == NULL)
365 return RTE_BAD_IOVA;
366
367 if (!elem->msl->external && rte_eal_iova_mode() == RTE_IOVA_VA)
368 return (uintptr_t) addr;
369
370 ms = rte_mem_virt2memseg(addr, elem->msl);
371 if (ms == NULL)
372 return RTE_BAD_IOVA;
373
374 if (ms->iova == RTE_BAD_IOVA)
375 return RTE_BAD_IOVA;
376
377 return ms->iova + RTE_PTR_DIFF(addr, ms->addr);
378}
379
380static struct malloc_heap *
381find_named_heap(const char *name)

Callers 15

virtio_dev_extbuf_allocFunction · 0.85
dma_afu_buf_allocFunction · 0.85
nlb_afu_ctx_initFunction · 0.85
dma_afu_ctx_initFunction · 0.85
he_lpbk_ctx_initFunction · 0.85
eth_ark_rx_hw_setupFunction · 0.85

Calls 3

malloc_elem_from_dataFunction · 0.85
rte_eal_iova_modeFunction · 0.85
rte_mem_virt2memsegFunction · 0.85

Tested by 7

parse_entryFunction · 0.68
init_op_data_objsFunction · 0.68
test_dma_completedFunction · 0.68
operation_createFunction · 0.68
prepare_aead_opFunction · 0.68