netflow: Fold netflow_expire() into netflow_flow_clear().
authorAnoob Soman <anoob.soman@citrix.com>
Tue, 20 May 2014 11:40:35 +0000 (12:40 +0100)
committerBen Pfaff <blp@nicira.com>
Mon, 9 Jun 2014 17:58:23 +0000 (10:58 -0700)
commit6d83989b811bbc64632265d4bb8de7fe4a1042ab
treeebdfaebe7cb2453933d5087b04ac6c7270ce963a
parent8fa77b72a667fbc550b5237726e26fbf0421a7aa
netflow: Fold netflow_expire() into netflow_flow_clear().

netflow_flow_clear() asserted that no packets or bytes were included
in the statistics for the flow being cleared.  Before threading Open
vSwitch, this assertion was always true because netflow_expire() was
always called before calling netflow_flow_clear().  Since Open
vSwitch was threaded, however, it was possible that a packet arrived
after netflow_expire() but before netflow_flow_clear(), since each of
these function separately took the netflow mutex.

This commit fixes the problem by merging netflow_expire() into
netflow_flow_clear(), under a single acquisition of the netflow
mutex.

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
[blp@nicira.com modified the patch to remove netflow_expire() and
 rewrote the commit message]
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/netflow.c
ofproto/netflow.h
ofproto/ofproto-dpif-upcall.c