aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib/ipoib.h
diff options
context:
space:
mode:
authorMoni Shoua <monis@voltaire.com>2007-10-09 22:43:36 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-15 14:20:45 -0400
commit732a2170f499ce7cf5f0bdd4f9e0b0c8337b67e1 (patch)
treedb71c08db18421709b829aa1ea87803bbaf3e752 /drivers/infiniband/ulp/ipoib/ipoib.h
parenta8a935dae5de65a8f5a5371a58ad2aa73a0ea2da (diff)
IB/ipoib: Bound the net device to the ipoib_neigh structue
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. 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> Acked-by: Roland Dreier <rdreier@cisco.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib.h')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index 6545fa798b12..1b3327ad6bc4 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -349,6 +349,7 @@ struct ipoib_neigh {
349 struct sk_buff_head queue; 349 struct sk_buff_head queue;
350 350
351 struct neighbour *neighbour; 351 struct neighbour *neighbour;
352 struct net_device *dev;
352 353
353 struct list_head list; 354 struct list_head list;
354}; 355};
@@ -365,7 +366,8 @@ static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh)
365 INFINIBAND_ALEN, sizeof(void *)); 366 INFINIBAND_ALEN, sizeof(void *));
366} 367}
367 368
368struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neigh); 369struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neigh,
370 struct net_device *dev);
369void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh); 371void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh);
370 372
371extern struct workqueue_struct *ipoib_workqueue; 373extern struct workqueue_struct *ipoib_workqueue;