From: Jianfeng Tan Date: Fri, 5 May 2017 16:10:13 +0000 (+0000) Subject: xen: fix physical address availability in dom0 X-Git-Tag: spdx-start~3239 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f48a094b6105ce88c1d08fba0f0bf7b453bdaadd;p=dpdk.git xen: fix physical address availability in dom0 When physical NICs are binded to igb_uio/uio-pci-generic, they cannot be used in DPDK app in Xen dom0. Due to (1) a restriction that phys addresses should be availabe is added by commit cdc242f260e7 ("eal/linux: support running as unprivileged user"), (2) and previous implementation of the test to check if phys addresses are available (using a variable on the stack) just works for non-Xen environment. Actually, for Xen dom0, the physical addresses are always available if the memory is initialized successfully.. To fix it, we add an precheck to bypass the physical address availability test. Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user") Signed-off-by: Jianfeng Tan --- diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 618a09b429..ebe068334e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -133,6 +133,10 @@ test_phys_addrs_available(void) uint64_t tmp; phys_addr_t physaddr; + /* For dom0, phys addresses can always be available */ + if (rte_xen_dom0_supported()) + return; + physaddr = rte_mem_virt2phy(&tmp); if (physaddr == RTE_BAD_PHYS_ADDR) { RTE_LOG(ERR, EAL,