[openib-general] Re: [PATCH] IPoIB: Add API to retrieve ib device, port, and pkey
Hal Rosenstock
halr at voltaire.com
Mon Oct 10 08:03:24 PDT 2005
On Thu, 2005-10-06 at 12:55, Roland Dreier wrote:
> Did we ever figure out how to handle the hotplug issues with the
> lifetime of the struct ib_device pointer? Right now this API is
> unsafe, because a caller can get a pointer to a device that has
> already disappeared.
I think this can be handled as follows:
The netdev references would be maintained for the duration each AT call
until it completes/times out. If subsequent calls are made based on an
ib_device which has been removed, an error could be returned based on
the fact that AT maintaining a list of devices and validate the
supplied device against its list.
ipoib_get_info() would be called only with a valid device and the caller
holding a netdev reference for at least the duration of that call.
> Also if we do decide to add an API like this, the struct ipoib_info
> and ipoib_get_info() declarations should be in <linux/if_infiniband.h>
> rather than in the private ipoib.h header.
OK.
-- Hal
More information about the general
mailing list