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

Function hva_to_gpa

dpdk/lib/vhost/vhost.h:804–822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804static __rte_always_inline uint64_t
805hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
806{
807 struct rte_vhost_mem_region *r;
808 uint32_t i;
809
810 if (unlikely(!dev || !dev->mem))
811 return 0;
812
813 for (i = 0; i < dev->mem->nregions; i++) {
814 r = &dev->mem->regions[i];
815
816 if (vva >= r->host_user_addr &&
817 vva + len < r->host_user_addr + r->size) {
818 return r->guest_phys_addr + vva - r->host_user_addr;
819 }
820 }
821 return 0;
822}
823
824static __rte_always_inline struct virtio_net *
825get_device(int vid)

Callers 3

__vhost_log_write_iovaFunction · 0.70
translate_log_addrFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected