From: Gaetan Rivet <gaetan.rivet@6wind.com>
To: dev@dpdk.org
Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>,
Gaetan Rivet <gaetan.rivet@6wind.com>
Subject: [dpdk-dev] [PATCH v3 1/2] bus/pci: fix vfio mode
Date: Mon, 30 Oct 2017 17:36:52 +0100 [thread overview]
Message-ID: <8492fe4cf1a8d6f15d389c9148e4942f1d060a40.1509381300.git.gaetan.rivet@6wind.com> (raw)
In-Reply-To: <3195804eda227dde6bb6d80122b2af25e071e1c1.1509367736.git.gaetan.rivet@6wind.com>
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Revert back to using VFIO_PRESENT as a marker to enable compilation
of VFIO-related segments.
Fixes: 279b581c897d ("vfio: expose functions")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
In addition to simply re-defining VFIO_PRESENT, the previous #ifdef
removed in favor of RTE_EAL_VFIO must be switched back as well.
Not doing so would break compilation on kernels prior to 3.6.
Additionally, the following patch adds a warning for users.
This fix is left as-is, instead of a more involved solution like
Ferruh's. The reasoning behind it is that it should be made abundantly
clear that the VFIO_PRESENT symbol is defined in eal_vfio.h and
eal_vfio.h only, that it is a private EAL symbol that is currently
bleeding out of the EAL. It should be visible when those private symbols
will be removed from libs external to the EAL.
v3:
- Fix build by include eal_vfio.h in pci_init.h and pci.c as well.
drivers/bus/pci/linux/pci.c | 1 +
drivers/bus/pci/linux/pci_init.h | 4 +++-
drivers/bus/pci/linux/pci_vfio.c | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index cdf8106..d0ce020 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -46,6 +46,7 @@
#include "eal_private.h"
#include "eal_filesystem.h"
+#include "eal_vfio.h"
#include "private.h"
#include "pci_init.h"
diff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h
index 99d7a2e..3290cee 100644
--- a/drivers/bus/pci/linux/pci_init.h
+++ b/drivers/bus/pci/linux/pci_init.h
@@ -38,6 +38,8 @@
#include <rte_vfio.h>
+#include "eal_vfio.h"
+
/** IO resource type: */
#define IORESOURCE_IO 0x00000100
#define IORESOURCE_MEM 0x00000200
@@ -74,7 +76,7 @@ void pci_uio_ioport_write(struct rte_pci_ioport *p,
const void *data, size_t len, off_t offset);
int pci_uio_ioport_unmap(struct rte_pci_ioport *p);
-#ifdef RTE_EAL_VFIO
+#ifdef VFIO_PRESENT
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
#define RTE_PCI_MSIX_TABLE_BIR 0x7
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 360eed3..38d3792 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -48,6 +48,7 @@
#include <rte_vfio.h>
#include "eal_filesystem.h"
+#include "eal_vfio.h"
#include "pci_init.h"
#include "private.h"
@@ -62,7 +63,7 @@
* This file is only compiled if CONFIG_RTE_EAL_VFIO is set to "y".
*/
-#ifdef RTE_EAL_VFIO
+#ifdef VFIO_PRESENT
#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
#define PAGE_MASK (~(PAGE_SIZE - 1))
--
2.1.4
next prev parent reply other threads:[~2017-10-30 16:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-28 6:20 [dpdk-dev] [PATCH] " Jerin Jacob
2017-10-30 8:06 ` Gaëtan Rivet
2017-10-30 9:00 ` Ferruh Yigit
2017-10-30 9:17 ` Gaëtan Rivet
2017-10-30 9:27 ` Thomas Monjalon
2017-10-30 11:24 ` Thomas Monjalon
2017-10-30 16:57 ` Ferruh Yigit
2017-10-30 17:13 ` Gaëtan Rivet
2017-10-30 9:10 ` Jerin Jacob
2017-10-30 12:55 ` [dpdk-dev] [PATCH v2 1/2] " Gaetan Rivet
2017-10-30 12:55 ` [dpdk-dev] [PATCH v2 2/2] eal: warn user that VFIO is disabled Gaetan Rivet
2017-10-30 16:36 ` Gaetan Rivet [this message]
2017-10-30 16:36 ` [dpdk-dev] [PATCH v3 " Gaetan Rivet
2017-10-30 17:31 ` Ferruh Yigit
2017-10-30 17:26 ` [dpdk-dev] [PATCH v3 1/2] bus/pci: fix vfio mode Ferruh Yigit
2017-10-30 19:07 ` Ferruh Yigit
2017-10-30 22:32 ` [dpdk-dev] [PATCH v4] " Ferruh Yigit
2017-10-31 12:03 ` Bruce Richardson
2017-10-31 16:58 ` Ferruh Yigit
2017-10-31 18:21 ` Thomas Monjalon
2017-10-31 14:11 ` Gaëtan Rivet
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=8492fe4cf1a8d6f15d389c9148e4942f1d060a40.1509381300.git.gaetan.rivet@6wind.com \
--to=gaetan.rivet@6wind.com \
--cc=dev@dpdk.org \
--cc=jerin.jacob@caviumnetworks.com \
/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).