DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zoltan Kiss <zoltan.kiss@linaro.org>
To: "Polevoy, Igor" <Igor_Polevoy@McAfee.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] driver initialization in DPDK 2.0 built into a shared library.
Date: Thu, 16 Jul 2015 14:00:49 +0100	[thread overview]
Message-ID: <55A7AB01.1030208@linaro.org> (raw)
In-Reply-To: <ff299d95c31a497a94efb4f9ef04b8e2@MIVEXUSR1N03.corpzone.internalzone.com>



On 14/07/15 19:21, Polevoy, Igor wrote:
> Hi,
> We are developing an application that uses DPDK PMD functionality .
> We are using a linux shared library which contains the network packets processing code and it is statically linked with all the necessary DPDK libs.
> The .so is loaded by the main program.
> For the DPDK compilation we have added the -fPIC to the GCC options.
>
> While it all worked fine with DPDK 1.6 where we had the rte_pmd_init_all method, in the 2.0 version the
> drivers registration methods (PMD_REGISTER_DRIVER) are not called when the shared library is loaded.
>
> Although, I can go along the lines of the rte_pmd_init all and manually call the driver registration, I'm concerned
> that DPDK has other drivers initialization calls, and I don't actually know which are needed or could be needed and when.
>
> Do you have any advice on that? What is the best way to resolve this issue?
>
> Thank you
> Igor.
>

I've seen a similar problem, but in a different setup. My app (OVS) 
links to ODP-DPDK statically, which then links to DPDK code statically. 
I found that the devinitfn_* functions are not called because OVS 
doesn't call directly into the DPDK library, only into ODP-DPDK. The 
workaround for me was to refer to those functions in the ODP-DPDK code:

#define PMD_EXT(drv)  extern void devinitfn_##drv(void);
PMD_EXT(bond_drv)
PMD_EXT(em_pmd_drv)
...

But there might be better solutions than that. This one is fragile, if 
you update DPDK you have to remember adding these references for new PMDs.

Zoli

      parent reply	other threads:[~2015-07-16 13:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 18:21 Polevoy, Igor
2015-07-14 18:41 ` Keunhong Lee
2015-07-20 23:57   ` Polevoy, Igor
2015-07-15  9:14 ` Bruce Richardson
2015-07-16 13:00 ` Zoltan Kiss [this message]

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=55A7AB01.1030208@linaro.org \
    --to=zoltan.kiss@linaro.org \
    --cc=Igor_Polevoy@McAfee.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).