upcall: Defer ukey deletion until after pushing stats.
authorJoe Stringer <joestringer@nicira.com>
Tue, 11 Feb 2014 21:55:33 +0000 (13:55 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 26 Feb 2014 00:11:22 +0000 (16:11 -0800)
commit18b063cdbf3e59c1922ffd34fd03f2dc5b0c6db6
tree74730535b850ee64ca79631dec124cb922940829
parentaf40f5b908d69686beef9ddf16da94e5a79a8742
upcall: Defer ukey deletion until after pushing stats.

It is possible for a datapath to dump the same flow twice, for instance
if the flow is the last in a batch of flows to be dumped, then a new
flow is inserted into the same bucket before the flow dumper fetches
another batch.

In this case, datapath flow stats may be duplicated: The revalidator
records the stats from the first flow, using the ukey to get the stats
delta. The ukey is deleted, then the revalidator reads the second
(duplicate) flow and cannot lookup the ukey for the delta. As such, it
will push the stats as-is.

This patch reduces the likelihood of such stats duplications by
deferring ukey deletion until after stats are pushed for deleted flows.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-upcall.c