aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-31 18:22:29 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-31 18:22:29 -0500
commit63b3ced0f80ae1c437620d3f7d6ff2bcf0745b0a (patch)
tree7fa2a57bffc456f6f83d62b64b7d50e35f5ed506 /drivers
parent28e0cf22c1221650b4bfba48808d966160c42320 (diff)
parentf9e61929e5e1dacc2afefbde6abc3e6571ca2887 (diff)
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/sa_query.c2
-rw-r--r--drivers/infiniband/core/uverbs_main.c1
-rw-r--r--drivers/infiniband/hw/mthca/mthca_av.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c4
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c25
5 files changed, 28 insertions, 6 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index acda7d63d6fe..501cc054cb3b 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -956,6 +956,8 @@ static void ib_sa_remove_one(struct ib_device *device)
956 956
957 ib_unregister_event_handler(&sa_dev->event_handler); 957 ib_unregister_event_handler(&sa_dev->event_handler);
958 958
959 flush_scheduled_work();
960
959 for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) { 961 for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
960 ib_unregister_mad_agent(sa_dev->port[i].agent); 962 ib_unregister_mad_agent(sa_dev->port[i].agent);
961 kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah); 963 kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 96ea79b63df7..903f85a4bc0c 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -902,6 +902,7 @@ static void __exit ib_uverbs_cleanup(void)
902 unregister_filesystem(&uverbs_event_fs); 902 unregister_filesystem(&uverbs_event_fs);
903 class_destroy(uverbs_class); 903 class_destroy(uverbs_class);
904 unregister_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES); 904 unregister_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES);
905 flush_scheduled_work();
905 idr_destroy(&ib_uverbs_pd_idr); 906 idr_destroy(&ib_uverbs_pd_idr);
906 idr_destroy(&ib_uverbs_mr_idr); 907 idr_destroy(&ib_uverbs_mr_idr);
907 idr_destroy(&ib_uverbs_mw_idr); 908 idr_destroy(&ib_uverbs_mw_idr);
diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c
index a14eed08a0fc..a19e0ed03d7c 100644
--- a/drivers/infiniband/hw/mthca/mthca_av.c
+++ b/drivers/infiniband/hw/mthca/mthca_av.c
@@ -184,7 +184,7 @@ int mthca_read_ah(struct mthca_dev *dev, struct mthca_ah *ah,
184 ah->av->sl_tclass_flowlabel & cpu_to_be32(0xfffff); 184 ah->av->sl_tclass_flowlabel & cpu_to_be32(0xfffff);
185 ib_get_cached_gid(&dev->ib_dev, 185 ib_get_cached_gid(&dev->ib_dev,
186 be32_to_cpu(ah->av->port_pd) >> 24, 186 be32_to_cpu(ah->av->port_pd) >> 24,
187 ah->av->gid_index, 187 ah->av->gid_index % dev->limits.gid_table_len,
188 &header->grh.source_gid); 188 &header->grh.source_gid);
189 memcpy(header->grh.destination_gid.raw, 189 memcpy(header->grh.destination_gid.raw,
190 ah->av->dgid, 16); 190 ah->av->dgid, 16);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index fd3f5c862a5d..c3b5f79d1168 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -505,7 +505,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
505 505
506 list_add_tail(&neigh->list, &path->neigh_list); 506 list_add_tail(&neigh->list, &path->neigh_list);
507 507
508 if (path->pathrec.dlid) { 508 if (path->ah) {
509 kref_get(&path->ah->ref); 509 kref_get(&path->ah->ref);
510 neigh->ah = path->ah; 510 neigh->ah = path->ah;
511 511
@@ -591,7 +591,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
591 return; 591 return;
592 } 592 }
593 593
594 if (path->pathrec.dlid) { 594 if (path->ah) {
595 ipoib_dbg(priv, "Send unicast ARP to %04x\n", 595 ipoib_dbg(priv, "Send unicast ARP to %04x\n",
596 be16_to_cpu(path->pathrec.dlid)); 596 be16_to_cpu(path->pathrec.dlid));
597 597
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 98039da0caf0..ccaa0c387076 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -97,6 +97,7 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
97 struct ipoib_dev_priv *priv = netdev_priv(dev); 97 struct ipoib_dev_priv *priv = netdev_priv(dev);
98 struct ipoib_neigh *neigh, *tmp; 98 struct ipoib_neigh *neigh, *tmp;
99 unsigned long flags; 99 unsigned long flags;
100 int tx_dropped = 0;
100 101
101 ipoib_dbg_mcast(netdev_priv(dev), 102 ipoib_dbg_mcast(netdev_priv(dev),
102 "deleting multicast group " IPOIB_GID_FMT "\n", 103 "deleting multicast group " IPOIB_GID_FMT "\n",
@@ -123,8 +124,14 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
123 if (mcast->ah) 124 if (mcast->ah)
124 ipoib_put_ah(mcast->ah); 125 ipoib_put_ah(mcast->ah);
125 126
126 while (!skb_queue_empty(&mcast->pkt_queue)) 127 while (!skb_queue_empty(&mcast->pkt_queue)) {
128 ++tx_dropped;
127 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue)); 129 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue));
130 }
131
132 spin_lock_irqsave(&priv->tx_lock, flags);
133 priv->stats.tx_dropped += tx_dropped;
134 spin_unlock_irqrestore(&priv->tx_lock, flags);
128 135
129 kfree(mcast); 136 kfree(mcast);
130} 137}
@@ -276,8 +283,10 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
276 } 283 }
277 284
278 /* actually send any queued packets */ 285 /* actually send any queued packets */
286 spin_lock_irq(&priv->tx_lock);
279 while (!skb_queue_empty(&mcast->pkt_queue)) { 287 while (!skb_queue_empty(&mcast->pkt_queue)) {
280 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue); 288 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
289 spin_unlock_irq(&priv->tx_lock);
281 290
282 skb->dev = dev; 291 skb->dev = dev;
283 292
@@ -288,7 +297,9 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
288 297
289 if (dev_queue_xmit(skb)) 298 if (dev_queue_xmit(skb))
290 ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n"); 299 ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n");
300 spin_lock_irq(&priv->tx_lock);
291 } 301 }
302 spin_unlock_irq(&priv->tx_lock);
292 303
293 return 0; 304 return 0;
294} 305}
@@ -300,6 +311,7 @@ ipoib_mcast_sendonly_join_complete(int status,
300{ 311{
301 struct ipoib_mcast *mcast = mcast_ptr; 312 struct ipoib_mcast *mcast = mcast_ptr;
302 struct net_device *dev = mcast->dev; 313 struct net_device *dev = mcast->dev;
314 struct ipoib_dev_priv *priv = netdev_priv(dev);
303 315
304 if (!status) 316 if (!status)
305 ipoib_mcast_join_finish(mcast, mcmember); 317 ipoib_mcast_join_finish(mcast, mcmember);
@@ -310,8 +322,12 @@ ipoib_mcast_sendonly_join_complete(int status,
310 IPOIB_GID_ARG(mcast->mcmember.mgid), status); 322 IPOIB_GID_ARG(mcast->mcmember.mgid), status);
311 323
312 /* Flush out any queued packets */ 324 /* Flush out any queued packets */
313 while (!skb_queue_empty(&mcast->pkt_queue)) 325 spin_lock_irq(&priv->tx_lock);
326 while (!skb_queue_empty(&mcast->pkt_queue)) {
327 ++priv->stats.tx_dropped;
314 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue)); 328 dev_kfree_skb_any(skb_dequeue(&mcast->pkt_queue));
329 }
330 spin_unlock_irq(&priv->tx_lock);
315 331
316 /* Clear the busy flag so we try again */ 332 /* Clear the busy flag so we try again */
317 clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags); 333 clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags);
@@ -687,6 +703,7 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,
687 if (!mcast) { 703 if (!mcast) {
688 ipoib_warn(priv, "unable to allocate memory for " 704 ipoib_warn(priv, "unable to allocate memory for "
689 "multicast structure\n"); 705 "multicast structure\n");
706 ++priv->stats.tx_dropped;
690 dev_kfree_skb_any(skb); 707 dev_kfree_skb_any(skb);
691 goto out; 708 goto out;
692 } 709 }
@@ -700,8 +717,10 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,
700 if (!mcast->ah) { 717 if (!mcast->ah) {
701 if (skb_queue_len(&mcast->pkt_queue) < IPOIB_MAX_MCAST_QUEUE) 718 if (skb_queue_len(&mcast->pkt_queue) < IPOIB_MAX_MCAST_QUEUE)
702 skb_queue_tail(&mcast->pkt_queue, skb); 719 skb_queue_tail(&mcast->pkt_queue, skb);
703 else 720 else {
721 ++priv->stats.tx_dropped;
704 dev_kfree_skb_any(skb); 722 dev_kfree_skb_any(skb);
723 }
705 724
706 if (mcast->query) 725 if (mcast->query)
707 ipoib_dbg_mcast(priv, "no address vector, " 726 ipoib_dbg_mcast(priv, "no address vector, "