Re: [PATCH] dynamically link libibverbs and librdma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ogerlitz@xxxxxxxxxxxx wrote on Wed, 24 Sep 2008 17:12 +0300:
> Pete Wyckoff wrote:
>> If my dlopen() suggestion works, in that it notices the lack of
>> libibverbs at runtime, this would work fine with RPMs:
>>
>>     tgt : requires whatever it needs for tcp; provides /usr/sbin/tgtd
>>     tgt-rdma : requires tgt, ibverbs, rdmacm; provides libtgt-rdma.so
>>
>> Base tgtd will always go looking for libtgt-rdma.so.  If it is successful, it configures up the iSER interface, else it quietly does only iSCSI on TCP.
> Yes, sounds like having two packages would work in the sense that a user  
> can always install the base package and would be able to install the  
> rdma package if they have the IB stack installed.
>
> I wonder if/how the calls from tgt to tgt-rdma can be implemented  
> without the typedefs and device structure holding pointers to function  
> which you didn't like in Doron's patch. If this can't be avoided also in  
> your approach, I don't see why its more elegant.

I was thinking of something as simple as

    void *h = dlopen("libtgt-rdma.so", RTLD_NOW);

that should run the __attribute__((constructor)) function in there,
which registers the iscsi_iser iscsi_transport.

That really should be all you need.  Nothing outside of iscsi_rdma.c
sees any of the IB symbols, so we don't need to hack up a fake
include file for them.

Of course I haven't tested this, but it would be pretty if it
worked.

		-- Pete
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux