dpif-linux: Recycle leaked ports.
authorEthan Jackson <ethan@nicira.com>
Fri, 29 Apr 2011 20:12:19 +0000 (13:12 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 23 May 2011 16:18:31 +0000 (09:18 -0700)
commit1d226b37ecfb1c1e35787e313abd545a59e22011
tree3b1131fc45408633e139180a2b8ae14c2ed450cd
parentcfcb9ff417600836d50c8aca29915381165451c2
dpif-linux: Recycle leaked ports.

When ports are deleted from the datapath they need to be added to
an LRU list maintained in dpif-linux so they may be reallocated.
When using vswitchd to delete the ports this happens automatically.
However, if a port is deleted directly from the datapath it is
never reclaimed by dpif-linux.  If this happens often, eventually
no ports will be available for allocation and dpif-linux will fall
back to using the old, kernel implemented, allocation strategy.

This commit fixes the problem by automatically reclaiming ports
missing from the datapath whenever the list of ports in the
datapath is dumped.

Bug #2140.
lib/dpif-linux.c