From: "Nicolas de Pesloüan" <nicolas.2p.debian@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Adam Majer <adamm@zombino.com>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
"Pekka Savola (ipv6)" <pekkas@netcore.fi>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
Andy Gospodarek <andy@greyhouse.net>,
Jay Vosburgh <fubar@us.ibm.com>
Subject: Re: [PATCH] bridge: control carrier based on ports online
Date: Mon, 07 Mar 2011 22:51:32 +0100 [thread overview]
Message-ID: <4D755364.1050100@gmail.com> (raw)
In-Reply-To: <20110307134450.652aea32@nehalam>
Le 07/03/2011 22:44, Stephen Hemminger a écrit :
> On Mon, 07 Mar 2011 21:48:16 +0100
> Nicolas de Pesloüan<nicolas.2p.debian@gmail.com> wrote:
>
>> Le 07/03/2011 19:34, Stephen Hemminger a écrit :
[snip]
>>> list_for_each_entry(p,&br->port_list, list) {
>>> - if (p->state != BR_STATE_DISABLED) {
>>> - if (p->port_no == br->root_port) {
>>> - p->config_pending = 0;
>>> - p->topology_change_ack = 0;
>>> - br_make_forwarding(p);
>>> - } else if (br_is_designated_port(p)) {
>>> - del_timer(&p->message_age_timer);
>>> - br_make_forwarding(p);
>>> - } else {
>>> - p->config_pending = 0;
>>> - p->topology_change_ack = 0;
>>> - br_make_blocking(p);
>>> - }
>>> + if (p->state == BR_STATE_DISABLED)
>>> + continue;
>>> +
>>> + if (p->port_no == br->root_port) {
>>> + p->config_pending = 0;
>>> + p->topology_change_ack = 0;
>>> + br_make_forwarding(p);
>>> + } else if (br_is_designated_port(p)) {
>>> + del_timer(&p->message_age_timer);
>>> + br_make_forwarding(p);
>>> + } else {
>>> + p->config_pending = 0;
>>> + p->topology_change_ack = 0;
>>> + br_make_blocking(p);
>>
>> Is the above part really related to the purpose of this patch? It looks like (good) cleanup, but
>> should be in a different patch.
>>
>> Except from this comment,
>>
>> Reviewed-by: Nicolas de Pesloüan<nicolas.2p.debian@free.fr>
>
> The loop is going over the state of ports.
> Since the new code at the end of loop has to check for STATE_FORWARDING
> it is clearer with continue statement. When adding code it is always
> better to clarify the logic in the process rather than making it
> more complex.
Sound's good to me. Thanks for clarifying.
Nicolas.
next prev parent reply other threads:[~2011-03-07 21:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-06 5:18 [PATCH 1/2] Issue NETDEV_CHANGE notification when bridge changes state Adam Majer
2011-03-06 5:20 ` [PATCH 2/2] Retry autoconfiguration on interface after NETDEV_CHANGE notification Adam Majer
2011-03-06 5:31 ` [PATCH 1/2] Issue NETDEV_CHANGE notification when bridge changes state Adam Majer
2011-03-06 6:43 ` Stephen Hemminger
2011-03-06 8:03 ` Adam Majer
2011-03-06 17:45 ` Stephen Hemminger
2011-03-07 0:25 ` Adam Majer
2011-03-07 6:41 ` Stephen Hemminger
2011-03-07 7:44 ` Nicolas de Pesloüan
2011-03-07 18:34 ` [PATCH] bridge: control carrier based on ports online Stephen Hemminger
2011-03-07 20:48 ` Nicolas de Pesloüan
2011-03-07 21:44 ` Stephen Hemminger
2011-03-07 21:51 ` Nicolas de Pesloüan [this message]
2011-03-08 1:08 ` Adam Majer
2011-03-14 21:29 ` David Miller
2011-03-06 18:01 ` [PATCH 1/2] Issue NETDEV_CHANGE notification when bridge changes state Jan Ceuleers
2011-03-09 15:09 ` Américo Wang
2011-03-09 16:44 ` Adam Majer
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=4D755364.1050100@gmail.com \
--to=nicolas.2p.debian@gmail.com \
--cc=adamm@zombino.com \
--cc=andy@greyhouse.net \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=pekkas@netcore.fi \
--cc=shemminger@vyatta.com \
--cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).