> -----Original Message----- > From: Jason Gunthorpe [mailto:jgg@xxxxxxxx] > Sent: Tuesday, March 20, 2018 5:37 PM > To: Parav Pandit <parav@xxxxxxxxxxxx> > Cc: Leon Romanovsky <leon@xxxxxxxxxx>; Doug Ledford > <dledford@xxxxxxxxxx>; Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA > mailing list <linux-rdma@xxxxxxxxxxxxxxx>; Mark Bloch <markb@xxxxxxxxxxxx> > Subject: Re: [PATCH rdma-rc 1/2] RDMA/restrack: Add ability to create non- > traceable restrack objects > > On Tue, Mar 20, 2018 at 07:19:28PM +0000, Parav Pandit wrote: > > > rdma_restrack_clean() call from ib_unregister_device() is not correct. > > rdma_restrack_init() is called in ib_alloc_device(). > > The correct cleanup routine of alloc_device() is ib_dealloc_device(). > > Therefore rdma_restrack_clean() should be done there. > > Ib_unregister_device() is not the right place regardless of what is done in this > patch. > > Not really.. It is a serious error for IB objects to still exist once the client remove > callbacks have completed, after that point the driver is gone and the objects > won't work right. > IB resources being open after it is unregistered is a hack being promoted here. Right way to do ib core to have open() and close() callback. These callback should be called as part of ib_register_device() and ib_unregister_device() sequence where provider driver can free resources. ib_unregister_driver() implementation could clear dma_mask and dma_device parameters being initialized; provider driver relying on such ignorance of ib core is not good design. > So it is reasonable to place the assertion that all objects are deleted where it is.. Yes, after open/close are implemented. Until than either rdma_restrack_clean() should move to ib_dealloc_device() or rdma_restrack_init() should move to ib_register_device() too. Which is not right given that resources are open after ib_unregister_device. Please do it correctly. > > If it did more stuff then maybe something would be needed in dealloc_device, > but as is is fine, if not strangely named. -- 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