[openib-general] [PATCH/RFC] libibverbs: Improve driver loading
Michael S. Tsirkin
mst at mellanox.co.il
Mon Dec 25 06:18:49 PST 2006
> OK, at last here is a patch that implements the improvements to
> libibverbs driver loading that we discussed back in October.
>
> With this patch, instead of trying all the .so files in the
> $(libdir)/infiniband directory as libibverbs 1.0 does, libibverbs
> instead builds a list of drivers to load and dlopen() exactly that
> list of libraries. It uses relative paths rather than absolute paths,
> so the linker uses the normal search path to find driver libraries.
>
> (To get a list of drivers, libibverbs parses all the config files it
> finds in $(sysconfdir)/libibverbs.d and also looks at the environment
> variables RDMAV_DRIVERS and IBV_DRIVERS)
>
> Then, instead of calling a specific entry point in the driver,
> libibverbs assumes the driver will call ibv_register_driver() from an
> __attribute__((constructor)) function.
>
> This has a number of benefits:
> - multiple drivers can be linked statically into an executable
> - LD_LIBRARY_PATH can be used to manage which drivers to load
> - different versions of the driver can be selected automagically at
> runtime (eg i686/cmov on i386 distros)
>
> I will post a libmthca patch to illustrate how driver libraries need
> to change to work with this new libibverbs method.
I think this looked good, and probably best to do before the next
major release.
Do you plan to merge this?
--
MST
More information about the general
mailing list