From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 006E92986 for ; Fri, 5 May 2017 18:09:26 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2017 09:09:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,293,1491289200"; d="scan'208";a="964885427" Received: from dpdk06.sh.intel.com ([10.239.129.195]) by orsmga003.jf.intel.com with ESMTP; 05 May 2017 09:09:23 -0700 From: Jianfeng Tan To: dev@dpdk.org Cc: sergio.gonzalez.monroy@intel.com, thomas@monjalon.net, benjamin.walker@intel.com, Jianfeng Tan Date: Fri, 5 May 2017 16:10:13 +0000 Message-Id: <1494000613-3709-1-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] eal/linux: fix phys addresses not avaialbe for Xen dom0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 16:09:27 -0000 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 --- lib/librte_eal/linuxapp/eal/eal_memory.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 618a09b..ebe0683 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, -- 2.7.4