DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: valex@nvidia.com, ferruh.yigit@amd.com,
	andrew.rybchenko@oktetlabs.ru, rasland@nvidia.com,
	david.marchand@redhat.com, Matan Azrad <matan@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Subject: [PATCH v3 2/2] common/mlx5: move build config initialization and check
Date: Sun, 30 Oct 2022 12:08:26 +0100	[thread overview]
Message-ID: <20221030110827.1994953-3-thomas@monjalon.net> (raw)
In-Reply-To: <20221030110827.1994953-1-thomas@monjalon.net>

The variable mlx5_config may be used by other mlx5 drivers
and should be always initialized.
By moving its initialization (with configuration file generation),
it is made consistent for Linux and Windows builds.

And the check of mlx5_config in net/mlx5 is moved at the top of
net/mlx5/hws/meson.build so HWS requirements are in the right context.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/linux/meson.build   | 3 +--
 drivers/common/mlx5/meson.build         | 2 ++
 drivers/common/mlx5/windows/meson.build | 4 ----
 drivers/net/mlx5/hws/meson.build        | 4 ++++
 drivers/net/mlx5/meson.build            | 4 +---
 5 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build
index 84e2a1ad8c..7e1575efc8 100644
--- a/drivers/common/mlx5/linux/meson.build
+++ b/drivers/common/mlx5/linux/meson.build
@@ -8,7 +8,6 @@ dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen')
 LIB_GLUE_BASE = 'librte_common_mlx5_glue.so'
 LIB_GLUE_VERSION = abi_version
 LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION
-mlx5_config = configuration_data()
 if dlopen_ibverbs
     dpdk_conf.set('RTE_IBVERBS_LINK_DLOPEN', 1)
     cflags += [
@@ -232,7 +231,6 @@ foreach arg:has_member_args
     file_prefix = '#include <' + arg[1] + '>'
     mlx5_config.set(arg[0], cc.has_member(arg[2], arg[3], prefix : file_prefix, dependencies: libs))
 endforeach
-configure_file(output : 'mlx5_autoconf.h', configuration : mlx5_config)
 
 # Build Glue Library
 if dlopen_ibverbs
@@ -243,6 +241,7 @@ if dlopen_ibverbs
     dlopen_install_dir = [ eal_pmd_path + '-glue' ]
     dlopen_includes = [global_inc]
     dlopen_includes += include_directories('../../../../lib/eal/include/generic')
+    dlopen_includes += include_directories('..')
     shared_lib = shared_library(
             dlopen_lib_name,
             dlopen_sources,
diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build
index 6ddbde7e8f..60ccd95cbc 100644
--- a/drivers/common/mlx5/meson.build
+++ b/drivers/common/mlx5/meson.build
@@ -37,4 +37,6 @@ else
     cflags += [ '-UPEDANTIC' ]
 endif
 
+mlx5_config = configuration_data()
 subdir(exec_env)
+configure_file(output: 'mlx5_autoconf.h', configuration: mlx5_config)
diff --git a/drivers/common/mlx5/windows/meson.build b/drivers/common/mlx5/windows/meson.build
index edbbaa9ae1..cc486014a8 100644
--- a/drivers/common/mlx5/windows/meson.build
+++ b/drivers/common/mlx5/windows/meson.build
@@ -39,7 +39,3 @@ if get_option('buildtype').contains('debug')
 else
     cflags += [ '-UPEDANTIC' ]
 endif
-
-# Generate an empty mlx5_autoconf.h file for compatibility with Linux
-config = configuration_data()
-configure_file(output : 'mlx5_autoconf.h', configuration : config)
diff --git a/drivers/net/mlx5/hws/meson.build b/drivers/net/mlx5/hws/meson.build
index d2bb864fd2..38776d5163 100644
--- a/drivers/net/mlx5/hws/meson.build
+++ b/drivers/net/mlx5/hws/meson.build
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 NVIDIA Corporation & Affiliates
 
+if not (is_linux and mlx5_config.get('HAVE_IBV_FLOW_DV_SUPPORT', false))
+    subdir_done()
+endif
+
 includes += include_directories('.')
 sources += files(
         'mlx5dr_context.c',
diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
index fa15158039..f1aab18f82 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -78,6 +78,4 @@ testpmd_sources += files('mlx5_testpmd.c')
 
 subdir(exec_env)
 
-if (is_linux and mlx5_config.get('HAVE_IBV_FLOW_DV_SUPPORT', false))
-    subdir('hws')
-endif
+subdir('hws')
-- 
2.36.1


  parent reply	other threads:[~2022-10-30 11:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29  9:05 DPDK main build is broken for me in net/mlx5 if I disable common/mlx5 Andrew Rybchenko
2022-10-29 23:17 ` [PATCH 0/2] fix build disabling common/mlx5 Thomas Monjalon
2022-10-29 23:17   ` [PATCH 1/2] net/mlx5: fix disabling common/mlx5 dependency Thomas Monjalon
2022-10-29 23:17   ` [PATCH 2/2] common/mlx5: move Meson config initialization and check Thomas Monjalon
2022-10-30  7:34   ` [PATCH 0/2] fix build disabling common/mlx5 Andrew Rybchenko
2022-10-30  8:27 ` [PATCH v2 " Thomas Monjalon
2022-10-30  8:27   ` [PATCH v2 1/2] common/mlx5: fix build disabling Thomas Monjalon
2022-10-30  9:16     ` Matan Azrad
2022-11-02 12:10     ` Bruce Richardson
2022-11-02 12:29       ` Thomas Monjalon
2022-11-02 13:14         ` Bruce Richardson
2022-11-02 13:17           ` Thomas Monjalon
2022-11-07 16:37           ` [PATCH] common/mlx5: use build configuration dictionary Thomas Monjalon
2022-11-07 17:07             ` Bruce Richardson
2022-11-08  7:51             ` David Marchand
2022-11-14 10:31               ` David Marchand
2022-10-30  8:27   ` [PATCH v2 2/2] common/mlx5: move Meson config initialization and check Thomas Monjalon
2022-10-30  9:16     ` Matan Azrad
2022-10-30  9:14   ` [PATCH v2 0/2] fix build disabling common/mlx5 David Marchand
2022-10-30 11:08 ` [PATCH v3 " Thomas Monjalon
2022-10-30 11:08   ` [PATCH v3 1/2] common/mlx5: fix build disabling Thomas Monjalon
2022-10-30 13:33     ` Alex Vesker
2022-10-30 11:08   ` Thomas Monjalon [this message]
2022-10-30 13:34     ` [PATCH v3 2/2] common/mlx5: move build config initialization and check Alex Vesker
2022-10-30 15:12   ` [PATCH v3 0/2] fix build disabling common/mlx5 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=20221030110827.1994953-3-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=valex@nvidia.com \
    --cc=viacheslavo@nvidia.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).