Commit 178709bb authored by David S. Miller's avatar David S. Miller

ipoib: Convert over to dev_lookup_neigh_skb().

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dbedbe6d
...@@ -715,7 +715,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -715,7 +715,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
rcu_read_lock(); rcu_read_lock();
if (likely(skb_dst(skb))) { if (likely(skb_dst(skb))) {
n = dst_get_neighbour_noref(skb_dst(skb)); n = dst_neigh_lookup_skb(skb_dst(skb), skb);
if (!n) { if (!n) {
++dev->stats.tx_dropped; ++dev->stats.tx_dropped;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
...@@ -797,6 +797,8 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -797,6 +797,8 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
} }
unlock: unlock:
if (n)
neigh_release(n);
rcu_read_unlock(); rcu_read_unlock();
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
...@@ -720,17 +720,21 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb) ...@@ -720,17 +720,21 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
rcu_read_lock(); rcu_read_lock();
if (dst) if (dst)
n = dst_get_neighbour_noref(dst); n = dst_neigh_lookup_skb(dst, skb);
if (n && !*to_ipoib_neigh(n)) { if (n) {
struct ipoib_neigh *neigh = ipoib_neigh_alloc(n, if (!*to_ipoib_neigh(n)) {
skb->dev); struct ipoib_neigh *neigh;
neigh = ipoib_neigh_alloc(n, skb->dev);
if (neigh) { if (neigh) {
kref_get(&mcast->ah->ref); kref_get(&mcast->ah->ref);
neigh->ah = mcast->ah; neigh->ah = mcast->ah;
list_add_tail(&neigh->list, &mcast->neigh_list); list_add_tail(&neigh->list,
&mcast->neigh_list);
} }
} }
neigh_release(n);
}
rcu_read_unlock(); rcu_read_unlock();
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN); ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment