From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Cong Wang <cwang@twopensource.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
netdev <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
Stephen Hemminger <stephen@networkplumber.org>,
bridge@lists.linux-foundation.org
Subject: Re: [PATCH 2/3] bridge: trigger a bridge calculation upon port changes
Date: Sat, 15 Mar 2014 02:39:40 +0100 [thread overview]
Message-ID: <20140315013940.GA28801@wotan.suse.de> (raw)
In-Reply-To: <CAHA+R7Pf6rM5h1uGiqrru5LkN9C7Nm7V42cucHSOV1s7_+F7Gw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]
On Thu, Mar 13, 2014 at 11:26:25AM -0700, Cong Wang wrote:
> On Wed, Mar 12, 2014 at 8:15 PM, Luis R. Rodriguez
> <mcgrof@do-not-panic.com> wrote:
> > spin_lock_bh(&p->br->lock);
> > err = br_setport(p, tb);
> > + changed = br_stp_recalculate_bridge_id(p->br);
>
> Looks like you only want to check if the mac addr gets changed here,
Nope, the reason why we want a full thorough check is that br_setport()
may change currently any of these:
* IFLA_BRPORT_MODE
* IFLA_BRPORT_GUARD
* IFLA_BRPORT_FAST_LEAVE
* IFLA_BRPORT_PROTECT
* IFLA_BRPORT_LEARNING,
* IFLA_BRPORT_UNICAST_FLOOD
* IFLA_BRPORT_COST
* IFLA_BRPORT_PRIORITY
* IFLA_BRPORT_STATE
That's good reason to trigger a good inspection. Having the MAC address
change would be simply collateral and its just something we need to do
some additional work for outside of the locking context.
> but br_stp_recalculate_bridge_id() does more than just checking it,
> are you sure the side-effects are all what you want here?
Yeap.
> > spin_unlock_bh(&p->br->lock);
> > + if (changed)
> > + call_netdevice_notifiers(NETDEV_CHANGEADDR,
> > + p->br->dev);
> > + netdev_update_features(p->br->dev);
>
> I think this is supposed to be in netdev event handler of br->dev
> instead of here.
Do you mean netdev_update_features() ? I mimic'd what was being done on
br_del_if() given that root blocking is doing something similar. If
we need to change something for the above then I suppose it means we need
to change br_del_if() too. Let me know if you see any reason for something
else.
Luis
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
next prev parent reply other threads:[~2014-03-15 1:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 3:15 [PATCH 0/3] bridge: few enhancements and small fixes Luis R. Rodriguez
2014-03-13 3:15 ` [PATCH 1/3] bridge: preserve random init MAC address Luis R. Rodriguez
2014-03-19 0:42 ` Toshiaki Makita
2014-03-19 0:50 ` Luis R. Rodriguez
2014-03-19 1:04 ` Toshiaki Makita
2014-03-19 1:10 ` Luis R. Rodriguez
2014-03-19 16:09 ` [Bridge] " Toshiaki Makita
2014-03-19 3:10 ` Stephen Hemminger
2014-03-19 3:37 ` Luis R. Rodriguez
2014-03-20 2:05 ` Luis R. Rodriguez
2014-04-22 19:41 ` Luis R. Rodriguez
2014-04-30 18:40 ` Luis R. Rodriguez
2014-04-30 19:11 ` Vlad Yasevich
2014-03-13 3:15 ` [PATCH 2/3] bridge: trigger a bridge calculation upon port changes Luis R. Rodriguez
2014-03-13 18:26 ` Cong Wang
2014-03-15 1:39 ` Luis R. Rodriguez [this message]
2014-03-18 20:46 ` Cong Wang
2014-03-18 21:22 ` Luis R. Rodriguez
2014-04-22 19:43 ` Luis R. Rodriguez
2014-04-30 18:38 ` Luis R. Rodriguez
2014-04-30 20:04 ` Vlad Yasevich
2014-04-30 22:59 ` Luis R. Rodriguez
2014-05-01 0:12 ` Vlad Yasevich
2014-03-13 3:15 ` [PATCH 3/3] bridge: fix bridge root block on designated port Luis R. Rodriguez
2014-03-13 22:16 ` Stephen Hemminger
2014-03-15 2:08 ` Luis R. Rodriguez
2014-03-18 20:31 ` [PATCH 0/3] bridge: few enhancements and small fixes Luis R. Rodriguez
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=20140315013940.GA28801@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=bridge@lists.linux-foundation.org \
--cc=cwang@twopensource.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@do-not-panic.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=xen-devel@lists.xenproject.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