ofproto: Re-use port numbers of ports that were deleted an hour ago.
authorGurucharan Shetty <gshetty@nicira.com>
Mon, 14 Oct 2013 20:36:41 +0000 (13:36 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Wed, 16 Oct 2013 16:54:06 +0000 (09:54 -0700)
commit865b26a4d0793f7789ce61af00843f05a88b0c12
treefacc50493b8a025594f8c238c9904fc1dc3cf6fa
parent3a2742a1fb141b7388d0c8920c0585b2ee79f9bf
ofproto: Re-use port numbers of ports that were deleted an hour ago.

We have a least recently used algorithm for assigning ofport values
to newly created ports. i.e., when we don't have any unused ofport
numbers, we use ofport numbers from the oldest deleted port.
What this means is that after using ~65000 previously unused ofport
numbers, we will have to go through all of the possible ports
to see which one was least recently used. This will eventually
slow down ofport allocation.

With this commit, any port that was deleted more than an hour ago is
considered never to have been used. So it's ofport number becomes
free to be used.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto.c