diff options
author | Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> | 2007-03-24 15:52:16 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-03-25 21:48:01 -0400 |
commit | ecbb416939da77c0d107409976499724baddce7b (patch) | |
tree | 313f786f9f4d5fec3f016c292dea1705924fa9b6 /drivers/infiniband | |
parent | e1701c68c1d1aeb3213d7016593ea9a1d4309417 (diff) |
[NET]: Fix neighbour destructor handling.
->neigh_destructor() is killed (not used), replaced with
->neigh_cleanup(), which is called when neighbor entry goes to dead
state. At this point everything is still valid: neigh->dev,
neigh->parms etc.
The device should guarantee that dead neighbor entries (neigh->dead !=
0) do not get private part initialized, otherwise nobody will cleanup
it.
I think this is enough for ipoib which is the only user of this thing.
Initialization private part of neighbor entries happens in ipib
start_xmit routine, which is not reached when device is down. But it
would be better to add explicit test for neigh->dead in any case.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 0741c6d1337c..f2a40ae8e7d0 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -814,7 +814,7 @@ static void ipoib_set_mcast_list(struct net_device *dev) | |||
814 | queue_work(ipoib_workqueue, &priv->restart_task); | 814 | queue_work(ipoib_workqueue, &priv->restart_task); |
815 | } | 815 | } |
816 | 816 | ||
817 | static void ipoib_neigh_destructor(struct neighbour *n) | 817 | static void ipoib_neigh_cleanup(struct neighbour *n) |
818 | { | 818 | { |
819 | struct ipoib_neigh *neigh; | 819 | struct ipoib_neigh *neigh; |
820 | struct ipoib_dev_priv *priv = netdev_priv(n->dev); | 820 | struct ipoib_dev_priv *priv = netdev_priv(n->dev); |
@@ -822,7 +822,7 @@ static void ipoib_neigh_destructor(struct neighbour *n) | |||
822 | struct ipoib_ah *ah = NULL; | 822 | struct ipoib_ah *ah = NULL; |
823 | 823 | ||
824 | ipoib_dbg(priv, | 824 | ipoib_dbg(priv, |
825 | "neigh_destructor for %06x " IPOIB_GID_FMT "\n", | 825 | "neigh_cleanup for %06x " IPOIB_GID_FMT "\n", |
826 | IPOIB_QPN(n->ha), | 826 | IPOIB_QPN(n->ha), |
827 | IPOIB_GID_RAW_ARG(n->ha + 4)); | 827 | IPOIB_GID_RAW_ARG(n->ha + 4)); |
828 | 828 | ||
@@ -874,7 +874,7 @@ void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh) | |||
874 | 874 | ||
875 | static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms) | 875 | static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms) |
876 | { | 876 | { |
877 | parms->neigh_destructor = ipoib_neigh_destructor; | 877 | parms->neigh_cleanup = ipoib_neigh_cleanup; |
878 | 878 | ||
879 | return 0; | 879 | return 0; |
880 | } | 880 | } |