From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8C504A04B1; Thu, 24 Sep 2020 11:26:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFDC51C43A; Thu, 24 Sep 2020 11:26:57 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id C33341C439 for ; Thu, 24 Sep 2020 11:26:55 +0200 (CEST) IronPort-SDR: i9oD95ysCBrNUk+iGZv/3MW+jbcfQGV/RKXSzCddu0qph2i9oDNO89xTi2E43tAPIE5MYBNql/ IuJMp5Vw3Dtg== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="148904205" X-IronPort-AV: E=Sophos;i="5.77,297,1596524400"; d="scan'208";a="148904205" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2020 02:26:54 -0700 IronPort-SDR: +P5NrlaVc/untl637q3ITlWtCWwg2ogSHAohS03xyeWa8WDpQqLvuckOl5tz81CTINsvEFSzC1 OXAxrR3R/9AA== X-IronPort-AV: E=Sophos;i="5.77,297,1596524400"; d="scan'208";a="455273658" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.45.144]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Sep 2020 02:26:53 -0700 Date: Thu, 24 Sep 2020 10:26:50 +0100 From: Bruce Richardson To: "Harris, James R" Cc: "dev@dpdk.org" Message-ID: <20200924092650.GB382@bricha3-MOBL.ger.corp.intel.com> References: <2420F93D-75BC-4983-9529-1A3F1DE08955@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <2420F93D-75BC-4983-9529-1A3F1DE08955@intel.com> Subject: Re: [dpdk-dev] Questions on DPDK pkg-config 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" On Wed, Sep 23, 2020 at 07:21:16PM +0100, Harris, James R wrote: > Hi, >=20 >=20 > SPDK would like to use DPDK=E2=80=99s pkg-config files rather than rol= ling our > own linker arguments. I=E2=80=99m running into a couple of issues =E2= =80=93 one looks > like a bug, the other is not as clear. >=20 >=20 > First is the use of --as-needed > ([1]https://github.com/DPDK/dpdk/commit/b98447077b0609750c10b84b7b2e7be > 0c8504fad). We have run into problems with this in the past, > specifically related to the rte_mempool_ring MEMPOOL_REGISTER_OPS > constructor functions. --as-needed results in similar behavior to > omitting --whole-archive when using static libraries =E2=80=93 meaning= the > constructor function doesn=E2=80=99t get called and we cannot create a= ny > mempools since there are no registered mempool_ops. I think this would > also affect other uses of constructor functions within DPDK when using > pkg-config, but this rte_mempool_ring one is the only that would impact > SPDK so it=E2=80=99s the only one I=E2=80=99ve checked. >=20 >=20 > Second is that rte_bus_pci is not included in the pkg-config output. > SPDK relies on rte_bus_pci since we have our own DPDK drivers for > things like nvme, virtio-blk and virtio-scsi and need access to > rte_pci_read_config, rte_pci_write_config and rte_pci_register. > Perhaps we could add bus_pci to the dpdk_libraries in lib/meson.build? >=20 >=20 > Any help would be appreciated. >=20 >=20 > Thanks, >=20 >=20 > -Jim >=20 Hi Jim, what command are you using to get the libs etc. from pkg-config? For static linking you need to pass the --static flag which will include all the libs and drivers, including the pci bus driver. [See output below from my system= after running "ninja install"]. The --as-needed is required to prevent the shared libs also being linked into a static build in this case. /Bruce $ PKG_CONFIG_PATH=3D/usr/local/lib/x86_64-linux-gnu/pkgconfig/ pkg-config -= -libs --static libdpdk -L/usr/local/lib/x86_64-linux-gnu -Wl,--whole-archive -l:librte_common_cpt.= a -l:librte_common_dpaax.a -l:librte_common_iavf.a -l:librte_common_octeont= x.a -l:librte_common_octeontx2.a -l:librte_bus_dpaa.a -l:librte_bus_fslmc.a= -l:librte_bus_ifpga.a -l:librte_bus_pci.a -l:librte_bus_vdev.a -l:librte_b= us_vmbus.a -l:librte_mempool_bucket.a -l:librte_mempool_dpaa.a -l:librte_me= mpool_dpaa2.a -l:librte_mempool_octeontx.a -l:librte_mempool_octeontx2.a -l= :librte_mempool_ring.a -l:librte_mempool_stack.a -l:librte_pmd_e1000.a -l:l= ibrte_pmd_ena.a -l:librte_pmd_enetc.a -l:librte_pmd_enic.a -l:librte_node.a= -l:librte_graph.a -l:librte_bpf.a -l:librte_flow_classify.a -l:librte_pipe= line.a -l:librte_table.a -l:librte_port.a -l:librte_fib.a -l:librte_ipsec.a= -l:librte_vhost.a -l:librte_stack.a -l:librte_security.a -l:librte_sched.a= -l:librte_reorder.a -l:librte_rib.a -l:librte_regexdev.a -l:librte_rawdev.= a -l:librte_pdump.a -l:librte_power.a -l:librte_member.a -l:librte_lpm.a -l= :librte_latencystats.a -l:librte_kni.a -l:librte_jobstats.a -l:librte_ip_fr= ag.a -l:librte_gso.a -l:librte_gro.a -l:librte_eventdev.a -l:librte_efd.a -= l:librte_distributor.a -l:librte_cryptodev.a -l:librte_compressdev.a -l:lib= rte_cfgfile.a -l:librte_bitratestats.a -l:librte_bbdev.a -l:librte_acl.a -l= :librte_timer.a -l:librte_hash.a -l:librte_metrics.a -l:librte_cmdline.a -l= :librte_pci.a -l:librte_ethdev.a -l:librte_meter.a -l:librte_net.a -l:librt= e_mbuf.a -l:librte_mempool.a -l:librte_rcu.a -l:librte_ring.a -l:librte_eal= =2Ea -l:librte_telemetry.a -l:librte_kvargs.a -Wl,--no-whole-archive -lpcap= -ljansson -Wl,--as-needed -lrte_node -lrte_graph -lrte_bpf -lrte_flow_clas= sify -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhos= t -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_rege= xdev -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm -lrte_late= ncystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_e= ventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte= _cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -l= rte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrt= e_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_k= vargs -pthread -lm -ldl -lfdt -lpcap