netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: Ivan Vecera <cera@cera.cz>
Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	network dev <netdev@vger.kernel.org>,
	bridge@lists.linux-foundation.org, davem <davem@davemloft.net>
Subject: Re: [PATCH net-next v2] bridge: fix hello and hold timers starting/stopping
Date: Sat, 20 May 2017 01:35:26 +0800	[thread overview]
Message-ID: <CADvbK_cYiJC3M3OnL+QOJRE0q70J0-uSPkABdRMhAEhCESna-A@mail.gmail.com> (raw)
In-Reply-To: <20170519173043.10201-1-cera@cera.cz>

On Sat, May 20, 2017 at 1:30 AM, Ivan Vecera <cera@cera.cz> wrote:
> Current bridge code incorrectly handles starting/stopping of hello and
> hold timers during STP enable/disable.
>
> 1. Timers are stopped in br_stp_start() during NO_STP->USER_STP
>    transition. The timers are already stopped in NO_STP state so
>    this is confusing no-op.
>
> 2. During USER_STP->NO_STP transition the timers are started. This
>    does not make sense and is confusion because the timer should not be
>    active in NO_STP state.
>
> Cc: davem@davemloft.net
> Cc: sashok@cumulusnetworks.com
> Cc: stephen@networkplumber.org
> Cc: bridge@lists.linux-foundation.org
> Cc: lucien.xin@gmail.com
> Cc: nikolay@cumulusnetworks.com
> Signed-off-by: Ivan Vecera <cera@cera.cz>
Reviewed-by: Xin Long <lucien.xin@gmail.com>

> ---
>  net/bridge/br_stp_if.c | 11 -----------
>  1 file changed, 11 deletions(-)
>
> diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
> index 08341d2aa9c9..a05027027513 100644
> --- a/net/bridge/br_stp_if.c
> +++ b/net/bridge/br_stp_if.c
> @@ -150,7 +150,6 @@ static int br_stp_call_user(struct net_bridge *br, char *arg)
>
>  static void br_stp_start(struct net_bridge *br)
>  {
> -       struct net_bridge_port *p;
>         int err = -ENOENT;
>
>         if (net_eq(dev_net(br->dev), &init_net))
> @@ -169,11 +168,6 @@ static void br_stp_start(struct net_bridge *br)
>         if (!err) {
>                 br->stp_enabled = BR_USER_STP;
>                 br_debug(br, "userspace STP started\n");
> -
> -               /* Stop hello and hold timers */
> -               del_timer(&br->hello_timer);
> -               list_for_each_entry(p, &br->port_list, list)
> -                       del_timer(&p->hold_timer);
>         } else {
>                 br->stp_enabled = BR_KERNEL_STP;
>                 br_debug(br, "using kernel STP\n");
> @@ -187,7 +181,6 @@ static void br_stp_start(struct net_bridge *br)
>
>  static void br_stp_stop(struct net_bridge *br)
>  {
> -       struct net_bridge_port *p;
>         int err;
>
>         if (br->stp_enabled == BR_USER_STP) {
> @@ -196,10 +189,6 @@ static void br_stp_stop(struct net_bridge *br)
>                         br_err(br, "failed to stop userspace STP (%d)\n", err);
>
>                 /* To start timers on any ports left in blocking */
> -               mod_timer(&br->hello_timer, jiffies + br->hello_time);
> -               list_for_each_entry(p, &br->port_list, list)
> -                       mod_timer(&p->hold_timer,
> -                                 round_jiffies(jiffies + BR_HOLD_TIME));
>                 spin_lock_bh(&br->lock);
>                 br_port_state_selection(br);
>                 spin_unlock_bh(&br->lock);
> --
> 2.13.0
>

  reply	other threads:[~2017-05-19 17:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 17:30 [PATCH net-next v2] bridge: fix hello and hold timers starting/stopping Ivan Vecera
2017-05-19 17:35 ` Xin Long [this message]
2017-05-19 20:12 ` Nikolay Aleksandrov
2017-05-20  5:57 ` Hangbin Liu
2017-05-20  6:55   ` Nikolay Aleksandrov
2017-05-20  7:06   ` Ivan Vecera
2017-05-20  7:47     ` Hangbin Liu
2017-05-22 18:41 ` 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=CADvbK_cYiJC3M3OnL+QOJRE0q70J0-uSPkABdRMhAEhCESna-A@mail.gmail.com \
    --to=lucien.xin@gmail.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=cera@cera.cz \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    /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;
as well as URLs for NNTP newsgroup(s).