Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: shemminger@vyatta.com, netdev@vger.kernel.org
Subject: Re: bridge: Eliminate unnecessary forward delay
Date: Tue, 05 Aug 2008 01:40:06 -0700 (PDT)	[thread overview]
Message-ID: <20080805.014006.00973775.davem@davemloft.net> (raw)
In-Reply-To: <20080805021240.GA18159@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 5 Aug 2008 10:12:40 +0800

> On Mon, Aug 04, 2008 at 10:35:34AM -0700, Stephen Hemminger wrote:
> >
> > Same again, this time compile tested...
> > 
> > --- a/net/bridge/br_stp.c	2008-08-04 10:20:21.000000000 -0700
> > +++ b/net/bridge/br_stp.c	2008-08-04 10:29:26.000000000 -0700
> > @@ -368,14 +368,25 @@ static void br_make_blocking(struct net_
> >  /* called under bridge lock */
> >  static void br_make_forwarding(struct net_bridge_port *p)
> >  {
> > -	if (p->state == BR_STATE_BLOCKING) {
> 
> Is it safe to remove this check, especially if the forward delay
> is non-zero?

He's not deleting it as far as I can tell.

The old code is:

	if (p->state == BR_STATE_BLOCKING) {
		if (p->br->stp_enabled == BR_KERNEL_STP)
			p->state = BR_STATE_LISTENING;
		else
			p->state = BR_STATE_LEARNING;

		br_log_state(p);
		mod_timer(&p->forward_delay_timer, jiffies + p->br->forward_delay);
	}

and the new code is:

	struct net_bridge *br = p->br;
 
	if (p->state != BR_STATE_BLOCKING)
		return;

	if (br->forward_delay == 0) {
		p->state = BR_STATE_FORWARDING;
		br_topology_change_detection(br);
		del_timer(&p->forward_delay_timer);
	}
	else if (p->br->stp_enabled == BR_KERNEL_STP)
		p->state = BR_STATE_LISTENING;
	else
		p->state = BR_STATE_LEARNING;

	br_log_state(p);

	if (br->forward_delay != 0)
		mod_timer(&p->forward_delay_timer, jiffies + br->forward_delay);

So when p->state is not BR_STATE_BLOCKING, both before and after this
patch, the function does nothing.

Are your concerns still present?  I'd like to apply this, so let me know.

  reply	other threads:[~2008-08-05  8:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 17:04 bridge: Eliminate unnecessary forward delay Herbert Xu
2008-08-04 17:27 ` Stephen Hemminger
2008-08-04 17:32   ` Herbert Xu
2008-08-04 17:35 ` Stephen Hemminger
2008-08-05  2:12   ` Herbert Xu
2008-08-05  8:40     ` David Miller [this message]
2008-08-05  8:55       ` Herbert Xu

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=20080805.014006.00973775.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.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