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

Function rte_vhost_get_mem_table

dpdk/lib/vhost/vhost.c:961–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959}
960
961int
962rte_vhost_get_mem_table(int vid, struct rte_vhost_memory **mem)
963{
964 struct virtio_net *dev;
965 struct rte_vhost_memory *m;
966 size_t size;
967
968 dev = get_device(vid);
969 if (dev == NULL || mem == NULL)
970 return -1;
971
972 size = dev->mem->nregions * sizeof(struct rte_vhost_mem_region);
973 m = malloc(sizeof(struct rte_vhost_memory) + size);
974 if (!m)
975 return -1;
976
977 m->nregions = dev->mem->nregions;
978 memcpy(m->regions, dev->mem->regions, size);
979 *mem = m;
980
981 return 0;
982}
983
984int
985rte_vhost_get_vhost_vring(int vid, uint16_t vring_idx,

Callers 9

nfp_vdpa_dma_mapFunction · 0.85
nfp_vdpa_qva_to_gpaFunction · 0.85
ifcvf_dma_mapFunction · 0.85
hva_to_gpaFunction · 0.85
hva_to_gpaFunction · 0.85
sfc_vdpa_dma_mapFunction · 0.85
vs_vhost_net_setupFunction · 0.85
new_deviceFunction · 0.85

Calls 3

get_deviceFunction · 0.85
mallocFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected