ofproto-dpif-upcall: Simplify revalidator_sweep__().
authorJoe Stringer <joe@ovn.org>
Thu, 7 Jan 2016 19:47:47 +0000 (11:47 -0800)
committerJoe Stringer <joe@ovn.org>
Thu, 7 Jan 2016 23:03:06 +0000 (15:03 -0800)
commitcebfec69420bc838df002c51b560488c81bf33ee
treebf24245ccb8a09f63a90a865650f51e7dc6f28d4
parentc56eba3b7ab04773204881fa48ff86c3753badc6
ofproto-dpif-upcall: Simplify revalidator_sweep__().

Broadly, there are two cases that are handled during revalidator_sweep__:
- Ukeys which had their corresponding datapath flows deleted during the
  most recent dump phase need to be deleted.
- If a flow for a ukey still exists in the datapath, the flow may need
  to be removed or updated. This depends on a variety of factors such as
  whether the datapath is being flushed, whether individual flows were
  recently dumped, and whether those flows are valid for the current
  revalidation generation.

Previously, the logic was written such that the first of these cases
would be handled under the "UKEY_KEEP" case to ensure that
revalidator_sweep__() will not attempt to delete flows that already
exist. In this case, ukey->flow_exists would be false, which would
trigger ukey cleanup.

While correct, this is misleading and difficult to follow. Since commit
83b03fe05e7a ("ofproto-dpif-upcall: Avoid double-delete of ukeys."),
this logic is no longer required to prevent double-deletion of such
flows, so we can now make this codepath more straightforward.

Signed-off-by: Joe Stringer <joe@ovn.org>
Co-authored-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
ofproto/ofproto-dpif-upcall.c