[openib-general] [PATCH] IB/ipoib: Add field dev to struct ipoib_neigh

Michael S. Tsirkin mst at mellanox.co.il
Tue Jan 23 10:23:52 PST 2007


> Quoting Moni Shoua <monis at voltaire.com>:
> Subject: [PATCH] IB/ipoib: Add field dev to struct ipoib_neigh
> 
> IPoIB uses a two layer neighboring scheme, such that for each struct neighbour
> whose device is an ipoib one, there is a struct ipoib_neigh buddy which is
> created on demand at the tx flow by an ipoib_neigh_alloc(skb->dst->neighbour)
> call.
> 
> When using the bonding driver, neighbours are created by the net stack on behalf
> of the bonding (master) device. On the tx flow the bonding code gets an skb such
> that skb->dev points to the master device, it changes this skb to point on the
> slave device and calls the slave hard_start_xmit function.
> 
> Combing these two flows, there is a hole if some code at ipoib
> (ipoib_neigh_destructor) assumes that for each struct neighbour it gets, n->dev
> is an ipoib device so for example netdev_priv(n->dev) would be of type struct
> ipoib_dev_priv.
> 
> To fix it, this patch adds a dev field to struct ipoib_neigh which is used
> instead of the struct neighbour dev one.
> 
> Signed-off-by: Moni Shoua <monis at voltaire.com>
> Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>

Just to clarify - you previously mentionned you saw problems with 2.6.16
backport. Is this an issue you see with 2.6.20 as well?

Also - in your approach, what prevents the device from going away while there
are still ipoib_neigh objects around?
Also - if neigh does not point to ipoib device, our neigh destructor won't be called
for it, will it? What will clean the ipoib neigh then?

-- 
MST




More information about the general mailing list