Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69309
b: refs/heads/master
c: 732a217
h: refs/heads/master
i:
  69307: 196038c
v: v3
  • Loading branch information
Moni Shoua authored and Jeff Garzik committed Oct 15, 2007
1 parent 635c8bc commit be4d2e2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8a935dae5de65a8f5a5371a58ad2aa73a0ea2da
refs/heads/master: 732a2170f499ce7cf5f0bdd4f9e0b0c8337b67e1
4 changes: 3 additions & 1 deletion trunk/drivers/infiniband/ulp/ipoib/ipoib.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ struct ipoib_neigh {
struct sk_buff_head queue;

struct neighbour *neighbour;
struct net_device *dev;

struct list_head list;
};
Expand All @@ -365,7 +366,8 @@ static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh)
INFINIBAND_ALEN, sizeof(void *));
}

struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neigh);
struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neigh,
struct net_device *dev);
void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh);

extern struct workqueue_struct *ipoib_workqueue;
Expand Down
24 changes: 15 additions & 9 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
struct ipoib_path *path;
struct ipoib_neigh *neigh;

neigh = ipoib_neigh_alloc(skb->dst->neighbour);
neigh = ipoib_neigh_alloc(skb->dst->neighbour, skb->dev);
if (!neigh) {
++dev->stats.tx_dropped;
dev_kfree_skb_any(skb);
Expand Down Expand Up @@ -817,28 +817,33 @@ static void ipoib_neigh_cleanup(struct neighbour *n)
unsigned long flags;
struct ipoib_ah *ah = NULL;

neigh = *to_ipoib_neigh(n);
if (neigh) {
priv = netdev_priv(neigh->dev);
ipoib_dbg(priv, "neigh_destructor for bonding device: %s\n",
n->dev->name);
} else
return;
ipoib_dbg(priv,
"neigh_cleanup for %06x " IPOIB_GID_FMT "\n",
IPOIB_QPN(n->ha),
IPOIB_GID_RAW_ARG(n->ha + 4));

spin_lock_irqsave(&priv->lock, flags);

neigh = *to_ipoib_neigh(n);
if (neigh) {
if (neigh->ah)
ah = neigh->ah;
list_del(&neigh->list);
ipoib_neigh_free(n->dev, neigh);
}
if (neigh->ah)
ah = neigh->ah;
list_del(&neigh->list);
ipoib_neigh_free(n->dev, neigh);

spin_unlock_irqrestore(&priv->lock, flags);

if (ah)
ipoib_put_ah(ah);
}

struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour)
struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour,
struct net_device *dev)
{
struct ipoib_neigh *neigh;

Expand All @@ -847,6 +852,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour)
return NULL;

neigh->neighbour = neighbour;
neigh->dev = dev;
*to_ipoib_neigh(neighbour) = neigh;
skb_queue_head_init(&neigh->queue);
ipoib_cm_set(neigh, NULL);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,8 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
if (skb->dst &&
skb->dst->neighbour &&
!*to_ipoib_neigh(skb->dst->neighbour)) {
struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb->dst->neighbour);
struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb->dst->neighbour,
skb->dev);

if (neigh) {
kref_get(&mcast->ah->ref);
Expand Down

0 comments on commit be4d2e2

Please sign in to comment.