net/ice/base: fix flow director rule passthrough mode
[dpdk.git] / drivers / common / mlx5 / meson.build
index c6d4154..5a802ba 100644 (file)
@@ -7,11 +7,12 @@ if not is_linux
        subdir_done()
 endif
 
-pmd_dlopen = (get_option('ibverbs_link') == 'dlopen')
+static_ibverbs = (get_option('ibverbs_link') == 'static')
+dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen')
 LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so'
 LIB_GLUE_VERSION = '20.02.0'
 LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION
-if pmd_dlopen
+if dlopen_ibverbs
        dpdk_conf.set('RTE_IBVERBS_LINK_DLOPEN', 1)
        cflags += [
                '-DMLX5_GLUE="@0@"'.format(LIB_GLUE),
@@ -22,28 +23,41 @@ endif
 libnames = [ 'mlx5', 'ibverbs' ]
 libs = []
 foreach libname:libnames
-       lib = dependency('lib' + libname, required:false)
-       if not lib.found()
+       lib = dependency('lib' + libname, static:static_ibverbs, required:false)
+       if not lib.found() and not static_ibverbs
                lib = cc.find_library(libname, required:false)
        endif
        if lib.found()
                libs += lib
+               if not static_ibverbs and not dlopen_ibverbs
+                       ext_deps += lib
+               endif
        else
                build = false
                reason = 'missing dependency, "' + libname + '"'
                subdir_done()
        endif
 endforeach
+if static_ibverbs or dlopen_ibverbs
+       # Build without adding shared libs to Requires.private
+       ibv_cflags = run_command(pkgconf, '--cflags', 'libibverbs').stdout()
+       ext_deps += declare_dependency(compile_args: ibv_cflags.split())
+endif
+if static_ibverbs
+       # Add static deps ldflags to internal apps and Libs.private
+       ibv_ldflags = run_command(ldflags_ibverbs_static, check:true).stdout()
+       ext_deps += declare_dependency(link_args:ibv_ldflags.split())
+endif
 
-allow_experimental_apis = true
 deps += ['hash', 'pci', 'net', 'eal', 'kvargs']
-ext_deps += libs
 sources = files(
        'mlx5_devx_cmds.c',
        'mlx5_common.c',
        'mlx5_nl.c',
+       'mlx5_common_mp.c',
+       'mlx5_common_mr.c',
 )
-if not pmd_dlopen
+if not dlopen_ibverbs
        sources += files('mlx5_glue.c')
 endif
 cflags_options = [
@@ -80,6 +94,8 @@ has_member_args = [
 # [ "MACRO to define if found", "header for the search",
 #   "symbol to search" ]
 has_sym_args = [
+       [ 'HAVE_IBV_RELAXED_ORDERING', 'infiniband/verbs.h',
+       'IBV_ACCESS_RELAXED_ORDERING ' ],
        [ 'HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT', 'infiniband/mlx5dv.h',
        'MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX' ],
        [ 'HAVE_IBV_DEVICE_TUNNEL_SUPPORT', 'infiniband/mlx5dv.h',
@@ -106,6 +122,8 @@ has_sym_args = [
        'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ],
        [ 'HAVE_IBV_DEVX_ASYNC', 'infiniband/mlx5dv.h',
        'mlx5dv_devx_obj_query_async' ],
+       [ 'HAVE_IBV_DEVX_QP', 'infiniband/mlx5dv.h',
+       'mlx5dv_devx_qp_query' ],
        [ 'HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR', 'infiniband/mlx5dv.h',
        'mlx5dv_dr_action_create_dest_devx_tir' ],
        [ 'HAVE_IBV_DEVX_EVENT', 'infiniband/mlx5dv.h',
@@ -182,7 +200,7 @@ endforeach
 configure_file(output : 'mlx5_autoconf.h', configuration : config)
 
 # Build Glue Library
-if pmd_dlopen
+if dlopen_ibverbs
        dlopen_name = 'mlx5_glue'
        dlopen_lib_name = 'rte_pmd_@0@'.format(dlopen_name)
        dlopen_so_version = LIB_GLUE_VERSION
@@ -190,7 +208,7 @@ if pmd_dlopen
        dlopen_install_dir = [ eal_pmd_path + '-glue' ]
        dlopen_includes = [global_inc]
        dlopen_includes += include_directories(
-               '../../../lib/librte_eal/common/include/generic',
+               '../../../lib/librte_eal/include/generic',
        )
        shared_lib = shared_library(
                dlopen_lib_name,