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>
Tue, 25 Feb 2014 23:16:16 +0000 (15:16 -0800)
commitad3415c06d55d7adcee84d05ee59c5e4b90c9096
treeadf75ebfede5517eb3911dbb8db830eb9660068c
parent23a7d252215cd5bcb12d8daf202f7a23dc7d3879
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