<br><font size=2 face="sans-serif">Please review this patch.</font>
<br>
<div>
<br><font size=2 face="sans-serif">diff -urN infiniband/ulp/ipoib/ipoib_main.c
infiniband-path/ulp/ipoib/ipoib_main.c<br>
--- infiniband/ulp/ipoib/ipoib_main.c 2005-02-17
17:24:56.000000000 +0000<br>
+++ infiniband-path/ulp/ipoib/ipoib_main.c 2005-02-18
01:29:52.000000000 +0000<br>
@@ -215,15 +215,17 @@<br>
return 0;<br>
}<br>
<br>
-static void __path_free(struct net_device *dev, struct ipoib_path *path)<br>
+static void path_free(struct net_device *dev, struct ipoib_path *path)<br>
{<br>
struct ipoib_dev_priv *priv = netdev_priv(dev);<br>
struct ipoib_neigh *neigh, *tn;<br>
struct sk_buff *skb;<br>
+ unsigned long flags;<br>
<br>
while ((skb = __skb_dequeue(&path->queue)))<br>
dev_kfree_skb_irq(skb);<br>
<br>
+ spin_lock_irqsave(&priv->lock,
flags);<br>
list_for_each_entry_safe(neigh, tn,
&path->neigh_list, list) {<br>
if
(neigh->ah)<br>
ipoib_put_ah(neigh->ah);<br>
@@ -231,13 +233,16 @@<br>
neigh->neighbour->ops->destructor
= NULL;<br>
kfree(neigh);<br>
}<br>
+ spin_unlock_irqrestore(&priv->lock,
flags);<br>
<br>
if (path->ah)<br>
ipoib_put_ah(path->ah);<br>
<br>
+ spin_lock_irqsave(&priv->lock,
flags);<br>
rb_erase(&path->rb_node, &priv->path_tree);</font>
<br><font size=2 face="sans-serif"> list_del(&path->list);<br>
kfree(path);<br>
+ spin_unlock_irqrestore(&priv->lock,
flags);<br>
}<br>
<br>
void ipoib_flush_paths(struct net_device *dev)<br>
@@ -256,7 +261,7 @@<br>
if
(path->query)<br>
ib_sa_cancel_query(path->query_id, path->query);<br>
wait_for_completion(&path->done);<br>
- __path_free(dev,
path);<br>
+ path_free(dev,
path);<br>
}<br>
}<br>
<br>
@@ -496,8 +501,11 @@<br>
skb_push(skb, sizeof *phdr);<br>
__skb_queue_tail(&path->queue, skb);<br>
<br>
-
if (path_rec_start(dev, path))<br>
-
__path_free(dev,
path);<br>
+
if (path_rec_start(dev, path)) {<br>
+
spin_unlock(&priv->lock);<br>
+
path_free(dev,
path);<br>
+
return;<br>
+
}<br>
}
else {<br>
++priv->stats.tx_dropped;<br>
dev_kfree_skb_any(skb);</font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Thanks<br>
Shirley Ma<br>
IBM Linux Technology Center<br>
15300 SW Koll Parkway<br>
Beaverton, OR 97006-6063<br>
Phone(Fax): (503) 578-7638<br>
<br>
</font></div>