On Tue, Jul 12, 2016 at 01:29:33PM -0600, Jason Gunthorpe wrote: > On Thu, Jun 30, 2016 at 04:39:26PM +0300, Matan Barak wrote: > > > > +static int ib_device_allocate_idrs(struct ib_device *device) > > +{ > > + spin_lock_init(&device->idr_lock); > > + idr_init(&device->idr); > > + return 0; > > +} > > + > > > + ret = ib_device_allocate_idrs(device); > > + if (ret) { > > + pr_warn("Couldn't allocate IDRs device %s with driver model\n", > > + device->name); > > + ib_cache_cleanup_one(device); > > + goto out; > > Eh? Can't happen, don't over design stuff like this. Return void from > ib_device_allocate_idrs Right, I'll do. > > > +static struct ib_uobject *idr_read_uobj(int id, struct ib_ucontext *context, > > + int nested) > > What chance is there to get rid of 'nested' ? If you want to use a new > locking model, I'm wondering if we should trial it with uverbs??? It is removed in our next version. > > > +struct ib_pd *idr_read_pd(int pd_handle, struct ib_ucontext *context) > > +{ > > + return idr_read_obj(pd_handle, context, 0); > > +} > > All this stuff needs a type check. Something needs to confirm that > 'pd_handle' is in fact a pd. This was being done before with the split > IDRs. > > I'd also suggest that the uobj restructuring be completed a dedicated > series. > > It looks like all approaches require this sort of stuff, and perhaps it could be > merged?? > > I didn't look at the locking in any of this stuff, maybe once you finish > it up. I think that the best way will be to wait for the next version, because we reworked locking approach and removed all these idr_read.../idr_write.. calls. > > Jason > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html
Attachment:
signature.asc
Description: Digital signature