diff mbox

bridge: Unbreak netconsole

Message ID 52F67A4B.9000504@acm.org
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Bart Van Assche Feb. 8, 2014, 6:41 p.m. UTC
Sending netconsole messages over a bridge network interface doesn't
work anymore since kernel v3.12. Bisecting this led to the patch
"bridge: cleanup netpoll code". Hence revert that patch (commit
93d8bf9fb8f39d6d3e461db60f883d9f81006159).

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: <stable@vger.kernel.org> # 3.12
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=70071
---
 net/bridge/br_device.c  | 12 ++++++------
 net/bridge/br_if.c      |  3 +--
 net/bridge/br_private.h | 10 ++++++++++
 3 files changed, 17 insertions(+), 8 deletions(-)

Comments

Stephen Hemminger Feb. 9, 2014, 1:05 a.m. UTC | #1
On Sat, 08 Feb 2014 19:41:15 +0100
Bart Van Assche <bvanassche@acm.org> wrote:

> Sending netconsole messages over a bridge network interface doesn't
> work anymore since kernel v3.12. Bisecting this led to the patch
> "bridge: cleanup netpoll code". Hence revert that patch (commit
> 93d8bf9fb8f39d6d3e461db60f883d9f81006159).
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: <stable@vger.kernel.org> # 3.12
> Reference: https://bugzilla.kernel.org/show_bug.cgi?id=70071

Cong already send an alternative fix for this.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Cong Wang Feb. 9, 2014, 2:44 a.m. UTC | #2
On Sat, Feb 8, 2014 at 5:05 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Sat, 08 Feb 2014 19:41:15 +0100
> Bart Van Assche <bvanassche@acm.org> wrote:
>
>> Sending netconsole messages over a bridge network interface doesn't
>> work anymore since kernel v3.12. Bisecting this led to the patch
>> "bridge: cleanup netpoll code". Hence revert that patch (commit
>> 93d8bf9fb8f39d6d3e461db60f883d9f81006159).
>>
>> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>> Cc: Stephen Hemminger <stephen@networkplumber.org>
>> Cc: Jiri Pirko <jiri@resnulli.us>
>> Cc: Neil Horman <nhorman@tuxdriver.com>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: <stable@vger.kernel.org> # 3.12
>> Reference: https://bugzilla.kernel.org/show_bug.cgi?id=70071
>
> Cong already send an alternative fix for this.

And it is already in -net:

commit dbe173079ab58a444e12dbebe96f5aec1e0bed1a
Author: Cong Wang <cwang@twopensource.com>
Date:   Thu Feb 6 15:00:52 2014 -0800

    bridge: fix netconsole setup over bridge
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche Feb. 9, 2014, 8:46 a.m. UTC | #3
On 02/09/14 03:44, Cong Wang wrote:
> On Sat, Feb 8, 2014 at 5:05 PM, Stephen Hemminger
> <stephen@networkplumber.org> wrote:
>> On Sat, 08 Feb 2014 19:41:15 +0100
>> Bart Van Assche <bvanassche@acm.org> wrote:
>>
>>> Sending netconsole messages over a bridge network interface doesn't
>>> work anymore since kernel v3.12. Bisecting this led to the patch
>>> "bridge: cleanup netpoll code". Hence revert that patch (commit
>>> 93d8bf9fb8f39d6d3e461db60f883d9f81006159).
>>>
>>> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>>> Cc: Stephen Hemminger <stephen@networkplumber.org>
>>> Cc: Jiri Pirko <jiri@resnulli.us>
>>> Cc: Neil Horman <nhorman@tuxdriver.com>
>>> Cc: David S. Miller <davem@davemloft.net>
>>> Cc: <stable@vger.kernel.org> # 3.12
>>> Reference: https://bugzilla.kernel.org/show_bug.cgi?id=70071
>>
>> Cong already send an alternative fix for this.
> 
> And it is already in -net:
> 
> commit dbe173079ab58a444e12dbebe96f5aec1e0bed1a
> Author: Cong Wang <cwang@twopensource.com>
> Date:   Thu Feb 6 15:00:52 2014 -0800
> 
>     bridge: fix netconsole setup over bridge

Thanks Cong and Stephen for working on a fix, and sorry that I had not
noticed that a fix was already available before I sent the patch at the
start of this e-mail thread.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index e4401a5..ab69594 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -252,22 +252,22 @@  fail:
 int br_netpoll_enable(struct net_bridge_port *p, gfp_t gfp)
 {
 	struct netpoll *np;
-	int err;
-
-	if (!p->br->dev->npinfo)
-		return 0;
+	int err = 0;
 
 	np = kzalloc(sizeof(*p->np), gfp);
+	err = -ENOMEM;
 	if (!np)
-		return -ENOMEM;
+		goto out;
 
 	err = __netpoll_setup(np, p->dev, gfp);
 	if (err) {
 		kfree(np);
-		return err;
+		goto out;
 	}
 
 	p->np = np;
+
+out:
 	return err;
 }
 
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index cffe1d6..639231a 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -366,8 +366,7 @@  int br_add_if(struct net_bridge *br, struct net_device *dev)
 	if (err)
 		goto err2;
 
-	err = br_netpoll_enable(p, GFP_KERNEL);
-	if (err)
+	if (br_netpoll_info(br) && ((err = br_netpoll_enable(p, GFP_KERNEL))))
 		goto err3;
 
 	err = netdev_master_upper_dev_link(dev, br->dev);
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index fcd1233..52d63bf 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -339,6 +339,11 @@  void br_dev_setup(struct net_device *dev);
 void br_dev_delete(struct net_device *dev, struct list_head *list);
 netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev);
 #ifdef CONFIG_NET_POLL_CONTROLLER
+static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br)
+{
+	return br->dev->npinfo;
+}
+
 static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
 				       struct sk_buff *skb)
 {
@@ -351,6 +356,11 @@  static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
 int br_netpoll_enable(struct net_bridge_port *p, gfp_t gfp);
 void br_netpoll_disable(struct net_bridge_port *p);
 #else
+static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br)
+{
+	return NULL;
+}
+
 static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
 				       struct sk_buff *skb)
 {