On Tue, 23 Jul 2019 09:59:04 +0200 Thomas Monjalon <tho...@monjalon.net> wrote:
> 22/07/2019 20:34, Stephen Hemminger: > > On Mon, 22 Jul 2019 19:31:08 +0200 > > Thomas Monjalon <tho...@monjalon.net> wrote: > > > > > 22/07/2019 19:13, Stephen Hemminger: > > > > Thomas Monjalon <tho...@monjalon.net> wrote: > > > > > Are the constructors run on dlopen of the bus driver? > > > > > > > > Yes, constructors are run on dlopen. > > > > But application should not have to ask DPDK to dlopen the bus devices. > > > > > > > > The core principle is that dynamic build of DPDK should act the same as > > > > old > > > > statically linked DPDK. Otherwise, the user experience is even worse, > > > > and all > > > > the example documentation is wrong. > > > > > > OK, this is where I wanted to bring the discussion. > > > You are arguing against a design which is in DPDK from some early days. > > > So this is an interesting discussion to have. > > > Do we want to change the "plugin model" we have? > > > Or do we want to simply drop this model (dlopen calls) > > > and replace it with strong dynamic linking? > > > > I argue that examples should work the same with dynamic linking. > > This used to work before the break out of the bus model, so it is a bug. > > The PCI support was part of EAL, yes, but the device drivers > were plugins and already required the -d option. > > > For distributions, this also matters. Linking with -ldpdk which is a linker > > script should work. > > There is no longer this linker script with meson. > > Ok, for usability that is a problem. Requiring user to figure out which DPDK libraries to link with is a serious waste of time. It should be possible to just link with -ldpdk and distribution packages and just get the necessary libraries for the application (no extra rte_foo_bar .so loaded at run time), and the application should just work. The idea that the user should link with 20 shared libraries, in the right order and pass -d flags to eal_init to load the right PMD is user hostile. It only makes sense if you want to invent yet another layer to manage the ugly stuff hidden underneath. Think virt-manager versus raw KVM/QEMU. I know it is hard, and I know not all this will make it into 19.08 but let's try and do better. The DPDK already has a reputation as being like a super car, (ie unreliable and hard to drive). It doesn't have to be that way.