DPDK patches and discussions
 help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: apanda@cs.berkeley.edu, Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-users] DPDK 16.04 link changes cause PMD drivers to not be loaded
Date: Fri, 22 Apr 2016 13:08:18 +0300	[thread overview]
Message-ID: <5719F812.2060903@redhat.com> (raw)
In-Reply-To: <5718F0A7.7080002@cs.berkeley.edu>

On 04/21/2016 06:24 PM, Aurojit Panda wrote:
>
>
> Thomas Monjalon wrote:
>> 2016-04-21 08:01, Aurojit Panda:
>>> Panu Matilainen wrote:
>> [...]
>>>> Again, PMDs are *plugins* that are *meant* to be loaded at runtime.
>>>> That allows for all sorts of flexibility especially
>>>> for packaging and shipping, at some extra cost in setup complexity.
>>> I am all for a plugin architecture, I was merely suggesting that you
>>> embed some path infromation at the beginning. Also please note:
>>> (a) This behavior changed recently.
>>
>> What changed recently?
>>
> Change 948fd64befc3726 moved DPDK from building a shared library to
> using LD linker scripts.
>
>>> (b) This change is entirely undocumented, which is why I was reporting
>>> it in the first place.
>>> (c) It is actually quite unintutive, because previously ensuring
>>> LD_LIBRARY_PATH was correct was all that was required
>>> to get any DPDK application to interact with ports.
>>
>> ?
>> Are you talking about combined library?
> Yes, if you build a shared combined library, PMD drivers are not
> automatically loaded anymore. This implies that programs do not
> enumerate the set of ports on the machine. (Unless CONFIG_EAL_PMD_PATH
> is correctly set to the absolute directory where the built DPDK will live).
>>
>>>> For your own purposes, you can of course tweak the linking settings
>>>> as much as you like. Look for "plugins" in mk/rte.app.mk and change
>>>> the shared lib condition on the line above to "y" and there you have
>>>> it.
>>>> But that's not the way plugins are meant to be used.
>>> That is not a reasonable solution given that it makes it very hard to
>>> track future changes to DPDK without merges.
>>> My alternatives neither break people's abilities to use plugins,
>>> nor do they impact behavior.
>>
>> Please do not hesitate to send some patch to show your solution.
>
> My initial e-mail was sent because I don't entirely understand LD linker
> scripts (the PMD libraries are listed within the built libdpdk.so file),
> so the only patch I can suggest is undoing 948fd64befc3726 in which case
> the behavior as I describe.

Reverting would be counter-productive, the change was introduced for a 
reason. Many of them in fact.

Any application wanting to force linkage to plugins always needed to 
link them inside --whole-archive section with static or individual 
shared libraries, now that is true for the combined shared library as well.

Within DPDK itself it would be easy enough to add an option to force 
link-in of the plugins (see the comment about mk/rte.app.mk change), but 
not sure we want to have yet another build option. And anything else 
still would need to use --whole-archive if they want that behavior.

So yes it's a behavior change for that particular corner which nobody 
thought of or brought up during review, and so ended up being 
undocumented too.

Like said there are always ways to improve things, once the use-case is 
understood, actual examples of how you are deploying DPDK would perhaps 
help. One possibility could be attempting to load known plugins from 
LD_LIBRARY_PATH, but that requires inserting that information somewhere 
in the binaries where it currently is not needed.

	- Panu -

  reply	other threads:[~2016-04-22 10:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <57158D01.5020407@cs.berkeley.edu>
     [not found] ` <57173EA4.9000208@redhat.com>
     [not found]   ` <5717917D.9030504@cs.berkeley.edu>
     [not found]     ` <571895D9.3090700@redhat.com>
2016-04-21 15:01       ` Aurojit Panda
2016-04-21 15:18         ` Thomas Monjalon
2016-04-21 15:24           ` Aurojit Panda
2016-04-22 10:08             ` Panu Matilainen [this message]
2016-04-21 15:29           ` Aurojit Panda

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=5719F812.2060903@redhat.com \
    --to=pmatilai@redhat.com \
    --cc=apanda@cs.berkeley.edu \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /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).