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:45:28 +0000 (10:45 -0700)
commit3a208109f5e91b0cfbc387877b81aba743eab5f3
treeb03b9eb77715243847fbaf918b877999b3c1c9af
parent059ef3c65f596f93e56c7062e35977d429faa4ab
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
ofproto/ofproto-dpif-xlate.c