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 = [ 'mnl', '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')
60 '-Wno-strict-prototypes',
65 foreach option:cflags_options
66 if cc.has_argument(option)
70 if get_option('buildtype').contains('debug')
71 cflags += [ '-pedantic', '-UNDEBUG', '-DPEDANTIC' ]
73 cflags += [ '-DNDEBUG', '-UPEDANTIC' ]
75 # To maintain the compatibility with the make build system
76 # mlx4_autoconf.h file is still generated.
77 # input array for meson member search:
78 # [ "MACRO to define if found", "header for the search",
79 # "symbol to search", "struct member to search" ]
82 [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h',
83 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ],
85 # input array for meson symbol search:
86 # [ "MACRO to define if found", "header for the search",
87 # "symbol to search" ]
89 [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h',
90 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ],
91 [ 'HAVE_IBV_MLX4_UAR_MMAP_OFFSET', 'infiniband/mlx4dv.h',
92 'MLX4DV_QP_MASK_UAR_MMAP_OFFSET' ],
94 config = configuration_data()
95 foreach arg:has_sym_args
96 config.set(arg[0], cc.has_header_symbol(arg[1], arg[2],
99 foreach arg:has_member_args
100 file_prefix = '#include <' + arg[1] + '>'
101 config.set(arg[0], cc.has_member(arg[2], arg[3],
102 prefix: file_prefix, dependencies: libs))
104 configure_file(output : 'mlx4_autoconf.h', configuration : config)
107 if pmd_dlopen and build
108 dlopen_name = 'mlx4_glue'
109 dlopen_lib_name = driver_name_fmt.format(dlopen_name)
110 dlopen_so_version = LIB_GLUE_VERSION
111 dlopen_sources = files('mlx4_glue.c')
112 dlopen_install_dir = [ eal_pmd_path + '-glue' ]
113 shared_lib = shared_library(
116 include_directories: global_inc,
120 '-Wl,-export-dynamic',
121 '-Wl,-h,@0@'.format(LIB_GLUE),
123 soversion: dlopen_so_version,
125 install_dir: dlopen_install_dir,