[openib-general] Re: [PATCH RESEND] net: Move destructor from neigh->ops to neigh_params

Shirley Ma xma at us.ibm.com
Thu Feb 16 11:14:48 PST 2006


Hi, Michael,

What's the current status of this patch?

I kept hitting the panic when bring the interface up and down. I went 
through the neighbour and ipoib_neigh code. I think it's not necessary to 
patch net/core/neighbour. 

The reason we hit this problem is neighbour won't have a pointer to 
ipoib_neigh if path_free() or mcast_free() being called by the time 
neighbour has been freed. (ipoib_neigh always has a pointer to a 
neighbour). 

If neigh_destructor() gets called in this context, in 
ipoib_neigh_destructor() if ipoib_neigh is NULL it does nothing. So 
removing neigh->neighbour->ops->destructor = NULL in kfree(neigh) is 
sufficient to fix this problem. How do you think?

Here is the patch I used for testing.

diff -urN infiniband/ulp/ipoib/ipoib_main.c 
infiniband-patch/ulp/ipoib/ipoib_main.c
--- infiniband/ulp/ipoib/ipoib_main.c   2006-02-01 13:45:43.000000000 
-0800
+++ infiniband-patch/ulp/ipoib/ipoib_main.c     2006-02-16 
11:02:24.902458152 -0800
@@ -247,7 +247,6 @@
                if (neigh->ah)
                        ipoib_put_ah(neigh->ah);
                *to_ipoib_neigh(neigh->neighbour) = NULL;
-               neigh->neighbour->ops->destructor = NULL;
                kfree(neigh);
        }
 
@@ -530,7 +529,6 @@
 err:
        *to_ipoib_neigh(skb->dst->neighbour) = NULL;
        list_del(&neigh->list);
-       neigh->neighbour->ops->destructor = NULL;
        kfree(neigh);
 
        ++priv->stats.tx_dropped;
diff -urN infiniband/ulp/ipoib/ipoib_multicast.c 
infiniband-patch/ulp/ipoib/ipoib_multicast.c
--- infiniband/ulp/ipoib/ipoib_multicast.c      2006-02-16 
11:00:40.379348080 -0800
+++ infiniband-patch/ulp/ipoib/ipoib_multicast.c        2006-02-16 
11:02:33.225192904 -0800
@@ -115,7 +115,6 @@
                if (neigh->ah)
                        ipoib_put_ah(neigh->ah);
                *to_ipoib_neigh(neigh->neighbour) = NULL;
-               neigh->neighbour->ops->destructor = NULL;
                kfree(neigh);
        }
 
Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone(Fax): (503) 578-7638
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20060216/4b1078cb/attachment.html>


More information about the general mailing list