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:57:19 +0000 (10:57 -0700)
commite3c684fde6db1b7af3f4dc08b08f38519a32af5b
tree65e963adc69da36d1f791b7ea434f5cbbf8450dd
parent228c52e210cbc0aefd522eac61cf2e8af311fdc6
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