[ovs-dev] [PATCH] dpif-linux: Recycle leaked ports.

Ben Pfaff blp at nicira.com
Fri Apr 29 22:34:22 UTC 2011


On Fri, Apr 29, 2011 at 01:19:59PM -0700, Ethan Jackson wrote:
> 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.

It looks basically good, but I think there is a problem in the corner
cases where either an error occurs in the middle of the dump
(unlikely, I know) or the caller invoking the dump disposes of it
before dumping all of the ports (which seems more likely, even though
I think we don't do this in OVS yet).

So I think that dpif_linux_port_dump_next() should record in
dpif_linux_port_state() that nl_dump_next() returned false, and
dpif_linux_port_dump_done() should only add un-dumped ports if that
flag is set and the dump finished without an error.

Thanks,

Ben.



More information about the dev mailing list