DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <thomas@monjalon.net>, <anatoly.burakov@intel.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v3] eal: enable vfio independent of PCI bus
Date: Wed, 11 Oct 2017 12:12:18 +0530	[thread overview]
Message-ID: <1507704138-17237-1-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1507375221-16271-1-git-send-email-hemant.agrawal@nxp.com>

VFIO may be used by buses other than PCI. This patch enables
the VFIO on the basis of vfio root presence.

Since vfio_enable should be called only once, pci_vfio_enable
is also removed.

A debug print is added in case vfio_pci module is not present.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
v3: changed the vfio enable for vfio root instead of pci

v2: enabled VFIO, independent of no-pci flag as suggested by Thomas
    removed fslmc specific vfio enable

 lib/librte_eal/linuxapp/eal/eal.c          | 8 ++++++--
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 6 ------
 lib/librte_eal/linuxapp/eal/eal_vfio.c     | 2 +-
 lib/librte_eal/linuxapp/eal/eal_vfio.h     | 1 -
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index ec37c52..e0aceba 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -710,9 +710,13 @@ static int rte_eal_vfio_setup(void)
 {
 	int vfio_enabled = 0;
 
+	if (vfio_enable("vfio"))
+		return -1;
+	vfio_enabled = vfio_is_enabled("vfio");
+
 	if (!internal_config.no_pci) {
-		pci_vfio_enable();
-		vfio_enabled |= pci_vfio_is_enabled();
+		if (!pci_vfio_is_enabled())
+			RTE_LOG(DEBUG, EAL, "vfio pci modules not loaded\n");
 	}
 
 	if (vfio_enabled) {
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index aa9d96e..fc84705 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -661,12 +661,6 @@ pci_vfio_ioport_unmap(struct rte_pci_ioport *p)
 }
 
 int
-pci_vfio_enable(void)
-{
-	return vfio_enable("vfio_pci");
-}
-
-int
 pci_vfio_is_enabled(void)
 {
 	return vfio_is_enabled("vfio_pci");
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c
index b32cd09..ebb71f0 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
@@ -489,7 +489,7 @@ vfio_enable(const char *modname)
 	/* inform the user that we are probing for VFIO */
 	RTE_LOG(INFO, EAL, "Probing VFIO support...\n");
 
-	/* check if vfio-pci module is loaded */
+	/* check if vfio module is loaded */
 	vfio_available = rte_eal_check_module(modname);
 
 	/* return error directly */
diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h
index 26ea8e1..4bab363 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.h
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h
@@ -207,7 +207,6 @@ int vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd);
 int vfio_enable(const char *modname);
 int vfio_is_enabled(const char *modname);
 
-int pci_vfio_enable(void);
 int pci_vfio_is_enabled(void);
 
 int vfio_mp_sync_setup(void);
-- 
2.7.4

  parent reply	other threads:[~2017-10-11  6:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 11:48 [dpdk-dev] [PATCH] eal: fslmc bus need vfio enabled for non PCI case as well Hemant Agrawal
2017-10-05 23:41 ` Thomas Monjalon
2017-10-06 16:22   ` Hemant Agrawal
2017-10-06 17:08     ` Thomas Monjalon
2017-10-07 11:22       ` Hemant Agrawal
2017-10-07 11:20 ` [dpdk-dev] [PATCH v2] eal: enable vfio independent of no PCI flag Hemant Agrawal
2017-10-07 11:37   ` Thomas Monjalon
2017-10-10 13:46     ` Hemant Agrawal
2017-10-10 16:27       ` Thomas Monjalon
2017-10-11  6:42   ` Hemant Agrawal [this message]
2017-10-23  6:33     ` [dpdk-dev] FW: [PATCH v3] eal: enable vfio independent of PCI bus Hemant Agrawal
2017-10-23 11:00       ` Burakov, Anatoly
2017-10-23 11:47     ` [dpdk-dev] " Burakov, Anatoly
2017-10-23 22:32       ` 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=1507704138-17237-1-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --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).