[1/6] build: fix for FREEBSD build via meson

Message ID 1538054652-20820-2-git-send-email-agalyax.babu.radhakrishnan@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series fix for meson builds in freebsd |

Checks

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

Commit Message

Babu Radhakrishnan, AgalyaX Sept. 27, 2018, 1:24 p.m. UTC
  FreeBSD compilation was failing through meson build.
RTE_EAL_VFIO is not supported in FreeBSD.
But RTE_EAL_VFIO was enabled for both linux and freebsd.
So RTE_EAL_VFIO is removed from config/rte_config.h and
based on the platform RTE_EAL_VFIO flag is enabled/disabled appropriately.

Fixes: 6e8a721044 ("vfio: export functions even when disabled")

Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
---
 config/rte_config.h | 1 -
 lib/meson.build     | 6 ++++++
 2 files changed, 6 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson Sept. 27, 2018, 2:49 p.m. UTC | #1
On Thu, Sep 27, 2018 at 02:24:07PM +0100, Agalya Babu RadhaKrishnan wrote:
> FreeBSD compilation was failing through meson build.
> RTE_EAL_VFIO is not supported in FreeBSD.
> But RTE_EAL_VFIO was enabled for both linux and freebsd.
> So RTE_EAL_VFIO is removed from config/rte_config.h and
> based on the platform RTE_EAL_VFIO flag is enabled/disabled appropriately.
> 
> Fixes: 6e8a721044 ("vfio: export functions even when disabled")
> 
> Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
> ---
>  config/rte_config.h | 1 -
>  lib/meson.build     | 6 ++++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/config/rte_config.h b/config/rte_config.h
> index 567051b9c..53c568929 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -34,7 +34,6 @@
>  #define RTE_MAX_TAILQ 32
>  #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
>  #define RTE_BACKTRACE 1
> -#define RTE_EAL_VFIO 1
>  #define RTE_MAX_VFIO_CONTAINERS 64
>  
>  /* bsd module defines */
> diff --git a/lib/meson.build b/lib/meson.build
> index 3acc67e6e..1b20027a5 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -31,6 +31,12 @@ if cc.has_argument('-Wno-format-truncation')
>  	default_cflags += '-Wno-format-truncation'
>  endif
>  
> +if host_machine.system() == 'linux'
> +	dpdk_conf.set('RTE_EAL_VFIO', true)
> +else
> +	dpdk_conf.set('RTE_EAL_VFIO', false)
> +endif
> +

I think this can be shortened in a number of ways. If we don't have vfio, I
don't think you need to set it to false, so the else leg can be removed.
Even shorter again could be:

dpdk_conf.set('RTE_EAL_VFIO', host_machine.system() == 'linux')

/Bruce
  
Bruce Richardson Sept. 27, 2018, 2:49 p.m. UTC | #2
On Thu, Sep 27, 2018 at 02:24:07PM +0100, Agalya Babu RadhaKrishnan wrote:
> FreeBSD compilation was failing through meson build.
> RTE_EAL_VFIO is not supported in FreeBSD.
> But RTE_EAL_VFIO was enabled for both linux and freebsd.
> So RTE_EAL_VFIO is removed from config/rte_config.h and
> based on the platform RTE_EAL_VFIO flag is enabled/disabled appropriately.
> 
> Fixes: 6e8a721044 ("vfio: export functions even when disabled")
> 
> Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
> ---
>  config/rte_config.h | 1 -
>  lib/meson.build     | 6 ++++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/config/rte_config.h b/config/rte_config.h
> index 567051b9c..53c568929 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -34,7 +34,6 @@
>  #define RTE_MAX_TAILQ 32
>  #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
>  #define RTE_BACKTRACE 1
> -#define RTE_EAL_VFIO 1
>  #define RTE_MAX_VFIO_CONTAINERS 64
>  
>  /* bsd module defines */
> diff --git a/lib/meson.build b/lib/meson.build
> index 3acc67e6e..1b20027a5 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -31,6 +31,12 @@ if cc.has_argument('-Wno-format-truncation')
>  	default_cflags += '-Wno-format-truncation'
>  endif
>  
> +if host_machine.system() == 'linux'
> +	dpdk_conf.set('RTE_EAL_VFIO', true)
> +else
> +	dpdk_conf.set('RTE_EAL_VFIO', false)
> +endif
> +

This should also go in config/meson.build not lib/meson.build
  

Patch

diff --git a/config/rte_config.h b/config/rte_config.h
index 567051b9c..53c568929 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -34,7 +34,6 @@ 
 #define RTE_MAX_TAILQ 32
 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
 #define RTE_BACKTRACE 1
-#define RTE_EAL_VFIO 1
 #define RTE_MAX_VFIO_CONTAINERS 64
 
 /* bsd module defines */
diff --git a/lib/meson.build b/lib/meson.build
index 3acc67e6e..1b20027a5 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -31,6 +31,12 @@  if cc.has_argument('-Wno-format-truncation')
 	default_cflags += '-Wno-format-truncation'
 endif
 
+if host_machine.system() == 'linux'
+	dpdk_conf.set('RTE_EAL_VFIO', true)
+else
+	dpdk_conf.set('RTE_EAL_VFIO', false)
+endif
+
 enabled_libs = [] # used to print summary at the end
 foreach l:libraries
 	build = true