Skip to contentSkip to conversation

bridge: Unbreak netconsole

PATCH In review Bart Van Assche 3 participants 4 messages Feb 8, 2014 – Feb 9, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge: Unbreak netconsole

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).

Cc Stephen Hemminger <[email protected]>
Cc Jiri Pirko <[email protected]>
Cc Neil Horman <[email protected]>
Cc David S. Miller <[email protected]>
Cc <[email protected]> # 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(-)
net/bridge/br_device.c +6 -6
index e4401a5..ab69594 100644
@@ -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;
 }
 
net/bridge/br_if.c +1 -2
index cffe1d6..639231a 100644
@@ -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);
net/bridge/br_private.h +10 -0
index fcd1233..52d63bf 100644
@@ -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)
 {
Signature · 1 line
1.8.4.5
#1 lore raw
Quoted 5 lines · On Sat, 08 Feb 2014 19:41:15 +0100 Bart Van Assche <[email protected]> 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).

Quoted 7 lines
Cc Stephen Hemminger <[email protected]>
Cc Jiri Pirko <[email protected]>
Cc Neil Horman <[email protected]>
Cc David S. Miller <[email protected]>
Cc <[email protected]> # 3.12

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=70071

Cong already send an alternative fix for this.

#2 lore raw
Quoted 16 lines · Stephen Hemminger
Quoted 5 lines · On Sat, 08 Feb 2014 19:41:15 +0100 Bart Van Assche <[email protected]> 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).

Quoted 7 lines
Cc Stephen Hemminger <[email protected]>
Cc Jiri Pirko <[email protected]>
Cc Neil Horman <[email protected]>
Cc David S. Miller <[email protected]>
Cc <[email protected]> # 3.12

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=70071

Quoted 1 line

Cong already send an alternative fix for this.

And it is already in -net:

commit dbe173079ab58a444e12dbebe96f5aec1e0bed1a

Author: Cong Wang <[email protected]>
Date:   Thu Feb 6 15:00:52 2014 -0800

bridge: fix netconsole setup over bridge

#3 lore raw
Quoted 20 lines · Cong Wang
Quoted 16 lines · Stephen Hemminger
Quoted 5 lines · On Sat, 08 Feb 2014 19:41:15 +0100 Bart Van Assche <[email protected]> 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).

Quoted 7 lines
Cc Stephen Hemminger <[email protected]>
Cc Jiri Pirko <[email protected]>
Cc Neil Horman <[email protected]>
Cc David S. Miller <[email protected]>
Cc <[email protected]> # 3.12

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=70071

Quoted 1 line

Cong already send an alternative fix for this.

Quoted 7 lines

And it is already in -net:

commit dbe173079ab58a444e12dbebe96f5aec1e0bed1a

Author: Cong Wang <[email protected]>
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.