Re: [PATCH v7 5/5] rdma_rxe: use netlink messages to add/delete links

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

 



On Tue, Dec 18, 2018 at 02:52:40PM -0600, Steve Wise wrote:

> > Hurm. So there is another pre-existing problem here..
> >
> > ib_register_device creates a device and that immediately becomes
> > available to be unregistered - ie this can race with a netdev notifier
> > tearing down the netdev.
> >
> > So, rxe_register_device/net_add can't return a pointer and we can't
> > call rxe_set_port_state like this.
> >
> > rxe_set_port_state has to be done before registration or as part of
> > some kind of core code callback setting up the device, or we have to
> > do more stuff with refcounting.
> 
> ib_register_device() could take a kref on the ib_device before it
> becomes available to be unregistered.  Then the callers could be
> required to ib_device_put() at the end of these sorts of operations.  Maybe?

Maybe, we could also have a 'setup' callback like netdev does...

 Frankly I'm a bit suspicious that drivers touching the device after
registration are even right :)

Perhaps this is why the netdev version of newlink creates the netdev
on behalf of the client, so the core can provide enough locking
against dellink.. This is made more complicated by the unregister path
too..

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