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:07:59 +0000 (03:07 -0700)
commitbae7208e91a08e355d24eb6173170f12dd458776
tree2ef681bba0c0c229ac7f2e211e359e65aced1b8a
parentf5787280d41df592a62fe10c42a61c60f077388c
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