X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinuxapp%2Feal%2Feal_memory.c;h=16a181c361f105c23c2c000d36bacdd9199a5097;hb=HEAD;hp=284758ac40bd7e6c356c4c7cb867ab820813881b;hpb=7ba49d39f14cef4fbea95521b1224f5539321dd5;p=dpdk.git diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 284758ac40..16a181c361 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -128,9 +128,6 @@ rte_mem_virt2phy(const void *virtaddr) int page_size; off_t offset; - if (rte_eal_iova_mode() == RTE_IOVA_VA) - return (uintptr_t)virtaddr; - /* Cannot parse /proc/self/pagemap, no need to log errors everywhere */ if (!phys_addrs_available) return RTE_BAD_IOVA; @@ -180,6 +177,14 @@ rte_mem_virt2phy(const void *virtaddr) return physaddr; } +rte_iova_t +rte_mem_virt2iova(const void *virtaddr) +{ + if (rte_eal_iova_mode() == RTE_IOVA_VA) + return (uintptr_t)virtaddr; + return rte_mem_virt2phy(virtaddr); +} + /* * For each hugepage in hugepg_tbl, fill the physaddr value. We find * it by browsing the /proc/self/pagemap special file. @@ -339,7 +344,7 @@ void numa_error(char *where) * hugetlbfs, then mmap() hugepage_sz data in it. If orig is set, the * virtual address is stored in hugepg_tbl[i].orig_va, else it is stored * in hugepg_tbl[i].final_va. The second mapping (when orig is 0) tries to - * map continguous physical blocks in contiguous virtual blocks. + * map contiguous physical blocks in contiguous virtual blocks. */ static unsigned map_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi,