IB/ipoib: Bound the net device to the ipoib_neigh structue
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 16822.1191538040@death
Quoted 14 lines · Jay Vosburgh
IPoIB uses a two layer neighboring scheme, such that for each struct neighbour whose device is an ipoib one, there is a struct
ipoib_neighbuddy which is created on demand at the tx flow by anipoib_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->devpoints to the master device, it changes this skb to point on the slave device and calls the slavehard_start_xmitfunction.Under this scheme,
ipoib_neigh_destructorassumption that for each struct neighbour it gets,n->devis an ipoib device and hencenetdev_priv(n->dev)can be casted to structipoib_dev_privis buggy.
Quoted 7 lines
To fix it, this patch adds a dev field to struct
ipoib_neighwhich is used instead of the struct neighbour dev one, whenn->dev->flagshas theIFF_MASTERbit set.Signed-off-by Moni Shoua <monis at voltaire.com>Signed-off-by Or Gerlitz <ogerlitz at voltaire.com>Acked-by Roland Dreier <[email protected]>
ACK, but patches do not apply to jgarzik/netdev-2.6.git#upstream nor davem/net-2.6.24.git, so I was forced to drop the patch series :(