RE: [PATCH v6 3/4] RDMA/Core: add RDMA_NLDEV_CMD_NEWLINK/DELLINK support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Thu, Dec 06, 2018 at 03:16:57PM -0600, Steve Wise wrote:
> > Jason, This  feature took a step back, imo, by using
> > ib_device_get_by_index() in nldev_dellink() and passing the struct
> > ib_device ptr vs simply passing the ibdev name string to the driver's
> > dellink() function and letting the driver deal with it all.  I'm
> > inclined to go back to that approach.  I don't see things getting
> > cleaner and simpler on this current path.
> 
> It doesn't solve anything to have the driver do the lookup, it still
> has to have proper locking and prevent the races. If it can do that,
> then it can do it with an already looked-up device just the same.
>

It can solve it because the driver has its own list of "active devices" and can use that to atomically remove it and deregister the ib device when everyone is done touching the driver struct.   

Using ib_device_get_by_index() just causes more headaches in the dellink path IMO...
 
> I'm still wondering if there is some core functions we could create to
> handle this common case for dellink drivers.
> 
> Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux