From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: Xin Long <lucien.xin@gmail.com>, network dev <netdev@vger.kernel.org>
Cc: davem@davemloft.net, cera@cera.cz,
Satish Ashok <sashok@cumulusnetworks.com>,
Stephen Hemminger <stephen@networkplumber.org>,
bridge@lists.linux-foundation.org
Subject: Re: [PATCH net] bridge: start hello_timer when enabling KERNEL_STP in br_stp_start
Date: Fri, 19 May 2017 18:41:26 +0300 [thread overview]
Message-ID: <42f98aed-707c-6f91-8767-ca34004ec730@cumulusnetworks.com> (raw)
In-Reply-To: <6e78bfea3969ca1a937b37e28e796a3047b82615.1495203629.git.lucien.xin@gmail.com>
On 5/19/17 5:20 PM, Xin Long wrote:
> Since commit 76b91c32dd86 ("bridge: stp: when using userspace stp stop
> kernel hello and hold timers"), bridge would not start hello_timer if
> stp_enabled is not KERNEL_STP when br_dev_open.
>
> The problem is even if users set stp_enabled with KERNEL_STP later,
> the timer will still not be started. It causes that KERNEL_STP can
> not really work. Users have to re-ifup the bridge to avoid this.
>
> This patch is to fix it by starting br->hello_timer when enabling
> KERNEL_STP in br_stp_start.
>
> As an improvement, it's also to start hello_timer again only when
> br->stp_enabled is KERNEL_STP in br_hello_timer_expired, there is
> no reason to start the timer again when it's NO_STP.
>
> Fixes: 76b91c32dd86 ("bridge: stp: when using userspace stp stop kernel hello and hold timers")
> Reported-by: Haidong Li <haili@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> net/bridge/br_stp_if.c | 1 +
> net/bridge/br_stp_timer.c | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
> index 08341d2..0db8102 100644
> --- a/net/bridge/br_stp_if.c
> +++ b/net/bridge/br_stp_if.c
> @@ -179,6 +179,7 @@ static void br_stp_start(struct net_bridge *br)
> br_debug(br, "using kernel STP\n");
>
> /* To start timers on any ports left in blocking */
> + mod_timer(&br->hello_timer, jiffies + br->hello_time);
> br_port_state_selection(br);
> }
>
> diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
> index c98b3e5..60b6fe2 100644
> --- a/net/bridge/br_stp_timer.c
> +++ b/net/bridge/br_stp_timer.c
> @@ -40,7 +40,7 @@ static void br_hello_timer_expired(unsigned long arg)
> if (br->dev->flags & IFF_UP) {
> br_config_bpdu_generation(br);
>
> - if (br->stp_enabled != BR_USER_STP)
> + if (br->stp_enabled == BR_KERNEL_STP)
> mod_timer(&br->hello_timer,
> round_jiffies(jiffies + br->hello_time));
> }
>
+CC Bridge maintainers & fixes commit author
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
next prev parent reply other threads:[~2017-05-19 15:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 14:20 [PATCH net] bridge: start hello_timer when enabling KERNEL_STP in br_stp_start Xin Long
2017-05-19 14:45 ` Nikolay Aleksandrov
2017-05-19 14:48 ` Florian Westphal
2017-05-19 15:03 ` Nikolay Aleksandrov
2017-05-19 14:51 ` Ivan Vecera
2017-05-19 14:57 ` Nikolay Aleksandrov
2017-05-19 15:03 ` Ivan Vecera
2017-05-19 15:05 ` Nikolay Aleksandrov
2017-05-19 15:17 ` Ivan Vecera
2017-05-19 15:41 ` Nikolay Aleksandrov [this message]
2017-05-19 16:29 ` Ivan Vecera
2017-05-21 17:34 ` David Miller
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=42f98aed-707c-6f91-8767-ca34004ec730@cumulusnetworks.com \
--to=nikolay@cumulusnetworks.com \
--cc=bridge@lists.linux-foundation.org \
--cc=cera@cera.cz \
--cc=davem@davemloft.net \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sashok@cumulusnetworks.com \
--cc=stephen@networkplumber.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox