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] bridge: fix hello and hold timers starting/stopping
Date: Sat, 20 May 2017 01:26:35 +0800 [thread overview]
Message-ID: <CADvbK_f5BHSep078a8cTNfYcnZmATnsX9nJDfb2ZTikcVnPZmA@mail.gmail.com> (raw)
In-Reply-To: <20170519162543.31670-1-cera@cera.cz>
On Sat, May 20, 2017 at 12:25 AM, Ivan Vecera <cera@cera.cz> wrote:
[...]
> @@ -197,13 +191,14 @@ 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);
> + } else {
> + /* BR_KERNEL_STP - stop hello and hold timers */
> + del_timer(&br->hello_timer);
> + list_for_each_entry(p, &br->port_list, list)
> + del_timer(&p->hold_timer);
> }
>
> br->stp_enabled = BR_NO_STP;
I have a question here, br->stp_enabled is not atomic, and it is being
changed without holding br->lock here, while it may be checked in
br_hello_timer_expired, is it safe ?
(sorry if I misunderstood or overthought about it)
> --
> 2.13.0
>
prev parent reply other threads:[~2017-05-19 17:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 16:25 [PATCH net] bridge: fix hello and hold timers starting/stopping Ivan Vecera
2017-05-19 16:38 ` Stephen Hemminger
2017-05-19 16:51 ` Xin Long
2017-05-19 16:55 ` Ivan Vecera
2017-05-19 16:55 ` Nikolay Aleksandrov
2017-05-19 17:06 ` Ivan Vecera
2017-05-19 17:26 ` Xin Long [this message]
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_f5BHSep078a8cTNfYcnZmATnsX9nJDfb2ZTikcVnPZmA@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).