aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-10 14:16:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-10 14:16:33 -0400
commit3af73d392c9c414ca527bab9c5d4c2a97698acbd (patch)
treeacfe8969ecc9bf0f4d331f890a1127300cfe246a /drivers/infiniband/ulp/ipoib/ipoib_multicast.c
parent13dd7f876dffb44088c5435c3df1986e33cff960 (diff)
parenteedd5d0a707a8ad704e03bda5fbfe6b1a8e5f028 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (29 commits) RDMA/nes: Fix slab corruption IB/mlx4: Set RLKEY bit for kernel QPs RDMA/nes: Correct error_module bit mask RDMA/nes: Fix routed RDMA connections RDMA/nes: Enhanced PFT management scheme RDMA/nes: Handle AE bounds violation RDMA/nes: Limit critical error interrupts RDMA/nes: Stop spurious MAC interrupts RDMA/nes: Correct tso_wqe_length RDMA/nes: Fill in firmware version for ethtool RDMA/nes: Use ethtool timer value RDMA/nes: Correct MAX TSO frags value RDMA/nes: Enable MC/UC after changing MTU RDMA/nes: Free NIC TX buffers when destroying NIC QP RDMA/nes: Fix MDC setting RDMA/nes: Add wqm_quanta module option RDMA/nes: Module parameter permissions RDMA/cxgb3: Set active_mtu in ib_port_attr RDMA/nes: Add support for 4-port 1G HP blade card RDMA/nes: Make mini_cm_connect() static ...
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_multicast.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index aae28620a6e5..d9d1223c3fd5 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -69,14 +69,13 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
69 struct net_device *dev = mcast->dev; 69 struct net_device *dev = mcast->dev;
70 struct ipoib_dev_priv *priv = netdev_priv(dev); 70 struct ipoib_dev_priv *priv = netdev_priv(dev);
71 struct ipoib_neigh *neigh, *tmp; 71 struct ipoib_neigh *neigh, *tmp;
72 unsigned long flags;
73 int tx_dropped = 0; 72 int tx_dropped = 0;
74 73
75 ipoib_dbg_mcast(netdev_priv(dev), 74 ipoib_dbg_mcast(netdev_priv(dev),
76 "deleting multicast group " IPOIB_GID_FMT "\n", 75 "deleting multicast group " IPOIB_GID_FMT "\n",
77 IPOIB_GID_ARG(mcast->mcmember.mgid)); 76 IPOIB_GID_ARG(mcast->mcmember.mgid));
78 77
79 spin_lock_irqsave(&priv->lock, flags); 78 spin_lock_irq(&priv->lock);
80 79
81 list_for_each_entry_safe(neigh, tmp, &mcast->neigh_list, list) { 80 list_for_each_entry_safe(neigh, tmp, &mcast->neigh_list, list) {
82 /* 81 /*
@@ -90,7 +89,7 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
90 ipoib_neigh_free(dev, neigh); 89 ipoib_neigh_free(dev, neigh);
91 } 90 }
92 91
93 spin_unlock_irqrestore(&priv->lock, flags); 92 spin_unlock_irq(&priv->lock);
94 93
95 if (mcast->ah) 94 if (mcast->ah)
96 ipoib_put_ah(mcast->ah); 95 ipoib_put_ah(mcast->ah);
@@ -100,9 +99,9 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
100 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue)); 99 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue));
101 } 100 }
102 101
103 spin_lock_irqsave(&priv->tx_lock, flags); 102 netif_tx_lock_bh(dev);
104 dev->stats.tx_dropped += tx_dropped; 103 dev->stats.tx_dropped += tx_dropped;
105 spin_unlock_irqrestore(&priv->tx_lock, flags); 104 netif_tx_unlock_bh(dev);
106 105
107 kfree(mcast); 106 kfree(mcast);
108} 107}
@@ -259,10 +258,10 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
259 } 258 }
260 259
261 /* actually send any queued packets */ 260 /* actually send any queued packets */
262 spin_lock_irq(&priv->tx_lock); 261 netif_tx_lock_bh(dev);
263 while (!skb_queue_empty(&mcast->pkt_queue)) { 262 while (!skb_queue_empty(&mcast->pkt_queue)) {
264 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue); 263 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
265 spin_unlock_irq(&priv->tx_lock); 264 netif_tx_unlock_bh(dev);
266 265
267 skb->dev = dev; 266 skb->dev = dev;
268 267
@@ -273,9 +272,9 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
273 272
274 if (dev_queue_xmit(skb)) 273 if (dev_queue_xmit(skb))
275 ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n"); 274 ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n");
276 spin_lock_irq(&priv->tx_lock); 275 netif_tx_lock_bh(dev);
277 } 276 }
278 spin_unlock_irq(&priv->tx_lock); 277 netif_tx_unlock_bh(dev);
279 278
280 return 0; 279 return 0;
281} 280}
@@ -286,7 +285,6 @@ ipoib_mcast_sendonly_join_complete(int status,
286{ 285{
287 struct ipoib_mcast *mcast = multicast->context; 286 struct ipoib_mcast *mcast = multicast->context;
288 struct net_device *dev = mcast->dev; 287 struct net_device *dev = mcast->dev;
289 struct ipoib_dev_priv *priv = netdev_priv(dev);
290 288
291 /* We trap for port events ourselves. */ 289 /* We trap for port events ourselves. */
292 if (status == -ENETRESET) 290 if (status == -ENETRESET)
@@ -302,12 +300,12 @@ ipoib_mcast_sendonly_join_complete(int status,
302 IPOIB_GID_ARG(mcast->mcmember.mgid), status); 300 IPOIB_GID_ARG(mcast->mcmember.mgid), status);
303 301
304 /* Flush out any queued packets */ 302 /* Flush out any queued packets */
305 spin_lock_irq(&priv->tx_lock); 303 netif_tx_lock_bh(dev);
306 while (!skb_queue_empty(&mcast->pkt_queue)) { 304 while (!skb_queue_empty(&mcast->pkt_queue)) {
307 ++dev->stats.tx_dropped; 305 ++dev->stats.tx_dropped;
308 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue)); 306 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue));
309 } 307 }
310 spin_unlock_irq(&priv->tx_lock); 308 netif_tx_unlock_bh(dev);
311 309
312 /* Clear the busy flag so we try again */ 310 /* Clear the busy flag so we try again */
313 status = test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY, 311 status = test_and_clear_bit(IPOIB_MCAST_FLAG_BUSY,
@@ -662,12 +660,9 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
662{ 660{
663 struct ipoib_dev_priv *priv = netdev_priv(dev); 661 struct ipoib_dev_priv *priv = netdev_priv(dev);
664 struct ipoib_mcast *mcast; 662 struct ipoib_mcast *mcast;
663 unsigned long flags;
665 664
666 /* 665 spin_lock_irqsave(&priv->lock, flags);
667 * We can only be called from ipoib_start_xmit, so we're
668 * inside tx_lock -- no need to save/restore flags.
669 */
670 spin_lock(&priv->lock);
671 666
672 if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) || 667 if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) ||
673 !priv->broadcast || 668 !priv->broadcast ||
@@ -738,7 +733,7 @@ out:
738 } 733 }
739 734
740unlock: 735unlock:
741 spin_unlock(&priv->lock); 736 spin_unlock_irqrestore(&priv->lock, flags);
742} 737}
743 738
744void ipoib_mcast_dev_flush(struct net_device *dev) 739void ipoib_mcast_dev_flush(struct net_device *dev)