[openib-general] [PATCH] IB/ipoib get net_device from ipoib_neigh instead of linux neighbour

Michael S. Tsirkin mst at mellanox.co.il
Wed Feb 7 10:24:26 PST 2007


> Quoting Moni Shoua <monis at voltaire.com>:
> Subject: Re: [PATCH] IB/ipoib get net_device from ipoib_neigh instead of linux neighbour
> 
> 
> > Another concern: assume that one device goes away (e.g. hotplug).
> > It seems that neighbours whose dev field point to another device, will not be destroyed.
> > Correct?
>
> I agree.
>
> > Therefore in your design, it seems that to_ipoib_neigh()->dev
> > will get us a pointer to device that has been removed already.
> > 
> I agree that this is a problem.

I think we can solve this if we track all ipoib neighbours, like we do for old kernels,
and then flush ipoib neighbours on any hotplug event.
Roland, does this sound too awful?

> It think it would be best to prevent an IPoIB device
> from disappearing or from ib_ipoib from being unloaded as long as IPoIB
> device is a slave. Unfortunately, I don't see how this can be done just
> by fixing something in bonding or IPoIB. 

So hotplug is blocked potentially forever?
This does not sound good.

> However, any slave knows he has a master (dev->master). 
> What do you think about a solution where IPoIB first tries to clean up the
> neighbours that belong to it's master before deleting the IPoIB device?

How?

> >> Furthermore, bond_setup_by_slave is called only for non
> >> Ethernet devices (we consider to change the logic to "called only for
> >> IPoIB devices just for safety).
> > 
> > Why is this necessary, BTW?
> > 
> If we don't do that, we get a memory leak because the neigh destructor will
> never be called for non IPoIB devices although they carry ipoib_neigh
> with them.

How can this happen? If it does, I think we are back to where we started:
to_ipoib_neigh is broken for non-IPoIB device.
I thought you said only devices of the same type can be paired?


-- 
MST




More information about the general mailing list