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'
11 pmd_dlopen = (get_option('ibverbs_link') == 'dlopen')
12 LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so'
13 LIB_GLUE_VERSION = '18.02.0'
14 LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION
16 dpdk_conf.set('RTE_IBVERBS_LINK_DLOPEN', 1)
18 '-DMLX4_GLUE="@0@"'.format(LIB_GLUE),
19 '-DMLX4_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION),
23 libnames = [ 'mlx4', 'ibverbs' ]
25 foreach libname:libnames
26 lib = dependency('lib' + libname, required:false)
28 lib = cc.find_library(libname, required:false)
34 reason = 'missing dependency, "' + libname + '"'
39 allow_experimental_apis = true
54 sources += files('mlx4_glue.c')
58 '-Wno-strict-prototypes',
63 foreach option:cflags_options
64 if cc.has_argument(option)
68 if get_option('buildtype').contains('debug')
69 cflags += [ '-pedantic', '-DPEDANTIC' ]
71 cflags += [ '-UPEDANTIC' ]
73 # To maintain the compatibility with the make build system
74 # mlx4_autoconf.h file is still generated.
75 # input array for meson member search:
76 # [ "MACRO to define if found", "header for the search",
77 # "symbol to search", "struct member to search" ]
80 [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h',
81 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ],
83 # input array for meson symbol search:
84 # [ "MACRO to define if found", "header for the search",
85 # "symbol to search" ]
87 [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h',
88 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ],
89 [ 'HAVE_IBV_MLX4_UAR_MMAP_OFFSET', 'infiniband/mlx4dv.h',
90 'MLX4DV_QP_MASK_UAR_MMAP_OFFSET' ],
92 config = configuration_data()
93 foreach arg:has_sym_args
94 config.set(arg[0], cc.has_header_symbol(arg[1], arg[2],
97 foreach arg:has_member_args
98 file_prefix = '#include <' + arg[1] + '>'
99 config.set(arg[0], cc.has_member(arg[2], arg[3],
100 prefix: file_prefix, dependencies: libs))
102 configure_file(output : 'mlx4_autoconf.h', configuration : config)
106 dlopen_name = 'mlx4_glue'
107 dlopen_lib_name = driver_name_fmt.format(dlopen_name)
108 dlopen_so_version = LIB_GLUE_VERSION
109 dlopen_sources = files('mlx4_glue.c')
110 dlopen_install_dir = [ eal_pmd_path + '-glue' ]
111 shared_lib = shared_library(
114 include_directories: global_inc,
118 '-Wl,-export-dynamic',
119 '-Wl,-h,@0@'.format(LIB_GLUE),
121 soversion: dlopen_so_version,
123 install_dir: dlopen_install_dir,