All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amerigo Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, WANG Cong <amwang@redhat.com>,
	Neil Horman <nhorman@redhat.com>, Jay Vosburgh <fubar@us.ibm.com>,
	Stephen Hemminger <shemminger@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: [Patch] bridge: call NETDEV_ENSLAVE notifiers when adding a slave
Date: Thu, 19 May 2011 18:24:17 +0800	[thread overview]
Message-ID: <1305800661-4081-1-git-send-email-amwang@redhat.com> (raw)
In-Reply-To: <1305794393-20775-1-git-send-email-amwang@redhat.com>

In the previous patch I added NETDEV_ENSLAVE, now
we can notify netconsole when adding a device to a bridge too.

By the way, s/netdev_bonding_change/call_netdevice_notifiers/ in
bond_main.c, since this is not bonding specific.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Neil Horman <nhorman@redhat.com>

---
 drivers/net/bonding/bond_main.c |    2 +-
 net/bridge/br_if.c              |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b9c70c5..765fdcf 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1640,7 +1640,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 		}
 	}
 
-	netdev_bonding_change(slave_dev, NETDEV_ENSLAVE);
+	call_netdevice_notifiers(NETDEV_ENSLAVE, slave_dev);
 
 	/* If this is the first slave, then we need to set the master's hardware
 	 * address to be the same as the slave's. */
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 5dbdfdf..b44fae5 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -338,6 +338,8 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 	if (IS_ERR(p))
 		return PTR_ERR(p);
 
+	call_netdevice_notifiers(NETDEV_ENSLAVE, dev);
+
 	err = dev_set_promiscuity(dev, 1);
 	if (err)
 		goto put_back;

WARNING: multiple messages have this Message-ID (diff)
From: Amerigo Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Neil Horman <nhorman@redhat.com>,
	bridge@lists.linux-foundation.org, WANG Cong <amwang@redhat.com>,
	netdev@vger.kernel.org, Jay Vosburgh <fubar@us.ibm.com>,
	akpm@linux-foundation.org,
	"David S. Miller" <davem@davemloft.net>
Subject: [Bridge] [Patch] bridge: call NETDEV_ENSLAVE notifiers when adding a slave
Date: Thu, 19 May 2011 18:24:17 +0800	[thread overview]
Message-ID: <1305800661-4081-1-git-send-email-amwang@redhat.com> (raw)
In-Reply-To: <1305794393-20775-1-git-send-email-amwang@redhat.com>

In the previous patch I added NETDEV_ENSLAVE, now
we can notify netconsole when adding a device to a bridge too.

By the way, s/netdev_bonding_change/call_netdevice_notifiers/ in
bond_main.c, since this is not bonding specific.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Neil Horman <nhorman@redhat.com>

---
 drivers/net/bonding/bond_main.c |    2 +-
 net/bridge/br_if.c              |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b9c70c5..765fdcf 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1640,7 +1640,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 		}
 	}
 
-	netdev_bonding_change(slave_dev, NETDEV_ENSLAVE);
+	call_netdevice_notifiers(NETDEV_ENSLAVE, slave_dev);
 
 	/* If this is the first slave, then we need to set the master's hardware
 	 * address to be the same as the slave's. */
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 5dbdfdf..b44fae5 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -338,6 +338,8 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 	if (IS_ERR(p))
 		return PTR_ERR(p);
 
+	call_netdevice_notifiers(NETDEV_ENSLAVE, dev);
+
 	err = dev_set_promiscuity(dev, 1);
 	if (err)
 		goto put_back;

  reply	other threads:[~2011-05-19 10:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 10:00 [Patch net-next-2.6] netpoll: disable netpoll when enslave a device Amerigo Wang
2011-05-18 10:56 ` Neil Horman
2011-05-19  5:13   ` Cong Wang
2011-05-19 11:03     ` Neil Horman
2011-05-19  8:39   ` [V2 Patch " Amerigo Wang
2011-05-19 10:24     ` Amerigo Wang [this message]
2011-05-19 10:24       ` [Bridge] [Patch] bridge: call NETDEV_ENSLAVE notifiers when adding a slave Amerigo Wang
2011-05-19 15:12       ` Stephen Hemminger
2011-05-19 15:12         ` [Bridge] " Stephen Hemminger
2011-05-19 16:04         ` Stephen Hemminger
2011-05-19 16:04           ` Stephen Hemminger
2011-05-20  3:06           ` Cong Wang
2011-05-20  3:06             ` Cong Wang
2011-05-19 11:31     ` [V2 Patch net-next-2.6] netpoll: disable netpoll when enslave a device Andy Gospodarek
2011-05-19 13:25       ` Neil Horman
2011-05-20  3:10         ` Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305800661-4081-1-git-send-email-amwang@redhat.com \
    --to=amwang@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=shemminger@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.