ofproto: Move 'rule->used' to the provider.
authorJarno Rajahalme <jrajahalme@nicira.com>
Tue, 11 Feb 2014 17:49:30 +0000 (09:49 -0800)
committerJarno Rajahalme <jrajahalme@nicira.com>
Wed, 12 Feb 2014 21:58:47 +0000 (13:58 -0800)
commitdc43709014749ed924d4fcff63055320146cd018
tree7e951053166f2656f625340d4f8272f0865ad2ec
parentb90d6ee54a3dea81da58e6e10640fcd165dfb659
ofproto: Move 'rule->used' to the provider.

Rule's 'used' timestamp is updated at the same time with the other
stats.  So far the 'used' has been updated without proper protection,
which may lead to 'tearing' in 32-bit architectures, resulting in an
incorrect 'used' timestamp.  While in practice this is highly
improbable, it is still better to handle this correctly.

This is resolved by moving the 'used' field to the provider's stats,
so that whatever protection is used for updating packet and byte
counts, can be also used for both reading and writing of the 'used'
timestamp.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif.c
ofproto/ofproto-provider.h
ofproto/ofproto.c