Bug#572835: enhancement: start bridge using ifup faster

2010-03-08 Thread Stephen Hemminger
On Sun, 07 Mar 2010 12:04:36 +0600
Mikhail Gusarov dotted...@dottedmag.net wrote:

 
 Twas brillig at 17:17:51 06.03.2010 UTC-08 when shemmin...@vyatta.com did 
 gyre and gimble:
 
   ifup snippet for bridge-utils uses 'sleep 1' in loop in order to wait for 
 bridge.
   This timeout makes 'ifup br0' really slow, 1.2s in my setup.
   Attached patch makes ifup snippet use 'sleep 0.01' if fractional secons 
 are
   implemented in sleep, thus making ifup much faster (0.16s as measured).
   
  SH I don't think this sleep is needed at all.
 
 I tested it - a bit of delay is still necessary. 0.01 is always enough in
 my configuration though, but there may be slower machines. Maybe there
 is a way to wait for bridge instead of polling it existance, but I'm not
 aware of it.
 

I think this is related to forwarding delay. Ideally forwarding delay
should be off unless STP is enabled.

Looks like Ubuntu script reads that value of forwarding delay and adjusts
based on that.

-- 



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#572835: enhancement: start bridge using ifup faster

2010-03-06 Thread Mikhail Gusarov
Package: bridge-utils
Version: 1.4-5
Severity: wishlist


ifup snippet for bridge-utils uses 'sleep 1' in loop in order to wait for 
bridge.
This timeout makes 'ifup br0' really slow, 1.2s in my setup.
Attached patch makes ifup snippet use 'sleep 0.01' if fractional secons are
implemented in sleep, thus making ifup much faster (0.16s as measured).

P.S: never mind the Ubuntu info, that's just the desktop I'm reporting bug from.

-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-9-generic-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bridge-utils depends on:
ii  libc6   2.10.1-0ubuntu16 GNU C Library: Shared libraries

Versions of packages bridge-utils recommends:
ii  ifupdown   0.6.8ubuntu21 high level tools to configure netw

bridge-utils suggests no packages.

-- no debconf information
--- /var/lib/lxc/test/rootfs/usr/share/bridge-utils/ifupdown.sh 2008-08-28 
04:52:20.0 +0700
+++ ifupdown.sh 2010-03-07 03:45:03.650307276 +0600
@@ -213,13 +213,16 @@
   then
 /bin/echo -e \nWaiting for $IFACE to get ready (MAXWAIT is $MAXWAIT 
seconds).
 
+# Use 0.01 delay if available
+sleep 0.01 2/dev/null  COUNT=$(($COUNT * 100))
+
 unset BREADY
 unset TRANSITIONED
 COUNT=0
 
 while [ ! $BREADY -a $COUNT -lt $MAXWAIT ]
 do
-  sleep 1
+  sleep 0.01 2/dev/null || sleep 1
   COUNT=$(($COUNT+1))
   BREADY=true
   for i in $(brctl showstp $IFACE|sed -n 's/^.*port id.*state[ 
\t]*\(.*\)$/\1/p')


Bug#572835: enhancement: start bridge using ifup faster

2010-03-06 Thread Stephen Hemminger
On Sun, 07 Mar 2010 03:50:18 +0600
Mikhail Gusarov dotted...@dottedmag.net wrote:

 Package: bridge-utils
 Version: 1.4-5
 Severity: wishlist
 
 
 ifup snippet for bridge-utils uses 'sleep 1' in loop in order to wait for 
 bridge.
 This timeout makes 'ifup br0' really slow, 1.2s in my setup.
 Attached patch makes ifup snippet use 'sleep 0.01' if fractional secons are
 implemented in sleep, thus making ifup much faster (0.16s as measured).
 
 P.S: never mind the Ubuntu info, that's just the desktop I'm reporting bug 
 from.
 
 -- System Information:
 Debian Release: squeeze/sid
   APT prefers karmic-updates
   APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 
 'karmic')
 Architecture: i386 (i686)
 
 Kernel: Linux 2.6.32-9-generic-pae (SMP w/2 CPU cores)
 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
 Shell: /bin/sh linked to /bin/dash
 
 Versions of packages bridge-utils depends on:
 ii  libc6   2.10.1-0ubuntu16 GNU C Library: Shared libraries
 
 Versions of packages bridge-utils recommends:
 ii  ifupdown   0.6.8ubuntu21 high level tools to configure 
 netw
 
 bridge-utils suggests no packages.
 
 -- no debconf information

I don't think this sleep is needed at all.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#572835: enhancement: start bridge using ifup faster

2010-03-06 Thread Mikhail Gusarov

Twas brillig at 17:17:51 06.03.2010 UTC-08 when shemmin...@vyatta.com did gyre 
and gimble:

  ifup snippet for bridge-utils uses 'sleep 1' in loop in order to wait for 
  bridge.
  This timeout makes 'ifup br0' really slow, 1.2s in my setup.
  Attached patch makes ifup snippet use 'sleep 0.01' if fractional secons are
  implemented in sleep, thus making ifup much faster (0.16s as measured).
  
 SH I don't think this sleep is needed at all.

I tested it - a bit of delay is still necessary. 0.01 is always enough in
my configuration though, but there may be slower machines. Maybe there
is a way to wait for bridge instead of polling it existance, but I'm not
aware of it.

-- 
  http://fossarchy.blogspot.com/


pgp3NaerAKgHV.pgp
Description: PGP signature