bridge: Eliminate unnecessary forward delay
authorStephen Hemminger <shemminger@vyatta.com>
Wed, 6 Aug 2008 01:42:51 +0000 (18:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Aug 2008 01:42:51 +0000 (18:42 -0700)
commitef647f1300d69adb8223d970554d59d7e244db6d
tree627503820872ec530049ad0bcfd16d09c9008b3f
parent33e334950abda8e42c3b6e6f280fad0d4ab92141
bridge: Eliminate unnecessary forward delay

From: Stephen Hemminger <shemminger@vyatta.com>

Based upon original patch by Herbert Xu, which contained
the following problem description:

--------------------
When the forward delay is set to zero, we still delay the setting
of the forwarding state by one or possibly two timers depending
on whether STP is enabled.  This could either turn out to be
instantaneous, or horribly slow depending on the load of the
machine.

As there is nothing preventing us from enabling forwarding straight
away, this patch eliminates this potential delay by executing the
code directly if the forward delay is zero.

The effect of this problem is that immediately after the carrier
comes on a port, the bridge will drop all packets received from
that port until it enters forwarding mode, thus causing unnecessary
packet loss.

Note that this patch doesn't fully remove the delay due to the
link watcher.  We should also check the carrier state when we
are about to drop an incoming packet because the port is disabled.
But that's for another patch.
--------------------

This version of the fix takes a different approach, in that
it just does the state change directly.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_stp.c