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

Sean Hefty mshefty at ichips.intel.com
Tue Sep 20 09:18:51 PDT 2005


Guy German wrote:
> I'm sorry for bringing it up again, but I don't understand yet why a cma 
> consumer is different then any other verbs consumer (who needs to 
> synchronize between a device removal cb and device verbs calls).

The difference is that there isn't a verbs call that returns a pointer to a 
device.  Verbs consumers receive device events through their add/remove device 
routines.  The CMA can return a device before the consumer has been notified 
through their add device call, or after it has been removed by their remove 
device call.

> I understand that when returning from ib_cma_get_device the device can 
> be no longer valid, but if the consumer is aware of that and makes sure 
> it is (checks his devices lookup table after return), can't he just be 
> considered as a regular device client, from that point on ?
> 
> If this is not a valid approach, What is your suggestion for the issue ?

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.

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.

- Sean



More information about the general mailing list