From patchwork Wed Feb 12 01:59:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65746 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C078CA0530; Wed, 12 Feb 2020 03:00:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 63F4C2B94; Wed, 12 Feb 2020 02:59:55 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 514CD2B84 for ; Wed, 12 Feb 2020 02:59:53 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DBC3021C24; Tue, 11 Feb 2020 20:59:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 11 Feb 2020 20:59:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=zwBN9O7y5D rqOsaDuu9msqjOLlKuxH0+prPs2ysbjJY=; b=VFVhqoTBZ7xMYUlsOXHONltwkQ 4UTox4jpFpSbfZWjPdpEgutsLh4EncnxZyxDC1feemuFIvWtMH0Pbg2g3ilblMpg wmRgm3TqI8SWpvnv2VzG6tdMHc4XUppQv0sV36oFTk1KSttYT3Jk9OR7W2bMegl7 zSqc/bLS3ajh8Vz64= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=zwBN9O7y5DrqOsaDuu9msqjOLlKuxH0+prPs2ysbjJY=; b=eRME8hG1 gmbUK5VLe92Q6P5gX7dyqkjkr67yZakEVWPH4O+ySTgexwAHbNOLNs4835w0g+Nd JdAQ7njVcWJagqTrPhuH4PnT4XRTrkMqrkX7i3dfm5ywiY/rCboWYks/5YxGwFrQ ORODjmpDjsbjn0qT4cwDtBOwR/LXZGAsT+XeVvn7xG1xqAoTpQwxl9GsjeIXKgz2 qwbU9C0nkr/xLC7KV9X07wsBY0Kps7Gj9aPJy0kFYA0ZZhb4oXPO1f/16HcIlGPN 5zBSURcltXn3mCc2rCY6aTGMp+1OO0JZygfclmYbJNFkSdbh6p1GYKU7Hnjr+L0p jjB2CDq9vFzS9A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C13DA328005A; Tue, 11 Feb 2020 20:59:51 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Rosen Xu , Tianfei zhang Date: Wed, 12 Feb 2020 02:59:39 +0100 Message-Id: <20200212015944.3037000-2-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212015944.3037000-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212015944.3037000-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 1/6] drivers: cleanup meson build variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The variable build is already initialized as true in drivers/meson.build. Duplicate initializations can be removed from mlx. When the variable build is set to false, it is easier to call subdir_done() than branch the rest of the code on build condition. Suggested-by: Bruce Richardson Signed-off-by: Thomas Monjalon --- drivers/common/mlx5/meson.build | 293 ++++++++++++++++---------------- drivers/net/ipn3ke/meson.build | 17 +- drivers/net/mlx4/meson.build | 131 +++++++------- drivers/raw/ifpga/meson.build | 23 ++- 4 files changed, 230 insertions(+), 234 deletions(-) diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 2b704107cd..be57558267 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -6,7 +6,6 @@ if not is_linux reason = 'only supported on Linux' subdir_done() endif -build = true pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so' @@ -32,158 +31,158 @@ foreach libname:libnames else build = false reason = 'missing dependency, "' + libname + '"' + subdir_done() endif endforeach -if build - 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', - ) - if not pmd_dlopen - sources += files('mlx5_glue.c') - endif - cflags_options = [ - '-std=c11', - '-Wno-strict-prototypes', - '-D_BSD_SOURCE', - '-D_DEFAULT_SOURCE', - '-D_XOPEN_SOURCE=600' - ] - foreach option:cflags_options - if cc.has_argument(option) - cflags += option - endif - endforeach - if get_option('buildtype').contains('debug') - cflags += [ '-pedantic', '-DPEDANTIC' ] - else - cflags += [ '-UPEDANTIC' ] +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', +) +if not pmd_dlopen + sources += files('mlx5_glue.c') +endif +cflags_options = [ + '-std=c11', + '-Wno-strict-prototypes', + '-D_BSD_SOURCE', + '-D_DEFAULT_SOURCE', + '-D_XOPEN_SOURCE=600' +] +foreach option:cflags_options + if cc.has_argument(option) + cflags += option endif - # To maintain the compatibility with the make build system - # mlx5_autoconf.h file is still generated. - # input array for meson member search: - # [ "MACRO to define if found", "header for the search", - # "symbol to search", "struct member to search" ] - has_member_args = [ - [ 'HAVE_IBV_MLX5_MOD_SWP', 'infiniband/mlx5dv.h', - 'struct mlx5dv_sw_parsing_caps', 'sw_parsing_offloads' ], - [ 'HAVE_IBV_DEVICE_COUNTERS_SET_V42', 'infiniband/verbs.h', - 'struct ibv_counter_set_init_attr', 'counter_set_id' ], - [ 'HAVE_IBV_DEVICE_COUNTERS_SET_V45', 'infiniband/verbs.h', - 'struct ibv_counters_init_attr', 'comp_mask' ], - ] - # input array for meson symbol search: - # [ "MACRO to define if found", "header for the search", - # "symbol to search" ] - has_sym_args = [ - [ 'HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT', 'infiniband/mlx5dv.h', - 'MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX' ], - [ 'HAVE_IBV_DEVICE_TUNNEL_SUPPORT', 'infiniband/mlx5dv.h', - 'MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS' ], - [ 'HAVE_IBV_MLX5_MOD_MPW', 'infiniband/mlx5dv.h', - 'MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED' ], - [ 'HAVE_IBV_MLX5_MOD_CQE_128B_COMP', 'infiniband/mlx5dv.h', - 'MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP' ], - [ 'HAVE_IBV_MLX5_MOD_CQE_128B_PAD', 'infiniband/mlx5dv.h', - 'MLX5DV_CQ_INIT_ATTR_FLAGS_CQE_PAD' ], - [ 'HAVE_IBV_FLOW_DV_SUPPORT', 'infiniband/mlx5dv.h', - 'mlx5dv_create_flow_action_packet_reformat' ], - [ 'HAVE_IBV_DEVICE_MPLS_SUPPORT', 'infiniband/verbs.h', - 'IBV_FLOW_SPEC_MPLS' ], - [ 'HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING', 'infiniband/verbs.h', - 'IBV_WQ_FLAGS_PCI_WRITE_END_PADDING' ], - [ 'HAVE_IBV_WQ_FLAG_RX_END_PADDING', 'infiniband/verbs.h', - 'IBV_WQ_FLAG_RX_END_PADDING' ], - [ 'HAVE_MLX5DV_DR_DEVX_PORT', 'infiniband/mlx5dv.h', - 'mlx5dv_query_devx_port' ], - [ 'HAVE_IBV_DEVX_OBJ', 'infiniband/mlx5dv.h', - 'mlx5dv_devx_obj_create' ], - [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h', - 'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ], - [ 'HAVE_IBV_DEVX_ASYNC', 'infiniband/mlx5dv.h', - 'mlx5dv_devx_obj_query_async' ], - [ 'HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR', 'infiniband/mlx5dv.h', - 'mlx5dv_dr_action_create_dest_devx_tir' ], - [ 'HAVE_IBV_DEVX_EVENT', 'infiniband/mlx5dv.h', - 'mlx5dv_devx_get_event' ], - [ 'HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER', 'infiniband/mlx5dv.h', - 'mlx5dv_dr_action_create_flow_meter' ], - [ 'HAVE_MLX5DV_MMAP_GET_NC_PAGES_CMD', 'infiniband/mlx5dv.h', - 'MLX5_MMAP_GET_NC_PAGES_CMD' ], - [ 'HAVE_MLX5DV_DR', 'infiniband/mlx5dv.h', - 'MLX5DV_DR_DOMAIN_TYPE_NIC_RX' ], - [ 'HAVE_MLX5DV_DR_ESWITCH', 'infiniband/mlx5dv.h', - 'MLX5DV_DR_DOMAIN_TYPE_FDB' ], - [ 'HAVE_MLX5DV_DR_VLAN', 'infiniband/mlx5dv.h', - 'mlx5dv_dr_action_create_push_vlan' ], - [ 'HAVE_IBV_VAR', 'infiniband/mlx5dv.h', 'mlx5dv_alloc_var' ], - [ 'HAVE_SUPPORTED_40000baseKR4_Full', 'linux/ethtool.h', - 'SUPPORTED_40000baseKR4_Full' ], - [ 'HAVE_SUPPORTED_40000baseCR4_Full', 'linux/ethtool.h', - 'SUPPORTED_40000baseCR4_Full' ], - [ 'HAVE_SUPPORTED_40000baseSR4_Full', 'linux/ethtool.h', - 'SUPPORTED_40000baseSR4_Full' ], - [ 'HAVE_SUPPORTED_40000baseLR4_Full', 'linux/ethtool.h', - 'SUPPORTED_40000baseLR4_Full' ], - [ 'HAVE_SUPPORTED_56000baseKR4_Full', 'linux/ethtool.h', - 'SUPPORTED_56000baseKR4_Full' ], - [ 'HAVE_SUPPORTED_56000baseCR4_Full', 'linux/ethtool.h', - 'SUPPORTED_56000baseCR4_Full' ], - [ 'HAVE_SUPPORTED_56000baseSR4_Full', 'linux/ethtool.h', - 'SUPPORTED_56000baseSR4_Full' ], - [ 'HAVE_SUPPORTED_56000baseLR4_Full', 'linux/ethtool.h', - 'SUPPORTED_56000baseLR4_Full' ], - [ 'HAVE_ETHTOOL_LINK_MODE_25G', 'linux/ethtool.h', - 'ETHTOOL_LINK_MODE_25000baseCR_Full_BIT' ], - [ 'HAVE_ETHTOOL_LINK_MODE_50G', 'linux/ethtool.h', - 'ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT' ], - [ 'HAVE_ETHTOOL_LINK_MODE_100G', 'linux/ethtool.h', - 'ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT' ], - [ 'HAVE_IFLA_NUM_VF', 'linux/if_link.h', - 'IFLA_NUM_VF' ], - [ 'HAVE_IFLA_EXT_MASK', 'linux/if_link.h', - 'IFLA_EXT_MASK' ], - [ 'HAVE_IFLA_PHYS_SWITCH_ID', 'linux/if_link.h', - 'IFLA_PHYS_SWITCH_ID' ], - [ 'HAVE_IFLA_PHYS_PORT_NAME', 'linux/if_link.h', - 'IFLA_PHYS_PORT_NAME' ], - [ 'HAVE_RDMA_NL_NLDEV', 'rdma/rdma_netlink.h', - 'RDMA_NL_NLDEV' ], - [ 'HAVE_RDMA_NLDEV_CMD_GET', 'rdma/rdma_netlink.h', - 'RDMA_NLDEV_CMD_GET' ], - [ 'HAVE_RDMA_NLDEV_CMD_PORT_GET', 'rdma/rdma_netlink.h', - 'RDMA_NLDEV_CMD_PORT_GET' ], - [ 'HAVE_RDMA_NLDEV_ATTR_DEV_INDEX', 'rdma/rdma_netlink.h', - 'RDMA_NLDEV_ATTR_DEV_INDEX' ], - [ 'HAVE_RDMA_NLDEV_ATTR_DEV_NAME', 'rdma/rdma_netlink.h', - 'RDMA_NLDEV_ATTR_DEV_NAME' ], - [ 'HAVE_RDMA_NLDEV_ATTR_PORT_INDEX', 'rdma/rdma_netlink.h', - 'RDMA_NLDEV_ATTR_PORT_INDEX' ], - [ 'HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX', 'rdma/rdma_netlink.h', - 'RDMA_NLDEV_ATTR_NDEV_INDEX' ], - [ 'HAVE_MLX5_DR_FLOW_DUMP', 'infiniband/mlx5dv.h', - 'mlx5dv_dump_dr_domain'], - [ 'HAVE_DEVLINK', 'linux/devlink.h', 'DEVLINK_GENL_NAME' ], - ] - config = configuration_data() - foreach arg:has_sym_args - config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], - dependencies: libs)) - endforeach - foreach arg:has_member_args - file_prefix = '#include <' + arg[1] + '>' - config.set(arg[0], cc.has_member(arg[2], arg[3], - prefix : file_prefix, dependencies: libs)) - endforeach - configure_file(output : 'mlx5_autoconf.h', configuration : config) +endforeach +if get_option('buildtype').contains('debug') + cflags += [ '-pedantic', '-DPEDANTIC' ] +else + cflags += [ '-UPEDANTIC' ] endif +# To maintain the compatibility with the make build system +# mlx5_autoconf.h file is still generated. +# input array for meson member search: +# [ "MACRO to define if found", "header for the search", +# "symbol to search", "struct member to search" ] +has_member_args = [ + [ 'HAVE_IBV_MLX5_MOD_SWP', 'infiniband/mlx5dv.h', + 'struct mlx5dv_sw_parsing_caps', 'sw_parsing_offloads' ], + [ 'HAVE_IBV_DEVICE_COUNTERS_SET_V42', 'infiniband/verbs.h', + 'struct ibv_counter_set_init_attr', 'counter_set_id' ], + [ 'HAVE_IBV_DEVICE_COUNTERS_SET_V45', 'infiniband/verbs.h', + 'struct ibv_counters_init_attr', 'comp_mask' ], +] +# input array for meson symbol search: +# [ "MACRO to define if found", "header for the search", +# "symbol to search" ] +has_sym_args = [ + [ 'HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT', 'infiniband/mlx5dv.h', + 'MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX' ], + [ 'HAVE_IBV_DEVICE_TUNNEL_SUPPORT', 'infiniband/mlx5dv.h', + 'MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS' ], + [ 'HAVE_IBV_MLX5_MOD_MPW', 'infiniband/mlx5dv.h', + 'MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED' ], + [ 'HAVE_IBV_MLX5_MOD_CQE_128B_COMP', 'infiniband/mlx5dv.h', + 'MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP' ], + [ 'HAVE_IBV_MLX5_MOD_CQE_128B_PAD', 'infiniband/mlx5dv.h', + 'MLX5DV_CQ_INIT_ATTR_FLAGS_CQE_PAD' ], + [ 'HAVE_IBV_FLOW_DV_SUPPORT', 'infiniband/mlx5dv.h', + 'mlx5dv_create_flow_action_packet_reformat' ], + [ 'HAVE_IBV_DEVICE_MPLS_SUPPORT', 'infiniband/verbs.h', + 'IBV_FLOW_SPEC_MPLS' ], + [ 'HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING', 'infiniband/verbs.h', + 'IBV_WQ_FLAGS_PCI_WRITE_END_PADDING' ], + [ 'HAVE_IBV_WQ_FLAG_RX_END_PADDING', 'infiniband/verbs.h', + 'IBV_WQ_FLAG_RX_END_PADDING' ], + [ 'HAVE_MLX5DV_DR_DEVX_PORT', 'infiniband/mlx5dv.h', + 'mlx5dv_query_devx_port' ], + [ 'HAVE_IBV_DEVX_OBJ', 'infiniband/mlx5dv.h', + 'mlx5dv_devx_obj_create' ], + [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h', + 'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ], + [ 'HAVE_IBV_DEVX_ASYNC', 'infiniband/mlx5dv.h', + 'mlx5dv_devx_obj_query_async' ], + [ 'HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR', 'infiniband/mlx5dv.h', + 'mlx5dv_dr_action_create_dest_devx_tir' ], + [ 'HAVE_IBV_DEVX_EVENT', 'infiniband/mlx5dv.h', + 'mlx5dv_devx_get_event' ], + [ 'HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER', 'infiniband/mlx5dv.h', + 'mlx5dv_dr_action_create_flow_meter' ], + [ 'HAVE_MLX5DV_MMAP_GET_NC_PAGES_CMD', 'infiniband/mlx5dv.h', + 'MLX5_MMAP_GET_NC_PAGES_CMD' ], + [ 'HAVE_MLX5DV_DR', 'infiniband/mlx5dv.h', + 'MLX5DV_DR_DOMAIN_TYPE_NIC_RX' ], + [ 'HAVE_MLX5DV_DR_ESWITCH', 'infiniband/mlx5dv.h', + 'MLX5DV_DR_DOMAIN_TYPE_FDB' ], + [ 'HAVE_MLX5DV_DR_VLAN', 'infiniband/mlx5dv.h', + 'mlx5dv_dr_action_create_push_vlan' ], + [ 'HAVE_IBV_VAR', 'infiniband/mlx5dv.h', 'mlx5dv_alloc_var' ], + [ 'HAVE_SUPPORTED_40000baseKR4_Full', 'linux/ethtool.h', + 'SUPPORTED_40000baseKR4_Full' ], + [ 'HAVE_SUPPORTED_40000baseCR4_Full', 'linux/ethtool.h', + 'SUPPORTED_40000baseCR4_Full' ], + [ 'HAVE_SUPPORTED_40000baseSR4_Full', 'linux/ethtool.h', + 'SUPPORTED_40000baseSR4_Full' ], + [ 'HAVE_SUPPORTED_40000baseLR4_Full', 'linux/ethtool.h', + 'SUPPORTED_40000baseLR4_Full' ], + [ 'HAVE_SUPPORTED_56000baseKR4_Full', 'linux/ethtool.h', + 'SUPPORTED_56000baseKR4_Full' ], + [ 'HAVE_SUPPORTED_56000baseCR4_Full', 'linux/ethtool.h', + 'SUPPORTED_56000baseCR4_Full' ], + [ 'HAVE_SUPPORTED_56000baseSR4_Full', 'linux/ethtool.h', + 'SUPPORTED_56000baseSR4_Full' ], + [ 'HAVE_SUPPORTED_56000baseLR4_Full', 'linux/ethtool.h', + 'SUPPORTED_56000baseLR4_Full' ], + [ 'HAVE_ETHTOOL_LINK_MODE_25G', 'linux/ethtool.h', + 'ETHTOOL_LINK_MODE_25000baseCR_Full_BIT' ], + [ 'HAVE_ETHTOOL_LINK_MODE_50G', 'linux/ethtool.h', + 'ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT' ], + [ 'HAVE_ETHTOOL_LINK_MODE_100G', 'linux/ethtool.h', + 'ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT' ], + [ 'HAVE_IFLA_NUM_VF', 'linux/if_link.h', + 'IFLA_NUM_VF' ], + [ 'HAVE_IFLA_EXT_MASK', 'linux/if_link.h', + 'IFLA_EXT_MASK' ], + [ 'HAVE_IFLA_PHYS_SWITCH_ID', 'linux/if_link.h', + 'IFLA_PHYS_SWITCH_ID' ], + [ 'HAVE_IFLA_PHYS_PORT_NAME', 'linux/if_link.h', + 'IFLA_PHYS_PORT_NAME' ], + [ 'HAVE_RDMA_NL_NLDEV', 'rdma/rdma_netlink.h', + 'RDMA_NL_NLDEV' ], + [ 'HAVE_RDMA_NLDEV_CMD_GET', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_CMD_GET' ], + [ 'HAVE_RDMA_NLDEV_CMD_PORT_GET', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_CMD_PORT_GET' ], + [ 'HAVE_RDMA_NLDEV_ATTR_DEV_INDEX', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_ATTR_DEV_INDEX' ], + [ 'HAVE_RDMA_NLDEV_ATTR_DEV_NAME', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_ATTR_DEV_NAME' ], + [ 'HAVE_RDMA_NLDEV_ATTR_PORT_INDEX', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_ATTR_PORT_INDEX' ], + [ 'HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_ATTR_NDEV_INDEX' ], + [ 'HAVE_MLX5_DR_FLOW_DUMP', 'infiniband/mlx5dv.h', + 'mlx5dv_dump_dr_domain'], + [ 'HAVE_DEVLINK', 'linux/devlink.h', 'DEVLINK_GENL_NAME' ], +] +config = configuration_data() +foreach arg:has_sym_args + config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], + dependencies: libs)) +endforeach +foreach arg:has_member_args + file_prefix = '#include <' + arg[1] + '>' + config.set(arg[0], cc.has_member(arg[2], arg[3], + prefix : file_prefix, dependencies: libs)) +endforeach +configure_file(output : 'mlx5_autoconf.h', configuration : config) + # Build Glue Library -if pmd_dlopen and build +if pmd_dlopen dlopen_name = 'mlx5_glue' dlopen_lib_name = driver_name_fmt.format(dlopen_name) dlopen_so_version = LIB_GLUE_VERSION diff --git a/drivers/net/ipn3ke/meson.build b/drivers/net/ipn3ke/meson.build index bfec592aba..f19083af15 100644 --- a/drivers/net/ipn3ke/meson.build +++ b/drivers/net/ipn3ke/meson.build @@ -16,16 +16,15 @@ endif if not dep.found() build = false reason = 'missing dependency, "libfdt"' + subdir_done() endif -if build - allow_experimental_apis = true +allow_experimental_apis = true - includes += include_directories('../../raw/ifpga') +includes += include_directories('../../raw/ifpga') - sources += files('ipn3ke_ethdev.c', - 'ipn3ke_representor.c', - 'ipn3ke_tm.c', - 'ipn3ke_flow.c') - deps += ['bus_ifpga', 'ethdev', 'sched'] -endif +sources += files('ipn3ke_ethdev.c', + 'ipn3ke_representor.c', + 'ipn3ke_tm.c', + 'ipn3ke_flow.c') +deps += ['bus_ifpga', 'ethdev', 'sched'] diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index 0260c5dc59..6d2397b3cc 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -7,7 +7,6 @@ if not is_linux reason = 'only supported on Linux' subdir_done() endif -build = true pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so' @@ -33,77 +32,77 @@ foreach libname:libnames else build = false reason = 'missing dependency, "' + libname + '"' + subdir_done() endif endforeach -if build - allow_experimental_apis = true - ext_deps += libs - sources = files( - 'mlx4.c', - 'mlx4_ethdev.c', - 'mlx4_flow.c', - 'mlx4_intr.c', - 'mlx4_mp.c', - 'mlx4_mr.c', - 'mlx4_rxq.c', - 'mlx4_rxtx.c', - 'mlx4_txq.c', - 'mlx4_utils.c', - ) - if not pmd_dlopen - sources += files('mlx4_glue.c') - endif - cflags_options = [ - '-std=c11', - '-Wno-strict-prototypes', - '-D_BSD_SOURCE', - '-D_DEFAULT_SOURCE', - '-D_XOPEN_SOURCE=600' - ] - foreach option:cflags_options - if cc.has_argument(option) - cflags += option - endif - endforeach - if get_option('buildtype').contains('debug') - cflags += [ '-pedantic', '-DPEDANTIC' ] - else - cflags += [ '-UPEDANTIC' ] +allow_experimental_apis = true +ext_deps += libs +sources = files( + 'mlx4.c', + 'mlx4_ethdev.c', + 'mlx4_flow.c', + 'mlx4_intr.c', + 'mlx4_mp.c', + 'mlx4_mr.c', + 'mlx4_rxq.c', + 'mlx4_rxtx.c', + 'mlx4_txq.c', + 'mlx4_utils.c', +) +if not pmd_dlopen + sources += files('mlx4_glue.c') +endif +cflags_options = [ + '-std=c11', + '-Wno-strict-prototypes', + '-D_BSD_SOURCE', + '-D_DEFAULT_SOURCE', + '-D_XOPEN_SOURCE=600' +] +foreach option:cflags_options + if cc.has_argument(option) + cflags += option endif - # To maintain the compatibility with the make build system - # mlx4_autoconf.h file is still generated. - # input array for meson member search: - # [ "MACRO to define if found", "header for the search", - # "symbol to search", "struct member to search" ] - # - has_member_args = [ - [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h', - 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ], - ] - # input array for meson symbol search: - # [ "MACRO to define if found", "header for the search", - # "symbol to search" ] - has_sym_args = [ - [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h', - 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ], - [ 'HAVE_IBV_MLX4_UAR_MMAP_OFFSET', 'infiniband/mlx4dv.h', - 'MLX4DV_QP_MASK_UAR_MMAP_OFFSET' ], - ] - config = configuration_data() - foreach arg:has_sym_args - config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], - dependencies: libs)) - endforeach - foreach arg:has_member_args - file_prefix = '#include <' + arg[1] + '>' - config.set(arg[0], cc.has_member(arg[2], arg[3], - prefix: file_prefix, dependencies: libs)) - endforeach - configure_file(output : 'mlx4_autoconf.h', configuration : config) +endforeach +if get_option('buildtype').contains('debug') + cflags += [ '-pedantic', '-DPEDANTIC' ] +else + cflags += [ '-UPEDANTIC' ] endif +# To maintain the compatibility with the make build system +# mlx4_autoconf.h file is still generated. +# input array for meson member search: +# [ "MACRO to define if found", "header for the search", +# "symbol to search", "struct member to search" ] +# +has_member_args = [ + [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h', + 'struct mlx4_wqe_lso_seg', 'mss_hdr_size' ], +] +# input array for meson symbol search: +# [ "MACRO to define if found", "header for the search", +# "symbol to search" ] +has_sym_args = [ + [ 'HAVE_IBV_MLX4_BUF_ALLOCATORS', 'infiniband/mlx4dv.h', + 'MLX4DV_SET_CTX_ATTR_BUF_ALLOCATORS' ], + [ 'HAVE_IBV_MLX4_UAR_MMAP_OFFSET', 'infiniband/mlx4dv.h', + 'MLX4DV_QP_MASK_UAR_MMAP_OFFSET' ], +] +config = configuration_data() +foreach arg:has_sym_args + config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], + dependencies: libs)) +endforeach +foreach arg:has_member_args + file_prefix = '#include <' + arg[1] + '>' + config.set(arg[0], cc.has_member(arg[2], arg[3], + prefix: file_prefix, dependencies: libs)) +endforeach +configure_file(output : 'mlx4_autoconf.h', configuration : config) + # Build Glue Library -if pmd_dlopen and build +if pmd_dlopen dlopen_name = 'mlx4_glue' dlopen_lib_name = driver_name_fmt.format(dlopen_name) dlopen_so_version = LIB_GLUE_VERSION diff --git a/drivers/raw/ifpga/meson.build b/drivers/raw/ifpga/meson.build index d4027068d6..e2a4b8cccb 100644 --- a/drivers/raw/ifpga/meson.build +++ b/drivers/raw/ifpga/meson.build @@ -8,21 +8,20 @@ endif if not dep.found() build = false reason = 'missing dependency, "libfdt"' + subdir_done() endif -if build - subdir('base') - objs = [base_objs] +subdir('base') +objs = [base_objs] - deps += ['ethdev', 'rawdev', 'pci', 'bus_pci', 'kvargs', - 'bus_vdev', 'bus_ifpga', 'net', 'pmd_i40e', 'pmd_ipn3ke'] - ext_deps += dep +deps += ['ethdev', 'rawdev', 'pci', 'bus_pci', 'kvargs', + 'bus_vdev', 'bus_ifpga', 'net', 'pmd_i40e', 'pmd_ipn3ke'] +ext_deps += dep - sources = files('ifpga_rawdev.c') +sources = files('ifpga_rawdev.c') - includes += include_directories('base') - includes += include_directories('../../net/ipn3ke') - includes += include_directories('../../net/i40e') +includes += include_directories('base') +includes += include_directories('../../net/ipn3ke') +includes += include_directories('../../net/i40e') - allow_experimental_apis = true -endif +allow_experimental_apis = true From patchwork Wed Feb 12 01:59:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65747 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E049A0530; Wed, 12 Feb 2020 03:00:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 39C902C18; Wed, 12 Feb 2020 02:59:57 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 06EB62BC7 for ; Wed, 12 Feb 2020 02:59:56 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C319621F15; Tue, 11 Feb 2020 20:59:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 11 Feb 2020 20:59:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=T1TutPdoGE cvjSFuGN6E78WTLHg1ZBoAsJzEvleBY34=; b=Lzs7hUaLHH/WsY9ockM6jheg88 BpiPNL5Msp1GujeuQ7MnfGshGnxjiV+ofw3r45ZLxso9YDh8LOqYVLsX8dK7yX47 cmui6PnX73TwZ0CzSCT7m7g9/KnV3k5M8L+4K7Nuyx9wIPxAcPCslpSBDfvavQmQ VPXd2GB7i+3qwoRAU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=T1TutPdoGEcvjSFuGN6E78WTLHg1ZBoAsJzEvleBY34=; b=FdRSySiW FQV0exBc4vKBP18EwaoaOIs7nxiKF/k17f4K37f5rEqYgKmDj/Sg8QmLQkoRtIK/ PaHTdx2jKl1qZ7W6KGcglLS/Jp+fwb0z1nXmJfGFn4KPNk/8RAE8i4+bdTwsUdDN xf14WaNhl9gCHANDQye1SUm/eaw5k2xjUgru0tIY5scPxMPeOrXkegBZQG73aea0 /zJ/z7Rtg/ksHU3ceo40nmWHqc4ulSG1yO184KHlEuLDAuiQbYZ3/NWQdTlKSvhN hBJYeibX2yzTqWNelMcGVuYCFHOMUEzKdwkSSiTgJNhT7tMaaVWlknVwGh3b/D0p gMeDGaCpbCmCnw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepvdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C96A9328005A; Tue, 11 Feb 2020 20:59:53 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, Matan Azrad , Shahaf Shuler , John McNamara , Marko Kovacevic , Viacheslav Ovsiienko Date: Wed, 12 Feb 2020 02:59:40 +0100 Message-Id: <20200212015944.3037000-3-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212015944.3037000-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212015944.3037000-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 2/6] net/mlx: add static ibverbs linkage with meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The libibverbs (and libmlx4/5) can be statically embedded in the shared PMD library, or in the application with the static PMD. It was supported with make build system in commit 2c0dd7b69fb0 ("config: add static linkage of mlx dependency"). The same feature is enabled with meson when using pkg-config (i.e. only if the call to dependency() is successful). The fallback method for searching library with cc.find_library() is not supported because the dependencies of the found library would not be linked (no such info in .a file unlike .so). The main difference, in meson build system, is the generated .pc file giving arguments to link DPDK with the application. Unfortunately the .pc file will not keep memory of the static linkage option for libibverbs. Signed-off-by: Thomas Monjalon --- doc/guides/nics/mlx4.rst | 4 ++++ doc/guides/nics/mlx5.rst | 4 ++++ drivers/common/mlx5/meson.build | 5 +++-- drivers/net/mlx4/meson.build | 5 +++-- meson_options.txt | 4 ++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/guides/nics/mlx4.rst b/doc/guides/nics/mlx4.rst index d0e8a8b2ff..4b1d1aceb2 100644 --- a/doc/guides/nics/mlx4.rst +++ b/doc/guides/nics/mlx4.rst @@ -92,6 +92,10 @@ These options can be modified in the ``.config`` file. adds additional run-time checks and debugging messages at the cost of lower performance. +This option is available in meson: + +- ``ibverbs_link`` can be ``static``, ``shared``, or ``dlopen``. + Environment variables ~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 2411fb3461..ffab34d281 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -278,6 +278,10 @@ These options can be modified in the ``.config`` file. 64. Default armv8a configuration of make build and meson build set it to 128 then brings performance degradation. +This option is available in meson: + +- ``ibverbs_link`` can be ``static``, ``shared``, or ``dlopen``. + Environment variables ~~~~~~~~~~~~~~~~~~~~~ diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index be57558267..47ae1b65c2 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -7,6 +7,7 @@ if not is_linux subdir_done() endif +static_ibverbs = (get_option('ibverbs_link') == 'static') pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so' LIB_GLUE_VERSION = '20.02.0' @@ -22,8 +23,8 @@ 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() diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index 6d2397b3cc..7513516764 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -8,6 +8,7 @@ if not is_linux subdir_done() endif +static_ibverbs = (get_option('ibverbs_link') == 'static') pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so' LIB_GLUE_VERSION = '18.02.0' @@ -23,8 +24,8 @@ endif libnames = [ 'mlx4', '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() diff --git a/meson_options.txt b/meson_options.txt index 20be15fe6b..9e4923a4f1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,8 +14,8 @@ option('examples', type: 'string', value: '', description: 'Comma-separated list of examples to build by default') option('flexran_sdk', type: 'string', value: '', description: 'Path to FlexRAN SDK optional Libraries for BBDEV device') -option('ibverbs_link', type: 'combo', choices : ['shared', 'dlopen'], value: 'shared', - description: 'Linkage method (shared/dlopen) for Mellanox PMDs with ibverbs dependencies.') +option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', + description: 'Linkage method (static/shared/dlopen) for Mellanox PMDs with ibverbs dependencies.') option('include_subdir_arch', type: 'string', value: '', description: 'subdirectory where to install arch-dependent headers') option('kernel_dir', type: 'string', value: '', From patchwork Wed Feb 12 01:59:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65748 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A5C6A0530; Wed, 12 Feb 2020 03:00:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB9841BDF8; Wed, 12 Feb 2020 02:59:58 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 07EED2BF1 for ; Wed, 12 Feb 2020 02:59:57 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AE9DC21B14; Tue, 11 Feb 2020 20:59:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 11 Feb 2020 20:59:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=H/+z4oNHkV jRmZuRiw2F6f0Sev3pNw3XncrPU3rLCjk=; b=g5z5n+LxEnN+ase/tTPz9RthmY WxHXiEtw6EEzhbUohJRCVm/iVDHYrfNCBKYRbkY95sJsg77jjVzbAL2HK8wu8r+k Cr/ObmyZAybxX1eDmrH0Q4OKP5rnslVvA6Dr+jr8zqPTXDfluK91J5XtvLi2TdPj mBZJ+gL6NgSsZCFdU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=H/+z4oNHkVjRmZuRiw2F6f0Sev3pNw3XncrPU3rLCjk=; b=HGNx9mjF /17DJf57VjrcIxmguxlCk8ylSCGb1EtoQ/lMXVAom1Lfjnm8evjiq6kTb/mXwlqa A8htlm/O5NFi6EB+SQPxGRl3nRYmlLTnNfDZue3CdRYzpxxQTvxAe312lG9iSGin e1xmfUsG+vApl+b/t9qQJ3NSAInRIw0s4gqupV82BgyPcXiJHO0IiZcy0B+/In1y iq2XG6E9436EUD5YNEaNsxZ/uDi0sAAlKJWn5y6XnZ1KnoW7+SqAWFVmiSg6gQAV UfcMEPbT9kBIdYNOdcftQnM2BL+gtDtvwIHpL4rlaqRwGYBThM+5YCDoxJP+drki hMsJFFqlvzg1pA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepvdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id E3108328005E; Tue, 11 Feb 2020 20:59:55 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Wed, 12 Feb 2020 02:59:41 +0100 Message-Id: <20200212015944.3037000-4-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212015944.3037000-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212015944.3037000-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 3/6] buildtools: get static mlx dependencies for meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The shell script options-ibverbs-static.sh was used with make in forcing static linkage of ibverbs libraries. When choosing to link with a static dependency in meson, the generated .pc file will not force such static linkage. The solution will rely on using this script in meson. If linking with libraries installed in a non-standard path, an option -L is provided via EXTRA_LDFLAGS in case of using make. With meson, tuning PKG_CONFIG_PATH for pkg-config should be enough. When statically linking an application, the .pc file must save the -L path so the application link will work without any extra option. That's why --libs-only-l is replaced with --libs which includes -L. Options which are neither -l or -L are filtered out because not needed and can cause compilation issues with the legacy system using make. The other change in this script is to drop the first occurrences of the main library file (libiverbs.a). Only the last occurrence is kept. It fixes some undefined references when linking a static application using libdpdk.pc. Signed-off-by: Thomas Monjalon --- buildtools/options-ibverbs-static.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/buildtools/options-ibverbs-static.sh b/buildtools/options-ibverbs-static.sh index 0f285a343b..0740a711ff 100755 --- a/buildtools/options-ibverbs-static.sh +++ b/buildtools/options-ibverbs-static.sh @@ -9,6 +9,13 @@ # # PKG_CONFIG_PATH may be required to be set if libibverbs.pc is not installed. -pkg-config --libs-only-l --static libibverbs | +lib='libibverbs' +deps='pthread|nl' + +pkg-config --libs --static $lib | tr '[:space:]' '\n' | - sed -r '/^-l(pthread|nl)/! s,(^-l)(.*),\1:lib\2.a,' + sed -r "/^-l($deps)/! s,(^-l)(.*),\1:lib\2.a," | # explicit .a + sed -n '/^-[Ll]/p' | # extra link options may break with make + tac | + awk "/^-l:$lib.a/&&c++ {next} 1" | # drop first duplicates of main lib + tac From patchwork Wed Feb 12 01:59:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65749 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9E913A0530; Wed, 12 Feb 2020 03:00:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 32D612A5D; Wed, 12 Feb 2020 03:00:04 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id A33282A5D for ; Wed, 12 Feb 2020 03:00:02 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 52F2621AB4; Tue, 11 Feb 2020 21:00:02 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 11 Feb 2020 21:00:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=ZYQkCr2pq0 5CrbRZIgRmtUTf809zT+J8F19q/BUtSHI=; b=hnMdky/qYb2/o4QXr/Yr4+9RWk hH9USypMuoBIaCSFy1QSELFknIinLpt/f90XYolBF8z+4AT6UTDYh8hMaHUTZY2K yylbuyQH0yLNQGrTV/WJpQSvyWPDeDnqvzSEIT+biMA3UamKlqwv1h1qT6dM8Ncg ZTPy8pb6qjE5sTCMw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=ZYQkCr2pq05CrbRZIgRmtUTf809zT+J8F19q/BUtSHI=; b=hBF7iR7G CZJLWR6YZ38hlSpfjsrlXQfqowH/737brgE0E1NQ0ESBxeBde9AX5MbW+RPq+Hua jp7mukUPGgoHAKJCxQrHIJrmSrX3u2kdfyTRRdvMlTY3TYkka+K4sSM4HFSf9wCZ d1rwMZbwElzzihFNFjTw5/dznTGEKcrQnWDUIs30Y3O0p7QeTlwD/FNYLBbO2bhh oyJxIsEw980i83B+3LUG4MhIpd5C5ysB6DZbPCngqkH4USakgudeYc8zCS6PZQxq TLX6w97heNoLPv+oGUugPq6u1Ng41H46VkasQ4HzwCsYPdVg8nQWWLmkm4JT5fOe kiOMvwm8gKC5Sw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffoh hmrghinhepghhithhhuhgsrdgtohhmnecukfhppeejjedrudefgedrvddtfedrudekgeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomh grshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 1FD373280063; Tue, 11 Feb 2020 21:00:01 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Wed, 12 Feb 2020 02:59:42 +0100 Message-Id: <20200212015944.3037000-5-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212015944.3037000-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212015944.3037000-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 4/6] net/mlx: workaround static linkage with meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If ibverbs_link is static and the application choose to link DPDK as static libraries, both PMD and ibverbs libraries must be linked as static libraries. And the dependencies of ibverbs (netlink) must still be linked as shared libraries. Unfortunately, meson forget about the static requirement for ibverbs when generating the .pc file. As a result, libibverbs, libmlx4, libmlx5 are listed in Requires.private section (allowing to be linked as shared libraries) and libnl is missing. A fix is in progress for meson, but anyway we will have to live without such a fix until a better version of meson is widely available: https://github.com/mesonbuild/meson/pull/6393 In order to avoid meson suggesting shared libraries in the section Requires.private of the .pc file, the dependency object is recreated with declare_dependency(): - cflags are extracted the libibverbs.pc - ldflags, from libibverbs.pc, are processed to force static flavor of ibverbs libraries, thanks to this syntax: -l:libfoo.a Fixes: 83fff714bd27 ("net/mlx: add static ibverbs linkage with meson") Signed-off-by: Thomas Monjalon Signed-off-by: Bruce Richardson --- buildtools/meson.build | 2 ++ drivers/common/mlx5/meson.build | 12 +++++++++++- drivers/net/mlx4/meson.build | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/buildtools/meson.build b/buildtools/meson.build index 0f563d89a3..4e3541b0d7 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -3,9 +3,11 @@ subdir('pmdinfogen') +pkgconf = find_program('pkg-config', 'pkgconf') pmdinfo = find_program('gen-pmdinfo-cfile.sh') list_dir_globs = find_program('list-dir-globs.py') check_experimental_syms = find_program('check-experimental-syms.sh') +ldflags_ibverbs_static = find_program('options-ibverbs-static.sh') # set up map-to-def script using python, either built-in or external python3 = import('python').find_installation(required: false) diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 47ae1b65c2..4e987ed277 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -29,16 +29,26 @@ foreach libname:libnames endif if lib.found() libs += lib + if not static_ibverbs + ext_deps += lib + endif else build = false reason = 'missing dependency, "' + libname + '"' subdir_done() endif endforeach +if static_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()) + # 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', diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index 7513516764..290bd1e268 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -29,16 +29,26 @@ foreach libname:libnames lib = cc.find_library(libname, required:false) endif if lib.found() - libs += [ lib ] + libs += lib + if not static_ibverbs + ext_deps += lib + endif else build = false reason = 'missing dependency, "' + libname + '"' subdir_done() endif endforeach +if static_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()) + # 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 -ext_deps += libs sources = files( 'mlx4.c', 'mlx4_ethdev.c', From patchwork Wed Feb 12 01:59:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65750 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 656D7A0530; Wed, 12 Feb 2020 03:00:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DEB831BE9E; Wed, 12 Feb 2020 03:00:06 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 22BB31BE94 for ; Wed, 12 Feb 2020 03:00:05 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B1F1821DAF; Tue, 11 Feb 2020 21:00:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 11 Feb 2020 21:00:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=Y5VzPty2G7 lt+wa/hiXr6gdXBDLMVGhSWHdjxjsbLrM=; b=jqus1TQ1jX4WLlrYtqSVRCp9vS N2HJ0NL8kK1MTR8a6ddXap794LFA0Fy/5kip2bO5499erxkzZaFx2mkYtKfQtVTL aB4bv8tkjewXPEcDZR/HzHx3ep5PJ1r5o1o6aleQhlL0zdfhjo05oZ8jaVCr+aLq i3TnE8omwqyh+Bd44= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Y5VzPty2G7lt+wa/hiXr6gdXBDLMVGhSWHdjxjsbLrM=; b=23cV4TAY yt0nZUjFaIgjyEFqLXpn1DJV8CztvQv5samWcAeLpAY9zue8BhNV/SsaGZtQcdmr XLUI2t7nqwfMay4Wb8cy/HURScN44xBAPzB+PVcD877Rc9hOPWKYYXwaJqjJUO4H esjbKhtxusWQny0v+BgO7aaKSHM26XO7tuC4Dgqnan40zYzxhJudGaCeJiKq7mjs 3PXeSk/RPjLnFCAqGuy4A3+KsbIoGVcxS6djQ/HMM1Wd9BoRpHK2lBO+i/2sgB5o 983wz6P6EO8m/GTe3012ftqz0+cBRNSrcdIkspQUSobMRrYwUiruZs8UJ/3iuVtr ZVskIOTUwqBn4g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepgeenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 85F113280065; Tue, 11 Feb 2020 21:00:03 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Wed, 12 Feb 2020 02:59:43 +0100 Message-Id: <20200212015944.3037000-6-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212015944.3037000-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212015944.3037000-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 5/6] net/mlx: rename meson variable for dlopen option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The name of the variable pmd_dlopen is confusing because it can be understood as true if the PMD is dlopen, whereas it means the ibverbs glue layer is a dlopen library. That's why it is renamed dlopen_ibverbs. Signed-off-by: Thomas Monjalon --- drivers/common/mlx5/meson.build | 8 ++++---- drivers/net/mlx4/meson.build | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 4e987ed277..0fe086136a 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -8,11 +8,11 @@ if not is_linux endif static_ibverbs = (get_option('ibverbs_link') == 'static') -pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') +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), @@ -54,7 +54,7 @@ sources = files( 'mlx5_common.c', 'mlx5_nl.c', ) -if not pmd_dlopen +if not dlopen_ibverbs sources += files('mlx5_glue.c') endif cflags_options = [ @@ -193,7 +193,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 = driver_name_fmt.format(dlopen_name) dlopen_so_version = LIB_GLUE_VERSION diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index 290bd1e268..f66e70f4d1 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -9,11 +9,11 @@ if not is_linux endif static_ibverbs = (get_option('ibverbs_link') == 'static') -pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') +dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so' LIB_GLUE_VERSION = '18.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 += [ '-DMLX4_GLUE="@0@"'.format(LIB_GLUE), @@ -61,7 +61,7 @@ sources = files( 'mlx4_txq.c', 'mlx4_utils.c', ) -if not pmd_dlopen +if not dlopen_ibverbs sources += files('mlx4_glue.c') endif cflags_options = [ @@ -113,7 +113,7 @@ endforeach configure_file(output : 'mlx4_autoconf.h', configuration : config) # Build Glue Library -if pmd_dlopen +if dlopen_ibverbs dlopen_name = 'mlx4_glue' dlopen_lib_name = driver_name_fmt.format(dlopen_name) dlopen_so_version = LIB_GLUE_VERSION From patchwork Wed Feb 12 01:59:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65751 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D146A0530; Wed, 12 Feb 2020 03:00:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 909B21BF81; Wed, 12 Feb 2020 03:00:08 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 49B101BE94; Wed, 12 Feb 2020 03:00:07 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D402721AF2; Tue, 11 Feb 2020 21:00:06 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 11 Feb 2020 21:00:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=Oqvfp4dU2+ 1Kj2rYONPQvR5aPvGDRT8q39h+cxSkE7A=; b=MHdrEgkLxMOmt8SF16dVv0c+3c AeByRJeThB/8Vx+uOpx4pV8UqvzlLtMnGJFhAMzNgPKpdlDGEby3AYNl+FdUKVHq 5slZ2f+Ups5GOU/dxulJoGZcNjrXrYvlmOB9ievUrBfkkEraJ7kXCZm+PeLzdiig AxgS4KfDv7qeYfoqU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Oqvfp4dU2+1Kj2rYONPQvR5aPvGDRT8q39h+cxSkE7A=; b=TSUheAm1 QERwlfxsnkkqe2Sh9pkjs2boR6Ul2aNXChSCPZBA+x2eLC7ATRDGbVJPyyJDgg05 vuc0aDQ9AIbSIqhMmHorsUMs92ArroxPmOEh0s//gA7IfcqncWDCoPpLepOlqDTj DLS32L/ojO1imJKA/IlMyiQNJmhNOLxery7ZtkdmCgQqDQyZbknuIzuXvS/oAuw6 1YuQdkC1Z8MHSTDU3EZ+UDS7LWX1WpiBF64auToXrllQy1jhYr8UpOP5LIxnO4rv rAuYTMBe2D8yBd16Dtu9J1fjlZE++0Hiq5q/zYH5Lq3x50Zoi7N71co3y8H6nh5J 8QaEEhrXMfsVjQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepheenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B5777328005E; Tue, 11 Feb 2020 21:00:05 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, stable@dpdk.org, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , =?utf-8?q?N=C3=A9lio_Laran?= =?utf-8?q?jeiro?= Date: Wed, 12 Feb 2020 02:59:44 +0100 Message-Id: <20200212015944.3037000-7-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212015944.3037000-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212015944.3037000-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 6/6] net/mlx: fix overlinking with meson and glue dlopen X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If ibverbs_link is dlopen, the PMD and application should not be linked with ibverbs, but the glue library is. Unfortunately the ibverbs dependency was exported in the variable ext_deps, so there were overlinking. It is fixed by not exporting the dependency in ext_deps, and recreating a limited dependency object for cflags only. Fixes: 1dd7c7e38c19 ("net/mlx4: support meson build") Fixes: 96d7c62a70c7 ("net/mlx5: support meson build") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- drivers/common/mlx5/meson.build | 6 ++++-- drivers/net/mlx4/meson.build | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 0fe086136a..cfc178257d 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -29,7 +29,7 @@ foreach libname:libnames endif if lib.found() libs += lib - if not static_ibverbs + if not static_ibverbs and not dlopen_ibverbs ext_deps += lib endif else @@ -38,10 +38,12 @@ foreach libname:libnames subdir_done() endif endforeach -if static_ibverbs +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()) diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index f66e70f4d1..c598745730 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -30,7 +30,7 @@ foreach libname:libnames endif if lib.found() libs += lib - if not static_ibverbs + if not static_ibverbs and not dlopen_ibverbs ext_deps += lib endif else @@ -39,10 +39,12 @@ foreach libname:libnames subdir_done() endif endforeach -if static_ibverbs +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())