DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Harris, James R" <james.r.harris@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Questions on DPDK pkg-config
Date: Thu, 24 Sep 2020 14:34:12 +0000	[thread overview]
Message-ID: <48212710-3621-4F92-8426-C23BCF2EF3FE@intel.com> (raw)
In-Reply-To: <20200924092650.GB382@bricha3-MOBL.ger.corp.intel.com>



On 9/24/20, 2:27 AM, "Bruce Richardson" <bruce.richardson@intel.com> 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

<snip>

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







  reply	other threads:[~2020-09-24 14:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 18:21 Harris, James R
2020-09-24  9:26 ` Bruce Richardson
2020-09-24 14:34   ` Harris, James R [this message]
2020-09-24 14:43     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48212710-3621-4F92-8426-C23BCF2EF3FE@intel.com \
    --to=james.r.harris@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).