DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jianfeng Tan <jianfeng.tan@intel.com>
To: dev@dpdk.org
Cc: sergio.gonzalez.monroy@intel.com, thomas@monjalon.net,
	benjamin.walker@intel.com, Jianfeng Tan <jianfeng.tan@intel.com>
Subject: [dpdk-dev] [PATCH] eal/linux: fix phys addresses not avaialbe for Xen dom0
Date: Fri,  5 May 2017 16:10:13 +0000	[thread overview]
Message-ID: <1494000613-3709-1-git-send-email-jianfeng.tan@intel.com> (raw)

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 <jianfeng.tan@intel.com>
---
 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

             reply	other threads:[~2017-05-05 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 16:10 Jianfeng Tan [this message]
2017-05-10 12:58 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494000613-3709-1-git-send-email-jianfeng.tan@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=benjamin.walker@intel.com \
    --cc=dev@dpdk.org \
    --cc=sergio.gonzalez.monroy@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).