bridge: Refactor the 'Instant' stats logic.
authorAlex Wang <alexw@nicira.com>
Thu, 3 Apr 2014 20:12:35 +0000 (13:12 -0700)
committerAlex Wang <alexw@nicira.com>
Mon, 28 Apr 2014 04:21:51 +0000 (21:21 -0700)
commit6a5f9a8fbdfa85795101b46ee1047dfd2b1007c6
tree02104d2ffc3a55c29776b5d6f15bb8aca2107418
parentcfc50ae514f805dcd9c14589f21158185424daf6
bridge: Refactor the 'Instant' stats logic.

This commit refactors the 'Instant' stats related logic in bridge.c
by moving it into bridge_run().

This change brings the following effects:

1. bridge.c will wait on the global connectivity sequence number when
   there is no pending instant stats transaction.  and the main thread
   will no longer be waken up every 100 ms for 'Instant' stats check.
   the related overhead is eliminated.

2. the netdev's sequence number is used to avoid updating unchanged netdev
   status.  so, the update is more efficient.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
vswitchd/bridge.c