[dpdk-dev,v3,2/2] eal: warn user that VFIO is disabled

Message ID 6d3b81d98b4d1b3754c616f71b293f2119d79bd1.1509381300.git.gaetan.rivet@6wind.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Gaëtan Rivet Oct. 30, 2017, 4:36 p.m. UTC
  If VFIO is not compatible with the kernel used, print a soft warning to
the user if RTE_EAL_VFIO was still enabled in the configuration.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/linuxapp/eal/eal_vfio.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ferruh Yigit Oct. 30, 2017, 5:31 p.m. UTC | #1
On 10/30/2017 9:36 AM, Gaetan Rivet wrote:
> If VFIO is not compatible with the kernel used, print a soft warning to
> the user if RTE_EAL_VFIO was still enabled in the configuration.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
>  lib/librte_eal/linuxapp/eal/eal_vfio.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h
> index 766d004..fadd274 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.h
> +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h
> @@ -183,6 +183,8 @@ int vfio_mp_sync_setup(void);
>  #define SOCKET_ERR 0xFF
>  
>  #define VFIO_PRESENT
> +#else
> +#pragma message("VFIO configured but not supported by this kernel, disabling.")

There is a flaw here, but it seems it was already there, nothing coming for this
patch.

There is a RTE_KERNELDIR variable, to compile DPDK with a given kernel, instead
of default one. I am using this a lot for kni and igb_uio.

Default RTE_KERNELDIR is:
RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build

For vfio case, it is not taking this variable into account and always using the
default one, so RTE_KERNELDIR is broken here.

>  #endif /* kernel version */
>  #endif /* RTE_EAL_VFIO */
>  
>
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h
index 766d004..fadd274 100644
--- a/lib/librte_eal/linuxapp/eal/eal_vfio.h
+++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h
@@ -183,6 +183,8 @@  int vfio_mp_sync_setup(void);
 #define SOCKET_ERR 0xFF
 
 #define VFIO_PRESENT
+#else
+#pragma message("VFIO configured but not supported by this kernel, disabling.")
 #endif /* kernel version */
 #endif /* RTE_EAL_VFIO */