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 E3E82A04B5; Thu, 24 Sep 2020 16:43:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9BA8A1DEB4; Thu, 24 Sep 2020 16:43:48 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C4EC21DEAF for ; Thu, 24 Sep 2020 16:43:47 +0200 (CEST) IronPort-SDR: 2FKmMMH/FHIrC1CJVe89su6ykAc5X+udqs3aImUOwdYdbDvWqgniGIKr1F3upabPSnhqBcWdIe 1yIbCf+yfU5A== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="161279901" X-IronPort-AV: E=Sophos;i="5.77,298,1596524400"; d="scan'208";a="161279901" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2020 07:43:46 -0700 IronPort-SDR: oqhFNPwt9ybm2D3drufaIhUlP/i99m6RmILarJ8jN3jKOST12L/pyGcRCizTril29On0dWsbkq fmPVQavDq/FQ== X-IronPort-AV: E=Sophos;i="5.77,298,1596524400"; d="scan'208";a="455366018" 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 07:43:45 -0700 Date: Thu, 24 Sep 2020 15:43:41 +0100 From: Bruce Richardson To: "Harris, James R" Cc: "dev@dpdk.org" Message-ID: <20200924144341.GE382@bricha3-MOBL.ger.corp.intel.com> References: <2420F93D-75BC-4983-9529-1A3F1DE08955@intel.com> <20200924092650.GB382@bricha3-MOBL.ger.corp.intel.com> <48212710-3621-4F92-8426-C23BCF2EF3FE@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <48212710-3621-4F92-8426-C23BCF2EF3FE@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 Thu, Sep 24, 2020 at 03:34:12PM +0100, Harris, James R wrote: > > > On 9/24/20, 2:27 AM, "Bruce Richardson" wrote: > > On Wed, Sep 23, 2020 at 07:21:16PM +0100, Harris, James R wrote: > > Hi, > > > > > > SPDK would like to use DPDK’s pkg-config files rather than rolling our > > own linker arguments. I’m running into a couple of issues – one looks > > like a bug, the other is not as clear. > > > > > > 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 – meaning the > > constructor function doesn’t get called and we cannot create any > > 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’s the only one I’ve checked. > > > > > > 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? > > > > > > Any help would be appreciated. > > > > > > Thanks, > > > > > > -Jim > > > 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 > > > > Yes, the output from pkg-config works fine for the static library use case. I also see librte_bus_pci.a get emitted when specifying --static. > > I chatted with Bruce offline about this, and we (mostly Bruce) root caused the issue with the shared library use case. SPDK is using a non-standard DESTDIR and then not specifying the PMD directory via the -d command line argument. So this needs to be fixed on the SPDK side. > > Thanks, > > Jim As general follow-up information, if you are planning to install DPDK to a non-system location on "ninja install" and run things from that location, it's probably better to set the DPDK "prefix" option to the location rather than using DESTDIR. Setting the prefix using "meson -Dprefix=" e.g. "meson -Dprefix=$HOME/.local" will make the final path visible to the build so should allow DPDK's default driver load path to be set correctly. On the other hand, with DESTDIR, the value is only used at install time and does not affect the build, meaning that EAL has no way of knowing the final installation path. [AFAIK: DESTDIR is designed for tasks like packaging where you want to define a separate root folder for your temporary installation] Regards, /Bruce