[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1360622801.8633.34.camel@dcbw.foobar.com>
Date: Mon, 11 Feb 2013 16:46:41 -0600
From: Dan Williams <dcbw@...hat.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org
Subject: Re: bridge interface initial carrier state
On Mon, 2013-02-11 at 13:59 -0800, Stephen Hemminger wrote:
> On Mon, 11 Feb 2013 14:01:55 -0600
> Dan Williams <dcbw@...hat.com> wrote:
>
> > Hi,
> >
> > I'm wondering if the initial carrier state of 'on' is intentional for a
> > bridge without ports; immediately after adding ports, the carrier is
> > recalculated and depends on the combined state of each port's carrier
> > and STP forwarding state. So a userspace program attempting to decide
> > whether the bridge was usable or not has to look at both (a) how many
> > ports are available and (b) bridge carrier state, instead of just
> > looking at the bridge carrier state.
> >
> > Dan
>
> Perhaps a future enhancement of bridge would be to use operstate flags
> to indicate lower layer down if there are no ports.
While we're at it, it appears that if a bridge port is added when it has
no carrier, nothing directly triggers br_port_state_selection() to
ensure that the bridge's carrier state is correct:
if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) &&
(br->dev->flags & IFF_UP))
br_stp_enable_port(p);
Any reason why we can't run br_port_state_selection() unconditionally
when adding a new port? When removing a port that gets run by
br_stp_disable_port(), which is somewhat asymmetrical.
When adding, we don't necessarily want to enable STP operation on the
port until it's ready, so that hunk above for br_stp_enable_port() is
probably just fine, but we should still probably be recalculating the
bridge's carrier when it gets its first port even if that port isn't yet
usable? Or not?
Dan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists