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

Function idpf_alloc_dma_mem

dpdk/drivers/common/idpf/base/idpf_osdep.h:230–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228struct idpf_hw;
229
230static inline void *
231idpf_alloc_dma_mem(__rte_unused struct idpf_hw *hw,
232 struct idpf_dma_mem *mem, u64 size)
233{
234 const struct rte_memzone *mz = NULL;
235 char z_name[RTE_MEMZONE_NAMESIZE];
236
237 if (!mem)
238 return NULL;
239
240 snprintf(z_name, sizeof(z_name), "idpf_dma_%"PRIu64, rte_rand());
241 mz = rte_memzone_reserve_aligned(z_name, size, SOCKET_ID_ANY,
242 RTE_MEMZONE_IOVA_CONTIG, RTE_PGSIZE_4K);
243 if (!mz)
244 return NULL;
245
246 mem->size = size;
247 mem->va = mz->addr;
248 mem->pa = mz->iova;
249 mem->zone = (const void *)mz;
250 memset(mem->va, 0, size);
251
252 return mem->va;
253}
254
255static inline void
256idpf_free_dma_mem(__rte_unused struct idpf_hw *hw,

Callers 6

cpfl_cfgq_setupFunction · 0.85
cpfl_alloc_dma_mem_batchFunction · 0.85
idpf_send_vc_msgFunction · 0.85
idpf_send_msg_to_cpFunction · 0.85
idpf_ctlq_alloc_bufsFunction · 0.85

Calls 4

snprintfFunction · 0.85
rte_randFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected