Skip to contentSkip to conversation

IB/ipoib: Bound the net device to the ipoib_neigh structue

PATCH Jeff Garzik 1 participant 1 message Oct 5, 2007 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 16822.1191538040@death

#1 lore raw
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_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.

Under this scheme, ipoib_neigh_destructor assumption that for each struct neighbour it gets, n->dev is an ipoib device and hence netdev_priv(n->dev) can be casted to struct ipoib_dev_priv is buggy.

Quoted 7 lines

To fix it, this patch adds a dev field to struct ipoib_neigh which is used instead of the struct neighbour dev one, when n->dev->flags has the IFF_MASTER bit set.

Signed-off-by Moni Shoua <monis at voltaire.com>
Signed-off-by Or Gerlitz <ogerlitz at voltaire.com>

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 :(