1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright 2018 6WIND S.A.
3 # Copyright 2018 Mellanox Technologies, Ltd
7 reason = 'only supported on Linux'
12 pmd_dlopen = (get_option('ibverbs_link') == 'dlopen')
13 LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so'
14 LIB_GLUE_VERSION = '18.02.0'
15 LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION
17 dpdk_conf.set('RTE_IBVERBS_LINK_DLOPEN', 1)
19 '-DMLX4_GLUE="@0@"'.format(LIB_GLUE),
20 '-DMLX4_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION),
24 libnames = [ 'mlx4', 'ibverbs' ]
26 foreach libname:libnames
27 lib = dependency('lib' + libname, required:false)
29 lib = cc.find_library(libname, required:false)
35 reason = 'missing dependency, "' + libname + '"'
40 allow_experimental_apis = true
55 sources += files('mlx4_glue.c')
59 '-Wno-strict-prototypes',
64 foreach option:cflags_options
65 if cc.has_argument(option)
69 if get_option('buildtype').contains('debug')
70 cflags += [ '-pedantic', '-UNDEBUG', '-DPEDANTIC' ]
72 cflags += [ '-DNDEBUG', '-UPEDANTIC' ]
74 # To maintain the compatibility with the make build system
75 # mlx4_autoconf.h file is still generated.
76 # input array for meson member search:
77 # [ "MACRO to define if found", "header for the search",
78 # "symbol to search", "struct member to search" ]
81 [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h',
82 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ],
84 # input array for meson symbol search:
85 # [ "MACRO to define if found", "header for the search",
86 # "symbol to search" ]
88 [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h',
89 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ],
90 [ 'HAVE_IBV_MLX4_UAR_MMAP_OFFSET', 'infiniband/mlx4dv.h',
91 'MLX4DV_QP_MASK_UAR_MMAP_OFFSET' ],
93 config = configuration_data()
94 foreach arg:has_sym_args
95 config.set(arg[0], cc.has_header_symbol(arg[1], arg[2],
98 foreach arg:has_member_args
99 file_prefix = '#include <' + arg[1] + '>'
100 config.set(arg[0], cc.has_member(arg[2], arg[3],
101 prefix: file_prefix, dependencies: libs))
103 configure_file(output : 'mlx4_autoconf.h', configuration : config)
106 if pmd_dlopen and build
107 dlopen_name = 'mlx4_glue'
108 dlopen_lib_name = driver_name_fmt.format(dlopen_name)
109 dlopen_so_version = LIB_GLUE_VERSION
110 dlopen_sources = files('mlx4_glue.c')
111 dlopen_install_dir = [ eal_pmd_path + '-glue' ]
112 shared_lib = shared_library(
115 include_directories: global_inc,
119 '-Wl,-export-dynamic',
120 '-Wl,-h,@0@'.format(LIB_GLUE),
122 soversion: dlopen_so_version,
124 install_dir: dlopen_install_dir,