ipoib: Convert over to dev_lookup_neigh_skb().
authorDavid S. Miller <davem@davemloft.net>
Tue, 3 Jul 2012 05:00:03 +0000 (22:00 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Jul 2012 08:09:36 +0000 (01:09 -0700)
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/infiniband/ulp/ipoib/ipoib_multicast.c

index 3974c290b667514ba8b2ea03d71367bc1650795a..bbee4b2d7a13b46b847a56f8f1538de8fe5ec9be 100644 (file)
@@ -715,7 +715,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        rcu_read_lock();
        if (likely(skb_dst(skb))) {
-               n = dst_get_neighbour_noref(skb_dst(skb));
+               n = dst_neigh_lookup_skb(skb_dst(skb), skb);
                if (!n) {
                        ++dev->stats.tx_dropped;
                        dev_kfree_skb_any(skb);
@@ -797,6 +797,8 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
                }
        }
 unlock:
+       if (n)
+               neigh_release(n);
        rcu_read_unlock();
        return NETDEV_TX_OK;
 }
index 20ebc6fd1bb9e0dc16f7bf954a16eb9a149d1dd9..fbb95ee538b2dc1b10c25131c86faeb81307398e 100644 (file)
@@ -720,16 +720,20 @@ out:
 
                rcu_read_lock();
                if (dst)
-                       n = dst_get_neighbour_noref(dst);
-               if (n && !*to_ipoib_neigh(n)) {
-                       struct ipoib_neigh *neigh = ipoib_neigh_alloc(n,
-                                                                     skb->dev);
-
-                       if (neigh) {
-                               kref_get(&mcast->ah->ref);
-                               neigh->ah       = mcast->ah;
-                               list_add_tail(&neigh->list, &mcast->neigh_list);
+                       n = dst_neigh_lookup_skb(dst, skb);
+               if (n) {
+                       if (!*to_ipoib_neigh(n)) {
+                               struct ipoib_neigh *neigh;
+
+                               neigh = ipoib_neigh_alloc(n, skb->dev);
+                               if (neigh) {
+                                       kref_get(&mcast->ah->ref);
+                                       neigh->ah       = mcast->ah;
+                                       list_add_tail(&neigh->list,
+                                                     &mcast->neigh_list);
+                               }
                        }
+                       neigh_release(n);
                }
                rcu_read_unlock();
                spin_unlock_irqrestore(&priv->lock, flags);