dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
* building shared library
@ 2014-11-10 14:22 Newman Poborsky
       [not found] ` <CAHW=9PsD80QvZnQ1Xz5pXz5vtkDR8opYdZTZpaQkqiBRfqozOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Newman Poborsky @ 2014-11-10 14:22 UTC (permalink / raw)
  To: dev-VfR2kkLFssw@public.gmane.org

Hi,

is it possible to build a  dpdk app as a shared library?

I tried to put 'include $(RTE_SDK)/mk/rte.extshared.mk' in my Makefile (and
define SHARED) and it builds .so lib, but all rte_* symbols are undefined.

After that i tried adding:
LDLIBS += -lrte_eal -lrte_mbuf -lrte_cmdline -lrte_timer  -lrte_mempool
-lrte_ring  -lrte_pmd_ring -lethdev -lrte_malloc

And now almost all symbols in .so file are defined (missing only
rte_hexdump).

I thought this was gonna be it. But after using this library, pci probe-ing
fails since I don't have any pmd drivers registered, and
rte_eth_dev_count() returns 0.

But how are drivers supposed to be registered?

When I use gdb with regular dpdk app (not shared library), I can see this:
#0  0x000000000046fab0 in rte_eal_driver_register ()
#1  0x0000000000418fb7 in devinitfn_bond_drv ()
#2  0x00000000004f15ed in __libc_csu_init ()
#3  0x00007ffff6efee55 in __libc_start_main (main=0x41ee65 <main>, argc=1,
argv=0x7fffffffe4f8, init=0x4f15a0 <__libc_csu_init>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffe4e8) at
libc-start.c:246
#4  0x000000000041953c in _start ()


Ok, if I'm not mistaken, it seems driver registration is called before
main. How is this accomplished? Cause in shared library build, I don't have
this before main() and after rte_eal_init() (since driver list is empty)
everything else fails.

Any suggestions please? I'd really appreciate it...

BR,
Newman P.

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

end of thread, other threads:[~2014-11-11 16:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 14:22 building shared library Newman Poborsky
     [not found] ` <CAHW=9PsD80QvZnQ1Xz5pXz5vtkDR8opYdZTZpaQkqiBRfqozOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-11  1:01   ` Matthew Hall
2014-11-11  3:28   ` Chi, Xiaobo (NSN - CN/Hangzhou)
     [not found]     ` <EF703E8970265941A1316EEFE0AA7B6C40A59885-vxsKAgvzMM8+o/1KEruIITjhXmbd+16H@public.gmane.org>
2014-11-11  7:29       ` Newman Poborsky
2014-11-11 10:37   ` Gonzalez Monroy, Sergio
     [not found]     ` <91383E96CE459D47BCE92EFBF5CE73B004E9D503-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-11 12:10       ` Newman Poborsky
     [not found]         ` <CAHW=9Pt0R_Zu7a9Bbue+eFRhyLoQ12uup27juWFB+HfpWeuKCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-11 14:18           ` Sergio Gonzalez Monroy
     [not found]             ` <20141111141857.GA4807-IWE99D/oH1/+pXziaqXtF9h3ngVCH38I@public.gmane.org>
2014-11-11 14:44               ` Newman Poborsky
     [not found]                 ` <CAHW=9PsTeUUiX6UnuR=Kjv7g2_DMk-VMScWFdCj_ZzKNT=_G-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-11 15:16                   ` Newman Poborsky
     [not found]                     ` <CAHW=9PsQ2-hhV9O=0vnP9db0cz3C2vCq-_gF8nz7M1wtfy1Ptw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-11 15:26                       ` De Lara Guarch, Pablo
     [not found]                         ` <E115CCD9D858EF4F90C690B0DCB4D89726835BFB-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-11 15:54                           ` Neil Horman
     [not found]                             ` <20141111155408.GC31973-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2014-11-11 16:24                               ` Newman Poborsky

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