[openib-general][RFC][CMA]: ib_cma_get_device hot unplug issue

Guy German guyg at voltaire.com
Wed Sep 21 03:58:24 PDT 2005


Sean Hefty wrote:
> Requiring users to validate that a pointer returned from a function is 
> valid seems like a poor API design.  Returning a GUID in that case seems 
> like a better approach, so that the user is forced to perform the 
> required lookup.  We need to make it easy for users.

rdma_cm_get_guid (by dst_ip) sounds like a good idea to me.
Although there is not much difference for the user between finding a device by 
guid and validating a device pointer (functionality wise), I agree the former 
does look cleaner.

> We could also require users to pass in a device structure as input and 
> let the calls fail if lookup fails.  For example, we could add calls to 
> get the IP addresses associated with a particular device port.

I am not quite sure I follow you here, but I think it is not enough that lookup 
succeeds, you need to synchronize between the removal cb and the verbs calls, 
via locking mechanism of some sort (lock before device free and lock before 
calling ib_query_port, for example)

If the cma would be the one actually registered as the client (to
get the removal callbacks), the consumer would practically not be able to
call verbs like ib_create_pd, ib_create_cq, ib_query_port etc ...

Any way, I don't think it is a good idea to register the cma layer as a device 
client, if we want it to be a thin mid layer.


Guy




More information about the general mailing list