[dpdk-dev] [PATCH] bus/pci: fix vfio mode

Gaëtan Rivet gaetan.rivet at 6wind.com
Mon Oct 30 09:06:54 CET 2017


Hi Jerin,

On Sat, Oct 28, 2017 at 11:50:52AM +0530, Jerin Jacob wrote:
> The definition of VFIO_PRESENT is "eal_vfio.h", Fail to
> include eal_vfio.h will result in disabling vfio.
> 
> Fixes: 279b581c897d ("vfio: expose functions")
> 

Thanks for the fix, sorry for VFIO.
I tried to let go of VFIO_PRESENT in the PCI patchset, unfortunately I did
not do a good-enough job.

Instead of reinstating the dependency on the private eal_vfio.h header,
I'd suggest replacing all VFIO_PRESENT references within the PCI bus by
RTE_EAL_VFIO, and make the pci_vfio.c compilation depend on it within
the linux Makefile. Something like:

---8<---

grep -rl VFIO_PRESENT drivers/bus/pci/linux/ |while read -r file
do sed -i 's;VFIO_PRESENT;RTE_EAL_VFIO;' $file
done

patch -p1 <<___HERE
diff --git a/drivers/bus/pci/linux/Makefile b/drivers/bus/pci/linux/Makefile
index 77c5f97..b5b9c54 100644
--- a/drivers/bus/pci/linux/Makefile
+++ b/drivers/bus/pci/linux/Makefile
@@ -31,6 +31,8 @@

 SRCS += pci.c
 SRCS += pci_uio.c
+ifeq (\$(CONFIG_RTE_EAL_VFIO),y)
 SRCS += pci_vfio.c
+endif

 CFLAGS += -D_GNU_SOURCE
___HERE

--->8---

Do you think it could work? If so, I think it would be preferable
to re-including eal_vfio.h. Private EAL headers are bound to be removed
from other subsystems at some point. I tried to start with VFIO, others
should follow.

> Cc: Gaetan Rivet <gaetan.rivet at 6wind.com>
> 
> Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> ---
>  drivers/bus/pci/linux/pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
> index cdf810693..d0ce0207a 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"
> -- 
> 2.14.3
> 

-- 
Gaëtan Rivet
6WIND


More information about the dev mailing list