ofproto: Recycle least recently used ofport.
authorGurucharan Shetty <gshetty@nicira.com>
Wed, 25 Sep 2013 16:40:13 +0000 (09:40 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Thu, 26 Sep 2013 20:40:19 +0000 (13:40 -0700)
commitfdcea8032d8d179759315627c52f81554a780b63
tree38810f2e88255c2d202e88b2c17082a091b68d71
parentd4ee72b4098d06fc1711f9ab33e0be452d17467b
ofproto: Recycle least recently used ofport.

If there is a lot of churn in creation and deletion of
interfaces, we may end up recycling the ofport value of a
recently deleted interface for a newly created interface.
This may result in an old stale openflow rule applying
on the newly created interface.

With this commit, when a new port is added, try and provide
it an ofport value that has not been used during the current
run. If such value does not exist, provide the least
recently used ofport value.

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