bridge: Refactor bridge_reconfigure().
authorEthan Jackson <ethan@nicira.com>
Sat, 21 Apr 2012 02:11:35 +0000 (19:11 -0700)
committerEthan Jackson <ethan@nicira.com>
Mon, 23 Apr 2012 10:17:06 +0000 (03:17 -0700)
commitf9bb81ec3c306f968c668ad87783420377a1753f
treeb5a6e0e0dbd61726376349638a41ba3b497eac29
parent0cbc096648c18dd6c374a0f1eb11f9b3a604e634
bridge: Refactor bridge_reconfigure().

The existing bridge_reconfigure() implementation is suboptimal.
When adding lots of new ports, on every pass through the run loop
it allocates a bunch of "struct iface"s and "struct port"s, only to
destroy them when out of time.  Additionally, when there are errors
adding or deleting ports, it can fail to converge.  Instead it will
attempt and fail to add the same set of ports forever.

This patch rewrites bridge_reconfigure() using a new strategy.
Whenever the database changes, some initial bookkeeping is done,
and a list of future work is compiled.  The bridge begins whittling
down this list, and stops processing database changes until
finished.

Bug #10902.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
vswitchd/bridge.c