From patchwork Wed Feb 12 22:07:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65768 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 A84A5A0534; Wed, 12 Feb 2020 23:07:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C8B1C1BF99; Wed, 12 Feb 2020 23:07:17 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id BD90BA3 for ; Wed, 12 Feb 2020 23:07:14 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 63A9121B4C; Wed, 12 Feb 2020 17:07:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 12 Feb 2020 17:07:14 -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=qgO8FAJ7dtH9k0836Gx4DLOCTV eK9wH9iNru4N8m6GvwlC8hN0czLhHmAfUMAGhyUMok/Dr37GHYu3ulDtJ9vZSxf3 M71QhVBsgEuxkkUe5v1cFC8ndNUxF2RFUD/OX1/9k2NVwkruf/U76md0MjhKyt2K SRTauZ1maInNQPcBY= 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=pfcDPfCb Lj88HmUu9K9/ONUsvFrU2VKk7z4UuZhEJ1e1B2XVr/nhSMjqrPztpCGXmtpkfLdb LPSxlzqBrRCzRvqVqs/L6VhknMrio5ddy2De99oJBksIrmVnihkHVqYnBKZTsIR3 ILhwjQh6G0lrZu6xq/LxvlCzZ9KVUd+87saO+73hb5MEhivUIq99HNor8keXv0vg yIN7DwsLJdCdAvBcVMqZKCRearPHjmzcnqRk/COARzLpOgAV1uC062p4iJ71cRH0 v0ue6sp9jTngE6mv3pOaJsKxtRoYFeb5lC1kCesLbHnjPAf9DoZwWcfWzDreLc4f jMIsOZM5oIYgCQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeigddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepudenucfrrghr 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 314453060986; Wed, 12 Feb 2020 17:07:13 -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 23:07:03 +0100 Message-Id: <20200212220708.492297-2-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212220708.492297-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212220708.492297-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Rosen Xu --- 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 22:07:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65769 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 B6A5FA0534; Wed, 12 Feb 2020 23:07:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 74B3B1BF9E; Wed, 12 Feb 2020 23:07:19 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 4B36C1BF7B for ; Wed, 12 Feb 2020 23:07:16 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CFDBD2201F; Wed, 12 Feb 2020 17:07:15 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 12 Feb 2020 17:07:15 -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=bXt+N8Rymh j+e/dhGfGgGGxQuj6XQm7RIzyZj3ZL4yk=; b=DJCxChnTbYvAvboz3tqPQdw7d+ s7k70RZxmOxZItZeCWrL1rgr0X8Q8uSU1VMAO6hagUUFrei7R7quLCRBM23QdQDM cCHRpZfFWmqNHFH3xUI/9cHaAcTrQmohbi9rI5mt91rAESOkOBronhiThJxzwquE PZy2INjJ7THnY8/3o= 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=bXt+N8Rymhj+e/dhGfGgGGxQuj6XQm7RIzyZj3ZL4yk=; b=EIkoUMuP hCu2d0TEjUZ2SjDIuGYeHtNjrA7FYoZieQya0izbnhOgnM7w5FURGy5ygloEnRG4 rbSv2AQ9J9ctYMGUgf60DFkLJSHoddADIv7J3hayqg4ON5bGc8amTgbWy7Sn1WN2 8xoUX2dYDG+O9Is1xDk2XPqUHWRapJBtGtpxCRHWqxdt3pVz9t1PqQJuFq/mYusx k5MBotmzK39/325j3LVRuu2YjwczsfnF6qg/SAvNLriQHUw6i0jatFMJureAI1mm YunXU3h2/KvSrckfgAcx9b0fYm0gHZiOl2GcaTq4lFZleqrvpvVkDq8HK+Vw9mza cQMTPqeHw9+Urg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeigddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepudenucfrrghr 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 D7FEA30600DC; Wed, 12 Feb 2020 17:07:14 -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 23:07:04 +0100 Message-Id: <20200212220708.492297-3-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212220708.492297-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212220708.492297-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Bruce Richardson --- 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 22:07:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65770 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 1EA41A0534; Wed, 12 Feb 2020 23:07:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 47A5A1BFAC; Wed, 12 Feb 2020 23:07:21 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 7BA021BF8E for ; Wed, 12 Feb 2020 23:07:17 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2CEC82148D; Wed, 12 Feb 2020 17:07:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 12 Feb 2020 17:07:17 -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=fVsJDdAd1O UppwIEwqevsJuTSygOWaQhNhb6AqR2yJM=; b=HixskDpLQV7X5zW1+XZIlqbK/c lCgynC1QfMmfvo6m5wGKDrETbmY1D4SgRzs+1X0ilC4u31U8Kb412DUQEFhG4y7p sfmTFKaWRz4c7o7lq0uBSiJHvT/RPPrvbdNtjZFDUFnMawJxJe0+xKVH25oyRX7H I3yuYvir0UFoJiIhM= 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=fVsJDdAd1OUppwIEwqevsJuTSygOWaQhNhb6AqR2yJM=; b=qw30ha6y 5rC5V8J3fz36rZiUAGBBvlBYJNQ8o2VLGpwYPYZUZb1D8cjiSo07HfkTPVqQYHsq 5uxMF2wmeWKIi8+GL5O58PXiiE3cc2zFnjDGYKRY0iCBOqdGsYL7UsqAyfSgoF6f exXbQhPm7BS8y7nb6AwRl1SpuZ9/zJfsn2YizGSncVdWlD2qsMLj48GMSYVF4PaQ NbhBI3QuSHQJupJ1cuBKaQEwfra4cXDFrycTPD1j4tO+fbOzGnKQGLOg7yxeuwuI JXeHGtO1eB5g1BzmVRkcDoXp3p6WdzgzHOSUU6lDwsg2PQhG8P8rT0z9aDPQi/p2 YmEMWaK/slQ4XA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeigddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepudenucfrrghr 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 7127230600DC; Wed, 12 Feb 2020 17:07:16 -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 23:07:05 +0100 Message-Id: <20200212220708.492297-4-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212220708.492297-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212220708.492297-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Bruce Richardson --- 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 22:07:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65771 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 D075DA0534; Wed, 12 Feb 2020 23:07:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B85661BFBE; Wed, 12 Feb 2020 23:07:22 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id EE32F1BF7C for ; Wed, 12 Feb 2020 23:07:18 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 91F1F21443; Wed, 12 Feb 2020 17:07:18 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 12 Feb 2020 17:07:18 -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=k0OvKrzm0n md8OMi52dW8IYWS4xKath9B3M/MyofQME=; b=LF8nVjUNRTLoTGEevTOZk90H/g aBBEI86eI1J1GnnYoPeub78aQMj8ezcB6bbzpaOCN0IrXkytrahqOsYbzGrrNm0A VJtDeowmJnZxUPV0QhMjR/Br/fSkAhbFr/ChfJabo4G/7MuMe37TmqEFUujZqJ6w ePxhaO2glHeETTHrY= 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=k0OvKrzm0nmd8OMi52dW8IYWS4xKath9B3M/MyofQME=; b=buBsa1uM 8+T3FMg2ytuFz4lCMD3WI5S6Kj92I804b3rgG15U/637Y5S/Jk8sjCULnONaPImp rTntHDEX7Snj2a5tlylgTWABb8JRx+NA/gzFqbsA4w0WIjmzIKf/oRkaiq04b0ze sdc3VHY7rke7SdIZRWp35iGiezpe3h11VGIluzkaHs2RKBVARBRLVAk8JAyLc7pt VgcmIc4VJ1g+sC7HhVlepMqSnM+0hfgg8NBr/lFB6bw2447EZP+9AYWQKSvzlYLI Px52cY72m65/S0NM7yqC5PWvHgWt9EYCg34L3DW9wn0B0l2V8rkc5DtuXaQD1EG1 qNotYBHxkBo39Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeigddvvdcutefuodetggdotefrodftvf 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 C365630600DC; Wed, 12 Feb 2020 17:07:17 -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 23:07:06 +0100 Message-Id: <20200212220708.492297-5-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212220708.492297-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212220708.492297-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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..9812917e50 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -3,9 +3,11 @@ subdir('pmdinfogen') +pkgconf = find_program('pkg-config', 'pkgconf', required: false) 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 22:07:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65772 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 4E6F5A0534; Wed, 12 Feb 2020 23:08:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35FD31BFC8; Wed, 12 Feb 2020 23:07:24 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 505E11BFA4 for ; Wed, 12 Feb 2020 23:07:20 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F2E9B22056; Wed, 12 Feb 2020 17:07:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 12 Feb 2020 17:07:19 -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=kzWGDJIUeu hnqZpQLEy1ybOZvp26ycWbUpsCicLig/w=; b=Tvqf87DlEMLV25Ps44fJ3XYpTz akmOqz3tU55qn164qmr5UY0vAfhGvm/qK+YbmR0eZjp6ZIuKxFEo6mSHG/cKbAUm pq58Uk+9NSJVOKGAs+Dj65lfCCoS9iPBExPvgiHiCH4AwSvZrn6RAxe8hM5FiOGm YCGCu6n2CfGWtF0jM= 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=kzWGDJIUeuhnqZpQLEy1ybOZvp26ycWbUpsCicLig/w=; b=dlRRbPXq rvu26I525Hyh2oz0b7aLSqNaW4jxZ+I+9jdjtlFOaWEV5uHCfqQ67Vs3lUURD3NU 2e1zNpD4+epDryEw9VmgZJssIwY4gOyqTG8+BpPc/iZao2O9D4ApmvejIN714BfL MESiOw2Hp2k2KF3MsXbQ1xo6IjtWyiaWDsjL3D1BTwGYVW+GZClhloacv6psXkAA RBPRBYAzCWo+skrywlpJtyXBVBDvGiFOC0ckEZoq72uPKkGW27tD20TsUV+cHnDQ cRcE8dM0u+JXAyN+I3G0hVjDKUyxYifOgEnb74NL/VZW9I/vi3iQFHZNB+O9q5g/ 2WU9S4J3iu3S+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeigddvvdcutefuodetggdotefrodftvf 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 431A030600DC; Wed, 12 Feb 2020 17:07:19 -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 23:07:07 +0100 Message-Id: <20200212220708.492297-6-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212220708.492297-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212220708.492297-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Bruce Richardson --- 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 22:07:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 65773 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 A3F0EA0534; Wed, 12 Feb 2020 23:08:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9BB921BFD2; Wed, 12 Feb 2020 23:07:25 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 15C8B1BFB5; Wed, 12 Feb 2020 23:07:22 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BAB6921C1C; Wed, 12 Feb 2020 17:07:21 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 12 Feb 2020 17:07:21 -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=x9xh9hvSpD 0FZwKPrp57LzjuWGYalzdqq7h5zlI+W8U=; b=q1HAinSpLgf3oWPZ/SFSbmv1pT mZCIC0Gndmhuf4iCwIBKDA/EpYGXShMpqQIL6sh0gWX8FZyaaqNdhxwIv6QSEAfI mYV0ns5G8n7RyD1IcK9/aCi2ly07b8KLcbmIh6VJJ8ox+4KYUZfn8mH6HBvrh4LA CA/GgaOc4AxAS4Uh0= 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=x9xh9hvSpD0FZwKPrp57LzjuWGYalzdqq7h5zlI+W8U=; b=y0U1Y6ph QiKm5luNfEqSDDqE6mDu4c+ivKt6PdH1VW1C5q91+SS4he74c2OfCglMcMBw2aGS umSPD9PECUMrc5X3jY0eTK1xw5Sc96XnEmTe4pvgEb8PkIa9bC/5RoK8QmocGih6 hAl7VK35gu9mIcwmpZH1qnVD/DDwVaur6o6uT1fInR4az5YlwG2gLCw8DhI/i6e1 kiSWT72oVeQ4WJvzdCm0byeenH3pVZMQ9D5adXW9xIHxAy3M9pbSYCGygz0UDkSW 6Sff6LCnol9cF8x2eJVsSW72GdRtOIPa0CqyjkMRd74WJ+MNtlyOLWSpygm7RiqE SQ+VKDke5Ce2OQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieeigddvvdcutefuodetggdotefrodftvf 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 AC69C3060717; Wed, 12 Feb 2020 17:07:20 -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 23:07:08 +0100 Message-Id: <20200212220708.492297-7-thomas@monjalon.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200212220708.492297-1-thomas@monjalon.net> References: <20200116071656.1663967-1-thomas@monjalon.net> <20200212220708.492297-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Bruce Richardson --- 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())