]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - kernel/patches/linux-3.1-bridge-push-blocking-slaves-to-forwarding-when-turning-stp-off.patch.off
Merge remote-tracking branch 'ms/powertop'
[people/amarx/ipfire-3.x.git] / kernel / patches / linux-3.1-bridge-push-blocking-slaves-to-forwarding-when-turning-stp-off.patch.off
1 From vitas@nppfactor.kiev.ua Tue Dec 13 10:36:46 2011
2 Return-Path: <vitas@nppfactor.kiev.ua>
3 Delivered-To: <ms@ipfire.org>
4 Received: from mail01.ipfire.org by hedwig.ipfire.org (Dovecot) with LMTP
5 id JdGONK4c504YFwAAVNLeVg for <ms@ipfire.org>; Tue, 13 Dec 2011 10:36:46
6 +0100
7 Received: from mx3.cyfra.ua (mx3.cyfra.ua [62.80.160.182]) by
8 mail01.ipfire.org (Postfix) with ESMTPS id B6735115 for
9 <michael.tremer@ipfire.org>; Tue, 13 Dec 2011 10:36:35 +0100 (CET)
10 Received: from c.1.173.a246.dynamic.cyfra.net ([62.80.173.1]
11 helo=nppfactor.kiev.ua) by mx3.cyfra.ua with esmtp (Exim 4.63)
12 (envelope-from <vitas@nppfactor.kiev.ua>) id 1RaOmo-0005Hq-Jy; Tue, 13 Dec
13 2011 11:36:34 +0200
14 Received: from [192.168.0.20] (LUX [192.168.0.20]) by nppfactor.kiev.ua
15 (Postfix) with ESMTP id 0F9BA22F128; Tue, 13 Dec 2011 11:36:26 +0200 (EET)
16 From: Vitalii Demianets <vitas@nppfactor.kiev.ua>
17 Organization: Factor-SPE
18 To: netdev@vger.kernel.org
19 Subject: [PATCH] bridge: push blocking slaves to forwarding when turning
20 stp off
21 Date: Tue, 13 Dec 2011 11:36:25 +0200
22 User-Agent: KMail/1.9.10
23 Cc: bridge@lists.linux-foundation.org, Stephen Hemminger
24 <shemminger@vyatta.com>, Michael Tremer <michael.tremer@ipfire.org>
25 MIME-Version: 1.0
26 Content-Type: text/plain; charset="us-ascii"
27 Content-Disposition: inline
28 Message-Id: <201112131136.25919.vitas@nppfactor.kiev.ua>
29 X-Evolution-Source: 1292431680.19116.5@rice-oxley.tremer.info
30 Content-Transfer-Encoding: 8bit
31
32 If there is a slave in blocking state when stp is turned off, that slave will
33 remain in blocking state for indefinitely long time until interface state
34 changed. We should push all blocking slaves into forwarding state after
35 turning stp off.
36
37 Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
38
39 ---
40 net/bridge/br_stp.c | 5 ++++-
41 net/bridge/br_stp_if.c | 10 +++++-----
42 2 files changed, 9 insertions(+), 6 deletions(-)
43
44 diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
45 index dd147d7..aed7e21 100644
46 --- a/net/bridge/br_stp.c
47 +++ b/net/bridge/br_stp.c
48 @@ -415,7 +415,10 @@ void br_port_state_selection(struct net_bridge *br)
49 } else {
50 p->config_pending = 0;
51 p->topology_change_ack = 0;
52 - br_make_blocking(p);
53 + if(br->stp_enabled == BR_NO_STP)
54 + br_make_forwarding(p);
55 + else
56 + br_make_blocking(p);
57 }
58 }
59
60 diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
61 index 19308e3..38d8dd7 100644
62 --- a/net/bridge/br_stp_if.c
63 +++ b/net/bridge/br_stp_if.c
64 @@ -153,14 +153,14 @@ static void br_stp_stop(struct net_bridge *br)
65 if (br->stp_enabled == BR_USER_STP) {
66 r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
67 br_info(br, "userspace STP stopped, return code %d\n", r);
68 -
69 - /* To start timers on any ports left in blocking */
70 - spin_lock_bh(&br->lock);
71 - br_port_state_selection(br);
72 - spin_unlock_bh(&br->lock);
73 }
74
75 br->stp_enabled = BR_NO_STP;
76 +
77 + /* To push in forwarding state any ports left in blocking */
78 + spin_lock_bh(&br->lock);
79 + br_port_state_selection(br);
80 + spin_unlock_bh(&br->lock);
81 }
82
83 void br_stp_set_enabled(struct net_bridge *br, unsigned long val)
84 --
85 1.7.3.4
86