DPDK main build is broken for me in net/mlx5 if I disable common/mlx5
Subsystems (5)
Hi,
DPDK main build is broken for me in net/mlx5 if I disable common/mlx5
../src/drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".
It worked for me before and net/mlx5 is not built since common driver is missing.
Andrew.
cover fix build disabling common/mlx5
Andrew reported a build failure when disabling mlx5 common driver. It is a blocker for -rc2 release.
While fixing the use of a variable across mlx5 drivers in first patch, the consistency of its use is improved in a second patch.
Thomas Monjalon (2):
net/mlx5: fix disabling common/mlx5 dependency common/mlx5: move Meson config initialization and check
drivers/common/mlx5/linux/meson.build | 2 -- 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 | 8 +++++--- 5 files changed, 11 insertions(+), 9 deletions(-)
Signature · 1 line
2.36.1
PATCH 1/2 net/mlx5: fix disabling common/mlx5 dependency
If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explictly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".
The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
--- drivers/net/mlx5/meson.build | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/mlx5/meson.build +4 -0
@@ -9,6 +9,10 @@ if not (is_linux or is_windows) endif deps += ['hash', 'common_mlx5'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif headers = files('rte_pmd_mlx5.h') sources = files( 'mlx5.c',
Signature · 1 line
2.36.1
PATCH 2/2 common/mlx5: move Meson config initialization and check
In reply to Thomas MonjalonThe 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.
--- drivers/common/mlx5/linux/meson.build | 2 -- 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, 7 insertions(+), 9 deletions(-)
drivers/common/mlx5/linux/meson.build +0 -2
@@ -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
drivers/common/mlx5/meson.build +2 -0
@@ -37,4 +37,6 @@ else cflags += [ '-UPEDANTIC' ] endif +mlx5_config = configuration_data() subdir(exec_env) +configure_file(output : 'mlx5_autoconf.h', configuration : mlx5_config)
drivers/common/mlx5/windows/meson.build +0 -4
@@ -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)
drivers/net/mlx5/hws/meson.build +4 -0
@@ -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',
drivers/net/mlx5/meson.build +1 -3
@@ -77,6 +77,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')
Signature · 1 line
2.36.1
Re: [PATCH 0/2] fix build disabling common/mlx5
In reply to Thomas MonjalonQuoted 10 lines · Thomas Monjalon
Andrew reported a build failure when disabling mlx5 common driver. It is a blocker for -rc2 release.
While fixing the use of a variable across mlx5 drivers in first patch, the consistency of its use is improved in a second patch.
Thomas Monjalon (2):
net/mlx5: fix disabling common/mlx5 dependency common/mlx5: move Meson config initialization and check
Quoted 7 lines
drivers/common/mlx5/linux/meson.build | 2 -- 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 | 8 +++++--- 5 files changed, 11 insertions(+), 9 deletions(-)
Many thanks, it solves my build problem:
v2 cover fix build disabling common/mlx5
In reply to Andrew RybchenkoAndrew reported a build failure when disabling mlx5 common driver. It is a blocker for -rc2 release.
While fixing the use of a variable across mlx5 drivers in first patch, the consistency of its use is improved in a second patch.
v2: apply the same protection to other mlx5 drivers
Thomas Monjalon (2):
common/mlx5: fix build disabling
common/mlx5: move Meson config initialization and check
drivers/common/mlx5/linux/meson.build | 2 -- drivers/common/mlx5/meson.build | 2 ++ drivers/common/mlx5/windows/meson.build | 4 ---- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/hws/meson.build | 4 ++++ drivers/net/mlx5/meson.build | 9 ++++++--- drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 9 files changed, 32 insertions(+), 9 deletions(-)
Signature · 1 line
2.36.1
PATCH v2 1/2 common/mlx5: fix build disabling
If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explicitly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".
The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
The same protection is applied to other mlx5 drivers, so it will allow using the variable mlx5_config in future.
--- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/meson.build | 5 +++++ drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 5 files changed, 25 insertions(+)
drivers/compress/mlx5/meson.build +5 -0
@@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_compress.c', )
drivers/crypto/mlx5/meson.build +5 -0
@@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_crypto' deps += ['common_mlx5', 'eal', 'cryptodev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_crypto.c', 'mlx5_crypto_dek.c',
drivers/net/mlx5/meson.build +5 -0
@@ -9,6 +9,11 @@ if not (is_linux or is_windows) endif deps += ['hash', 'common_mlx5'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + headers = files('rte_pmd_mlx5.h') sources = files( 'mlx5.c',
drivers/regex/mlx5/meson.build +5 -0
@@ -8,6 +8,11 @@ if not is_linux endif deps += ['common_mlx5', 'eal', 'regexdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_regex.c', 'mlx5_rxp.c',
drivers/vdpa/mlx5/meson.build +5 -0
@@ -8,6 +8,11 @@ if not is_linux endif deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_vdpa.c', 'mlx5_vdpa_mem.c',
Signature · 1 line
2.36.1
RE: [PATCH v2 1/2] common/mlx5: fix build disabling
Quoted 12 lines
If the dependency common/mlx5 is explicitly disabled, but net/mlx5 is not explicitly disabled, Meson will read the full recipe of net/mlx5 and will fail when accessing a variable from common/mlx5:
drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
Quoted 8 lines
The same protection is applied to other mlx5 drivers, so it will allow using the variable
mlx5_configin future.Fixes 22681deead3e ("net/mlx5/hws: enable hardware steering")Reported-by Andrew Rybchenko <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Tested-by Andrew Rybchenko <[email protected]>
Re: [PATCH v2 1/2] common/mlx5: fix build disabling
In reply to Thomas MonjalonQuoted 31 lines · Thomas Monjalon
If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explicitly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
The same protection is applied to other mlx5 drivers, so it will allow using the variable
mlx5_configin future.Fixes 22681deead3e ("net/mlx5/hws: enable hardware steering")Reported-by Andrew Rybchenko <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Tested-by Andrew Rybchenko <[email protected]>--- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/meson.build | 5 +++++ drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 5 files changed, 25 insertions(+)drivers/compress/mlx5/meson.build +0
-0
drivers/compress/mlx5/meson.build endif · line 12
Quoted 4 lines
drivers/compress/mlx5/meson.build +1
-0@@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] +if not ('mlx5' in common_drivers)
While this is fine as-is, I think the more usual way for checking the presence of a component in DPDK is to check dpdk_conf. In this case the check would be "if not dpdk_conf.has('RTE_COMMON_MLX5')". You may want to consider using that for consistency.
/Bruce
Re: [PATCH v2 1/2] common/mlx5: fix build disabling
02/11/2022 13:10, Bruce Richardson:
Quoted 33 lines · Thomas Monjalon
Quoted 32 lines
If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explicitly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
The same protection is applied to other mlx5 drivers, so it will allow using the variable
mlx5_configin future.Fixes 22681deead3e ("net/mlx5/hws: enable hardware steering")Reported-by Andrew Rybchenko <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Tested-by Andrew Rybchenko <[email protected]>--- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/meson.build | 5 +++++ drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 5 files changed, 25 insertions(+)drivers/compress/mlx5/meson.build +0
-0@@ -9,6 +9,11 @@ endif
Quoted 8 lines
drivers/compress/mlx5/meson.build endif · line 12
Quoted 3 lines
drivers/compress/mlx5/meson.build +1
-0fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] +if not ('mlx5' in common_drivers)While this is fine as-is, I think the more usual way for checking the presence of a component in DPDK is to check
dpdk_conf. In this case the check would be "if notdpdk_conf.has('RTE_COMMON_MLX5')". You may want to consider using that for consistency.
Yes, I've forgotten this:
lib_name = '_'.join(['rte', class, name]) dpdk_conf.set(lib_name.to_upper(), 1)
Then what is the usage of this?
set_variable(class + '_drivers', enabled_drivers)
Re: [PATCH v2 1/2] common/mlx5: fix build disabling
Quoted 43 lines · Thomas Monjalon
02/11/2022 13:10, Bruce Richardson:
Quoted 33 lines · Thomas Monjalon
Quoted 32 lines
If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explicitly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
The same protection is applied to other mlx5 drivers, so it will allow using the variable
mlx5_configin future.Fixes 22681deead3e ("net/mlx5/hws: enable hardware steering")Reported-by Andrew Rybchenko <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Tested-by Andrew Rybchenko <[email protected]>--- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/meson.build | 5 +++++ drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 5 files changed, 25 insertions(+)drivers/compress/mlx5/meson.build +0
-0@@ -9,6 +9,11 @@ endifQuoted 8 lines
drivers/compress/mlx5/meson.build endif · line 12
Quoted 3 lines
drivers/compress/mlx5/meson.build +1
-0fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] +if not ('mlx5' in common_drivers)While this is fine as-is, I think the more usual way for checking the presence of a component in DPDK is to check
dpdk_conf. In this case the check would be "if notdpdk_conf.has('RTE_COMMON_MLX5')". You may want to consider using that for consistency.
Quoted 9 lines
Yes, I've forgotten this:
lib_name = '_'.join(['rte', class, name]) dpdk_conf.set(lib_name.to_upper(), 1)Then what is the usage of this?
set_variable(class + '_drivers', enabled_drivers)
That is used for the summary printout at the end, so we can list the drivers enabled.
The approach using the common_drivers works fine for this patch, so let's keep it, since it's merged. I was just pointing out the other approach for consistency sake.
/Bruce
Re: [PATCH v2 1/2] common/mlx5: fix build disabling
02/11/2022 14:14, Bruce Richardson:
Quoted 17 lines · Thomas Monjalon
Quoted 16 lines
02/11/2022 13:10, Bruce Richardson:
Quoted 7 lines · Thomas Monjalon
Quoted 1 line
+if not ('mlx5' in
common_drivers)While this is fine as-is, I think the more usual way for checking the presence of a component in DPDK is to check
dpdk_conf. In this case the check would be "if notdpdk_conf.has('RTE_COMMON_MLX5')". You may want to consider using that for consistency.Yes, I've forgotten this:
lib_name = '_'.join(['rte', class, name]) dpdk_conf.set(lib_name.to_upper(), 1)Then what is the usage of this?
Quoted 8 lines
Quoted 2 lines
set_variable(class + '_drivers', enabled_drivers)That is used for the summary printout at the end, so we can list the drivers enabled.
The approach using the
common_driversworks fine for this patch, so let's keep it, since it's merged. I was just pointing out the other approach for consistency sake.
I can send a patch for consistency.
PATCH 1/1 common/mlx5: use build configuration dictionary
In reply to Bruce RichardsonA recent commit added an explicit dependency check on common/mlx5. For consistency, query dpdk_conf instead of the list of common drivers. The lists *_drivers should be used only for printing.
--- drivers/compress/mlx5/meson.build | 2 +- drivers/crypto/mlx5/meson.build | 2 +- drivers/net/mlx5/meson.build | 2 +- drivers/regex/mlx5/meson.build | 2 +- drivers/vdpa/mlx5/meson.build | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
drivers/compress/mlx5/meson.build +1 -1
@@ -9,7 +9,7 @@ endif fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] -if not ('mlx5' in common_drivers) +if not dpdk_conf.has('RTE_COMMON_MLX5') # avoid referencing undefined variables from common/mlx5 subdir_done() endif
drivers/crypto/mlx5/meson.build +1 -1
@@ -9,7 +9,7 @@ endif fmt_name = 'mlx5_crypto' deps += ['common_mlx5', 'eal', 'cryptodev'] -if not ('mlx5' in common_drivers) +if not dpdk_conf.has('RTE_COMMON_MLX5') # avoid referencing undefined variables from common/mlx5 subdir_done() endif
drivers/net/mlx5/meson.build +1 -1
@@ -9,7 +9,7 @@ if not (is_linux or is_windows) endif deps += ['hash', 'common_mlx5'] -if not ('mlx5' in common_drivers) +if not dpdk_conf.has('RTE_COMMON_MLX5') # avoid referencing undefined variables from common/mlx5 subdir_done() endif
drivers/regex/mlx5/meson.build +1 -1
@@ -8,7 +8,7 @@ if not is_linux endif deps += ['common_mlx5', 'eal', 'regexdev'] -if not ('mlx5' in common_drivers) +if not dpdk_conf.has('RTE_COMMON_MLX5') # avoid referencing undefined variables from common/mlx5 subdir_done() endif
drivers/vdpa/mlx5/meson.build +1 -1
@@ -8,7 +8,7 @@ if not is_linux endif deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched'] -if not ('mlx5' in common_drivers) +if not dpdk_conf.has('RTE_COMMON_MLX5') # avoid referencing undefined variables from common/mlx5 subdir_done() endif
Signature · 1 line
2.36.1
Re: [PATCH] common/mlx5: use build configuration dictionary
Quoted 9 lines · Thomas Monjalon
A recent commit added an explicit dependency check on common/mlx5. For consistency, query
dpdk_confinstead of the list of common drivers. The lists*_driversshould be used only for printing.Fixes 3df380f61797 ("common/mlx5: fix disabling build")Suggested-by Bruce Richardson <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>---
Re: [PATCH] common/mlx5: use build configuration dictionary
In reply to Thomas MonjalonQuoted 9 lines · Thomas Monjalon
A recent commit added an explicit dependency check on common/mlx5. For consistency, query
dpdk_confinstead of the list of common drivers. The lists*_driversshould be used only for printing.Fixes 3df380f61797 ("common/mlx5: fix disabling build")Suggested-by Bruce Richardson <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>
Signature · 1 line
David Marchand
Re: [PATCH] common/mlx5: use build configuration dictionary
Quoted 12 lines · David Marchand
Quoted 9 lines · Thomas Monjalon
A recent commit added an explicit dependency check on common/mlx5. For consistency, query
dpdk_confinstead of the list of common drivers. The lists*_driversshould be used only for printing.Fixes 3df380f61797 ("common/mlx5: fix disabling build")Suggested-by Bruce Richardson <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>
Quoted 1 line
Reviewed-by David Marchand <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand
PATCH v2 2/2 common/mlx5: move Meson config initialization and check
In reply to Thomas MonjalonThe 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.
--- drivers/common/mlx5/linux/meson.build | 2 -- 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, 7 insertions(+), 9 deletions(-)
drivers/common/mlx5/linux/meson.build +0 -2
@@ -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
drivers/common/mlx5/meson.build +2 -0
@@ -37,4 +37,6 @@ else cflags += [ '-UPEDANTIC' ] endif +mlx5_config = configuration_data() subdir(exec_env) +configure_file(output : 'mlx5_autoconf.h', configuration : mlx5_config)
drivers/common/mlx5/windows/meson.build +0 -4
@@ -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)
drivers/net/mlx5/hws/meson.build +4 -0
@@ -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',
drivers/net/mlx5/meson.build +1 -3
@@ -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')
Signature · 1 line
2.36.1
RE: [PATCH v2 2/2] common/mlx5: move Meson config initialization and check
Quoted 11 lines
The variable
mlx5_configmay 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_configin net/mlx5 is moved at the top ofnet/mlx5/hws/meson.buildso HWS requirements are in the right context.Signed-off-by Thomas Monjalon <[email protected]>Tested-by Andrew Rybchenko <[email protected]>
Re: [PATCH v2 0/2] fix build disabling common/mlx5
In reply to Thomas MonjalonQuoted 13 lines · Thomas Monjalon
Andrew reported a build failure when disabling mlx5 common driver. It is a blocker for -rc2 release.
While fixing the use of a variable across mlx5 drivers in first patch, the consistency of its use is improved in a second patch.
v2: apply the same protection to other mlx5 drivers
Thomas Monjalon (2):
common/mlx5: fix build disabling
common/mlx5: move Meson config initialization and check
Quoted 10 lines
drivers/common/mlx5/linux/meson.build | 2 -- drivers/common/mlx5/meson.build | 2 ++ drivers/common/mlx5/windows/meson.build | 4 ---- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/hws/meson.build | 4 ++++ drivers/net/mlx5/meson.build | 9 ++++++--- drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 9 files changed, 32 insertions(+), 9 deletions(-)
For the series,
Signature · 1 line
David Marchand
v3 cover fix build disabling common/mlx5
In reply to Andrew RybchenkoAndrew reported a build failure when disabling mlx5 common driver. It is a blocker for -rc2 release.
While fixing the use of a variable across mlx5 drivers in first patch, the consistency of its use is improved in a second patch.
v2: apply the same protection to other mlx5 drivers
v3: fix ibverbs_link=dlopen (include directory was missing)
Thomas Monjalon (2):
common/mlx5: fix build disabling
common/mlx5: move build config initialization and check
drivers/common/mlx5/linux/meson.build | 3 +-- drivers/common/mlx5/meson.build | 2 ++ drivers/common/mlx5/windows/meson.build | 4 ---- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/hws/meson.build | 4 ++++ drivers/net/mlx5/meson.build | 9 ++++++--- drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 9 files changed, 33 insertions(+), 9 deletions(-)
Signature · 1 line
2.36.1
PATCH v3 1/2 common/mlx5: fix build disabling
If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explicitly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".
The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
The same protection is applied to other mlx5 drivers, so it will allow using the variable mlx5_config in future.
--- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/meson.build | 5 +++++ drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 5 files changed, 25 insertions(+)
drivers/compress/mlx5/meson.build +5 -0
@@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_compress.c', )
drivers/crypto/mlx5/meson.build +5 -0
@@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_crypto' deps += ['common_mlx5', 'eal', 'cryptodev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_crypto.c', 'mlx5_crypto_dek.c',
drivers/net/mlx5/meson.build +5 -0
@@ -9,6 +9,11 @@ if not (is_linux or is_windows) endif deps += ['hash', 'common_mlx5'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + headers = files('rte_pmd_mlx5.h') sources = files( 'mlx5.c',
drivers/regex/mlx5/meson.build +5 -0
@@ -8,6 +8,11 @@ if not is_linux endif deps += ['common_mlx5', 'eal', 'regexdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_regex.c', 'mlx5_rxp.c',
drivers/vdpa/mlx5/meson.build +5 -0
@@ -8,6 +8,11 @@ if not is_linux endif deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_vdpa.c', 'mlx5_vdpa_mem.c',
Signature · 1 line
2.36.1
RE: [PATCH v3 1/2] common/mlx5: fix build disabling
Quoted 123 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Sunday, October 30, 2022 1:08 PM
To: [email protected]
Cc: Alex Vesker <[email protected]>; [email protected]; [email protected]; Raslan Darawsheh <[email protected]>; [email protected]; Matan Azrad <[email protected]>; Fan Zhang <[email protected]>; Ashish Gupta <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>
Subject: [PATCH v3 1/2] common/mlx5: fix build disablingIf the dependency common/mlx5 is explicitly disabled, but net/mlx5 is not explicitly disabled, Meson will read the full recipe of net/mlx5 and will fail when accessing a variable from common/mlx5:
drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason.
The same protection is applied to other mlx5 drivers, so it will allow using the variable
mlx5_configin future.Fixes 22681deead3e ("net/mlx5/hws: enable hardware steering")Reported-by Andrew Rybchenko <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Tested-by Andrew Rybchenko <[email protected]>Reviewed-by David Marchand <[email protected]>Acked-by Matan Azrad <[email protected]>--- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/meson.build | 5 +++++ drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 5 files changed, 25 insertions(+)drivers/compress/mlx5/meson.build +5
-0@@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_compress.c', )(quoted diff) +0
-0b/drivers/crypto/mlx5/meson.build index
9d9c9c00bc..7521c4c671100644drivers/crypto/mlx5/meson.build +5
-0@@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_crypto' deps += ['common_mlx5', 'eal', 'cryptodev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_crypto.c', 'mlx5_crypto_dek.c',drivers/net/mlx5/meson.build +5
-0@@ -9,6 +9,11 @@ if not (is_linux or is_windows) endif deps += ['hash', 'common_mlx5'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + headers = files('rte_pmd_mlx5.h') sources = files( 'mlx5.c',(quoted diff) +0
-0b/drivers/regex/mlx5/meson.build index
e553dcb83d..70edc5b6da100644drivers/regex/mlx5/meson.build +5
-0@@ -8,6 +8,11 @@ if not is_linux endif deps += ['common_mlx5', 'eal', 'regexdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_regex.c', 'mlx5_rxp.c',(quoted diff) +0
-0b/drivers/vdpa/mlx5/meson.build index
9d8dbb1a82..54a4eac6f4100644drivers/vdpa/mlx5/meson.build +5
-1@@ -8,6 +8,11 @@ if not is_linux endif deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_vdpa.c', 'mlx5_vdpa_mem.c', --
Quoted 1 line
2.36.1
PATCH v3 2/2 common/mlx5: move build config initialization and check
In reply to Thomas MonjalonThe 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.
--- 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(-)
drivers/common/mlx5/linux/meson.build +1 -2
@@ -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,
drivers/common/mlx5/meson.build +2 -0
@@ -37,4 +37,6 @@ else cflags += [ '-UPEDANTIC' ] endif +mlx5_config = configuration_data() subdir(exec_env) +configure_file(output: 'mlx5_autoconf.h', configuration: mlx5_config)
drivers/common/mlx5/windows/meson.build +0 -4
@@ -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)
drivers/net/mlx5/hws/meson.build +4 -0
@@ -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',
drivers/net/mlx5/meson.build +1 -3
@@ -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')
Signature · 1 line
2.36.1
RE: [PATCH v3 2/2] common/mlx5: move build config initialization and check
Quoted 114 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Sunday, October 30, 2022 1:08 PM
To: [email protected]
Cc: Alex Vesker <[email protected]>; [email protected]; [email protected]; Raslan Darawsheh <[email protected]>; [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: [PATCH v3 2/2] common/mlx5: move build config initialization and checkThe variable
mlx5_configmay 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_configin net/mlx5 is moved at the top ofnet/mlx5/hws/meson.buildso HWS requirements are in the right context.Signed-off-by Thomas Monjalon <[email protected]>Tested-by Andrew Rybchenko <[email protected]>Reviewed-by David Marchand <[email protected]>Acked-by Matan Azrad <[email protected]>--- 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(-)drivers/common/mlx5/linux/meson.build +0
-0@@ -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()ifdlopen_ibverbsdpdk_conf.set('RTE_IBVERBS_LINK_DLOPEN', 1) cflags += [drivers/common/mlx5/linux/meson.build +1
-0@@ -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,(quoted diff) +0
-0b/drivers/common/mlx5/meson.build index
6ddbde7e8f..60ccd95cbc100644drivers/common/mlx5/meson.build +2
-0@@ -37,4 +37,6 @@ else cflags += [ '-UPEDANTIC' ] endif +mlx5_config = configuration_data() subdir(exec_env) +configure_file(output: 'mlx5_autoconf.h', configuration: mlx5_config)drivers/common/mlx5/windows/meson.build +0
-2@@ -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
indexd2bb864fd2..38776d5163100644drivers/net/mlx5/hws/meson.build +0
-0@@ -1,6 +1,10 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2022 NVIDIACorporation & Affiliates
drivers/net/mlx5/hws/meson.build +4
-0+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',drivers/net/mlx5/meson.build +1
-4@@ -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') --
Quoted 1 line
2.36.1
Thomas Monjalon
AppliedRe: [PATCH v3 0/2] fix build disabling common/mlx5
In reply to Thomas Monjalon30/10/2022 12:08, Thomas Monjalon:
Quoted 6 lines
Andrew reported a build failure when disabling mlx5 common driver. It is a blocker for -rc2 release.
While fixing the use of a variable across mlx5 drivers in first patch, the consistency of its use is improved in a second patch.
Quoted 6 lines
v2: apply the same protection to other mlx5 drivers
v3: fix ibverbs_link=dlopen (include directory was missing)Thomas Monjalon (2):
common/mlx5: fix build disabling
common/mlx5: move build config initialization and check
Applied
There is a CI error with Fedora 35 but it seems unrelated.