DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] RTE_REGISTER_BUS does not work on Windows
@ 2021-09-23 17:47 William Tu
  2021-09-24 14:41 ` William Tu
  0 siblings, 1 reply; 3+ messages in thread
From: William Tu @ 2021-09-23 17:47 UTC (permalink / raw)
  To: dpdk-dev; +Cc: Dmitry Kozliuk

Hi,

I'm trying to run OVS-DPDK on Windows (building OVS binaries and
statically link DPDK windows library), and it doesn't work due to
rte_bus_scan() find no available devices. (However, when using
dpdk-testpmd.exe, it finds the device successfully)

I realized that the PCI bus driver calls RTE_REGISTER_BUS to
register itself, and it's a macro creating the businitfn_pci, and calls
rte_bus_register. But somehow on my system, it does not invoke
so actually the 'rte_bus_list' is empty. And I guess this is due to
"constructor" function not working correctly when I static link DPDK.

When linking DPDK using gcc, OVS passes the linker option '--whole-archive'.
https://github.com/openvswitch/ovs/blob/master/acinclude.m4#L509

I tried adding -Wl,-force_load, or -Wl,/WHOLEARCHIVE at libdpdk.pc.
So far I still couldn't get it to work. Any suggestions or comments are welcome!

Thank you
William

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

* Re: [dpdk-dev] RTE_REGISTER_BUS does not work on Windows
  2021-09-23 17:47 [dpdk-dev] RTE_REGISTER_BUS does not work on Windows William Tu
@ 2021-09-24 14:41 ` William Tu
  2021-09-25 13:45   ` William Tu
  0 siblings, 1 reply; 3+ messages in thread
From: William Tu @ 2021-09-24 14:41 UTC (permalink / raw)
  To: dpdk-dev; +Cc: Dmitry Kozliuk

Hi,

I continued my experiment and observed below
1. for dpdk-testpmd.exe which works fine, the functions in driver/bus/pci/*
are there in the binary, ex:
PS C:\dpdk\build\app> dumpbin.exe /ALL .\dpdk-testpmd.exe | grep rte_pci_set_b
  0001D1F0 0068DB40 0068DC32 0073BDEC  rte_pci_set_bus_master
So I think that's why
RTE_REGISTER_BUS(pci, rte_pci_bus.bus) works in dpdk-testpmd.exe

2. for my own application binary which static links DPDK library using
pkgconfig,
PS C:\example\build> dumpbin.exe /ALL .\demo.exe | grep rte_pci_set
<empty>
and it only has symbols from lib/eal/*, ex:
PS C:\example\build> dumpbin.exe /ALL .\demo.exe | grep rte_bus_re
  00000D14 000152D0 0001559E 00095CC8  rte_bus_register

Apparently the pci bus constructor function doesn't exist in my binary.
I'm going to try using meson subproject
https://mesonbuild.com/Subprojects.html

Thanks,
William

On Thu, Sep 23, 2021 at 10:47 AM William Tu <u9012063@gmail.com> wrote:
>
> Hi,
>
> I'm trying to run OVS-DPDK on Windows (building OVS binaries and
> statically link DPDK windows library), and it doesn't work due to
> rte_bus_scan() find no available devices. (However, when using
> dpdk-testpmd.exe, it finds the device successfully)
>
> I realized that the PCI bus driver calls RTE_REGISTER_BUS to
> register itself, and it's a macro creating the businitfn_pci, and calls
> rte_bus_register. But somehow on my system, it does not invoke
> so actually the 'rte_bus_list' is empty. And I guess this is due to
> "constructor" function not working correctly when I static link DPDK.
>
> When linking DPDK using gcc, OVS passes the linker option '--whole-archive'.
> https://github.com/openvswitch/ovs/blob/master/acinclude.m4#L509
>
> I tried adding -Wl,-force_load, or -Wl,/WHOLEARCHIVE at libdpdk.pc.
> So far I still couldn't get it to work. Any suggestions or comments are welcome!
>
> Thank you
> William

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

* Re: [dpdk-dev] RTE_REGISTER_BUS does not work on Windows
  2021-09-24 14:41 ` William Tu
@ 2021-09-25 13:45   ` William Tu
  0 siblings, 0 replies; 3+ messages in thread
From: William Tu @ 2021-09-25 13:45 UTC (permalink / raw)
  To: dpdk-dev; +Cc: Dmitry Kozliuk

I've resolved the issue by adding -Wl,/WHOLEARCHIVE at libdpdk.pc
Thanks
William

On Fri, Sep 24, 2021 at 7:41 AM William Tu <u9012063@gmail.com> wrote:
>
> Hi,
>
> I continued my experiment and observed below
> 1. for dpdk-testpmd.exe which works fine, the functions in driver/bus/pci/*
> are there in the binary, ex:
> PS C:\dpdk\build\app> dumpbin.exe /ALL .\dpdk-testpmd.exe | grep rte_pci_set_b
>   0001D1F0 0068DB40 0068DC32 0073BDEC  rte_pci_set_bus_master
> So I think that's why
> RTE_REGISTER_BUS(pci, rte_pci_bus.bus) works in dpdk-testpmd.exe
>
> 2. for my own application binary which static links DPDK library using
> pkgconfig,
> PS C:\example\build> dumpbin.exe /ALL .\demo.exe | grep rte_pci_set
> <empty>
> and it only has symbols from lib/eal/*, ex:
> PS C:\example\build> dumpbin.exe /ALL .\demo.exe | grep rte_bus_re
>   00000D14 000152D0 0001559E 00095CC8  rte_bus_register
>
> Apparently the pci bus constructor function doesn't exist in my binary.
> I'm going to try using meson subproject
> https://mesonbuild.com/Subprojects.html
>
> Thanks,
> William
>
> On Thu, Sep 23, 2021 at 10:47 AM William Tu <u9012063@gmail.com> wrote:
> >
> > Hi,
> >
> > I'm trying to run OVS-DPDK on Windows (building OVS binaries and
> > statically link DPDK windows library), and it doesn't work due to
> > rte_bus_scan() find no available devices. (However, when using
> > dpdk-testpmd.exe, it finds the device successfully)
> >
> > I realized that the PCI bus driver calls RTE_REGISTER_BUS to
> > register itself, and it's a macro creating the businitfn_pci, and calls
> > rte_bus_register. But somehow on my system, it does not invoke
> > so actually the 'rte_bus_list' is empty. And I guess this is due to
> > "constructor" function not working correctly when I static link DPDK.
> >
> > When linking DPDK using gcc, OVS passes the linker option '--whole-archive'.
> > https://github.com/openvswitch/ovs/blob/master/acinclude.m4#L509
> >
> > I tried adding -Wl,-force_load, or -Wl,/WHOLEARCHIVE at libdpdk.pc.
> > So far I still couldn't get it to work. Any suggestions or comments are welcome!
> >
> > Thank you
> > William

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

end of thread, other threads:[~2021-09-25 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 17:47 [dpdk-dev] RTE_REGISTER_BUS does not work on Windows William Tu
2021-09-24 14:41 ` William Tu
2021-09-25 13:45   ` William Tu

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