[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46C9B6AF.5030402@voltaire.com>
Date: Mon, 20 Aug 2007 18:43:43 +0300
From: Moni Shoua <monis@...taire.com>
To: rdreier@...co.com, davem@...emloft.net, fubar@...ibm.com
CC: netdev@...r.kernel.org, general@...ts.openfabrics.org
Subject: [PATCH V4 2/10] IB/ipoib: Notify the world before doing unregister
When the bonding device enslaves IPoIB devices it takes pointers to
functions in the ib_ipoib module. This is fine as long as the ib_ipoib
nodule remains loaded while the references to its functions exist.
So, to help bonding do a cleanup on time, when the IPoIB net device is a
slave of a bonding master, let the master know that the IPoIB device is
about to unregister (but before calling unregister).
Signed-off-by: Moni Shoua <monis@...taire.com>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 15 +++++++++++++++
1 files changed, 15 insertions(+)
Index: net-2.6/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- net-2.6.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c 2007-08-20 14:29:29.522209580 +0300
+++ net-2.6/drivers/infiniband/ulp/ipoib/ipoib_main.c 2007-08-20 14:43:03.432162133 +0300
@@ -48,6 +48,7 @@
#include <linux/in.h>
#include <net/dst.h>
+#include <linux/netdevice.h>
MODULE_AUTHOR("Roland Dreier");
MODULE_DESCRIPTION("IP-over-InfiniBand net driver");
@@ -772,6 +773,18 @@ static void ipoib_timeout(struct net_dev
/* XXX reset QP, etc. */
}
+static int ipoib_slave_detach(struct net_device *dev)
+{
+ int ret = 0;
+ if (dev->flags & IFF_SLAVE) {
+ dev->priv_flags |= IFF_SLAVE_DETACH;
+ rtnl_lock();
+ ret = call_netdevice_notifiers(NETDEV_CHANGE, dev);
+ rtnl_unlock();
+ }
+ return ret;
+}
+
static int ipoib_hard_header(struct sk_buff *skb,
struct net_device *dev,
unsigned short type,
@@ -921,6 +934,7 @@ void ipoib_dev_cleanup(struct net_device
/* Delete any child interfaces first */
list_for_each_entry_safe(cpriv, tcpriv, &priv->child_intfs, list) {
+ ipoib_slave_detach(cpriv->dev);
unregister_netdev(cpriv->dev);
ipoib_dev_cleanup(cpriv->dev);
free_netdev(cpriv->dev);
@@ -1208,6 +1222,7 @@ static void ipoib_remove_one(struct ib_d
ib_unregister_event_handler(&priv->event_handler);
flush_scheduled_work();
+ ipoib_slave_detach(priv->dev);
unregister_netdev(priv->dev);
ipoib_dev_cleanup(priv->dev);
free_netdev(priv->dev);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists