[PATCH WIP/RFC v2 6/6] nvme-rdma: use ib_client API to detect device removal

Steve Wise swise at opengridcomputing.com
Tue Aug 30 08:44:07 PDT 2016


> > > +static void nvme_rdma_add_one(struct ib_device *ib_device)
> > > +{
> > > +	/* devices are added dynamically as targets use them */
> > > +}
> >
> > Is the add callback mandatory in the core?  Would be nice if we could
> > fix that up in an incremental patch.
> >
> 
> We can just not populate the add function.  From ib_register_device():
> 
> ---
>         list_for_each_entry(client, &client_list, list)
>                 if (client->add && !add_client_context(device, client))
>                         client->add(device);
> ---

I'm wrong.  If you don't provide an add function, it doesn't call
add_client_context() and thus the client isn't associated with this device and
won't get remove() calls.  

You think this should be changed in the core?  I think it is simpler just to
have a noop add function, and it keeps the current symmetry of the ib_client
API...

Steve.




More information about the Linux-nvme mailing list