DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] using dpdk as a shared library
@ 2020-12-18 22:38 Justin Tallon
  2020-12-19 19:27 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Tallon @ 2020-12-18 22:38 UTC (permalink / raw)
  To: users

Hey guys,

We are trying to use dpdk (dpdk-stable-18.08.1) as a shared library.

We have recompiled as a shared library by setting
*CONFIG_RTE_BUILD_SHARED_LIB=y*

My program compiles file and I can see the relevant libraries when I use
ldd on the binary.

I direct my binary look in the correct place by using export
LD_LIBRARY_PATH and the binary appears to find the libraries.
However, when the function rte_eth_dev_count_avail returns it returns a 0
and exits, when I run the same program with static libraries, it works
correctly.

Any help on this would be great!

Regards,
Justin


____
Justin Tallon Ph.D.

Software Radio Systems (SRS)
http://www.softwareradiosystems.com

+353-86-067-0753 | justin.tallon@softwareradiosystems.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] using dpdk as a shared library
  2020-12-18 22:38 [dpdk-users] using dpdk as a shared library Justin Tallon
@ 2020-12-19 19:27 ` Stephen Hemminger
  2020-12-21 23:20   ` Justin Tallon
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2020-12-19 19:27 UTC (permalink / raw)
  To: Justin Tallon; +Cc: users

On Fri, 18 Dec 2020 23:38:28 +0100
Justin Tallon <justin.tallon@softwareradiosystems.com> wrote:

> Hey guys,
> 
> We are trying to use dpdk (dpdk-stable-18.08.1) as a shared library.
> 
> We have recompiled as a shared library by setting
> *CONFIG_RTE_BUILD_SHARED_LIB=y*
> 
> My program compiles file and I can see the relevant libraries when I use
> ldd on the binary.
> 
> I direct my binary look in the correct place by using export
> LD_LIBRARY_PATH and the binary appears to find the libraries.
> However, when the function rte_eth_dev_count_avail returns it returns a 0
> and exits, when I run the same program with static libraries, it works
> correctly.
> 
> Any help on this would be great!
> 
> Regards,
> Justin
> 
> 
> ____
> Justin Tallon Ph.D.
> 
> Software Radio Systems (SRS)
> http://www.softwareradiosystems.com
> 
> +353-86-067-0753 | justin.tallon@softwareradiosystems.com

When used as a shared library DPDK does not automatically load any required poll
mode driver libraries. You have to pass -d flag to make it load what you want.

I consider this a bug (others do not), and think the DPDK should have a table
mapping PCI device id to the PMD shared library and automatically load the PMD
shared library (like the Linux kernel module autoloading works).


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] using dpdk as a shared library
  2020-12-19 19:27 ` Stephen Hemminger
@ 2020-12-21 23:20   ` Justin Tallon
  2020-12-21 23:32     ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Tallon @ 2020-12-21 23:20 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

Hey Stephen,

Thanks for the response, I have passed the directory of the dpdk library as
you said with the -d flag.

However, when I did this, I get the following error.

libdpdk.so: invalid ELF header

any help with this would be appreciated.

Regards,
Justin

____
Justin Tallon Ph.D.

Software Radio Systems (SRS)
http://www.softwareradiosystems.com

+353-86-067-0753 | justin.tallon@softwareradiosystems.com


On Sat, Dec 19, 2020 at 8:27 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Fri, 18 Dec 2020 23:38:28 +0100
> Justin Tallon <justin.tallon@softwareradiosystems.com> wrote:
>
> > Hey guys,
> >
> > We are trying to use dpdk (dpdk-stable-18.08.1) as a shared library.
> >
> > We have recompiled as a shared library by setting
> > *CONFIG_RTE_BUILD_SHARED_LIB=y*
> >
> > My program compiles file and I can see the relevant libraries when I use
> > ldd on the binary.
> >
> > I direct my binary look in the correct place by using export
> > LD_LIBRARY_PATH and the binary appears to find the libraries.
> > However, when the function rte_eth_dev_count_avail returns it returns a 0
> > and exits, when I run the same program with static libraries, it works
> > correctly.
> >
> > Any help on this would be great!
> >
> > Regards,
> > Justin
> >
> >
> > ____
> > Justin Tallon Ph.D.
> >
> > Software Radio Systems (SRS)
> > http://www.softwareradiosystems.com
> >
> > +353-86-067-0753 | justin.tallon@softwareradiosystems.com
>
> When used as a shared library DPDK does not automatically load any
> required poll
> mode driver libraries. You have to pass -d flag to make it load what you
> want.
>
> I consider this a bug (others do not), and think the DPDK should have a
> table
> mapping PCI device id to the PMD shared library and automatically load the
> PMD
> shared library (like the Linux kernel module autoloading works).
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] using dpdk as a shared library
  2020-12-21 23:20   ` Justin Tallon
@ 2020-12-21 23:32     ` Stephen Hemminger
  2021-03-22 21:18       ` Justin Tallon
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2020-12-21 23:32 UTC (permalink / raw)
  To: Justin Tallon; +Cc: users

On Tue, 22 Dec 2020 00:20:51 +0100
Justin Tallon <justin.tallon@softwareradiosystems.com> wrote:

> Hey Stephen,
> 
> Thanks for the response, I have passed the directory of the dpdk library as
> you said with the -d flag.
> 
> However, when I did this, I get the following error.
> 
> libdpdk.so: invalid ELF header
> 
> any help with this would be appreciated.
> 
> Regards,
> Justin
> 

You need to pass the individual pmd library name.
libdpdk.so is a linker script, not a real shared library.
It disappeared in later versions.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] using dpdk as a shared library
  2020-12-21 23:32     ` Stephen Hemminger
@ 2021-03-22 21:18       ` Justin Tallon
  0 siblings, 0 replies; 5+ messages in thread
From: Justin Tallon @ 2021-03-22 21:18 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

Hey Stephen,

Thanks for your help previously, I am again having issues with passing
shared libraries of dpdk.

I am getting the following error

EAL: RTE_LPM tailq is already registered
PANIC in tailqinitfn_rte_lpm_tailq():
Cannot initialize tailq: RTE_LPM

Only when using dpdk as a shared library, I have tried many things but
there is very little online about this, any suggestions would
be appreciated!


Thanks,
Justin


____
Justin Tallon Ph.D.

Software Radio Systems (SRS)
http://www.softwareradiosystems.com

+353-86-067-0753 | justin.tallon@softwareradiosystems.com


On Tue, Dec 22, 2020 at 12:33 AM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Tue, 22 Dec 2020 00:20:51 +0100
> Justin Tallon <justin.tallon@softwareradiosystems.com> wrote:
>
> > Hey Stephen,
> >
> > Thanks for the response, I have passed the directory of the dpdk library
> as
> > you said with the -d flag.
> >
> > However, when I did this, I get the following error.
> >
> > libdpdk.so: invalid ELF header
> >
> > any help with this would be appreciated.
> >
> > Regards,
> > Justin
> >
>
> You need to pass the individual pmd library name.
> libdpdk.so is a linker script, not a real shared library.
> It disappeared in later versions.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-22 21:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 22:38 [dpdk-users] using dpdk as a shared library Justin Tallon
2020-12-19 19:27 ` Stephen Hemminger
2020-12-21 23:20   ` Justin Tallon
2020-12-21 23:32     ` Stephen Hemminger
2021-03-22 21:18       ` Justin Tallon

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).