dpif-netdev: Make datapath and flow stats atomic.
authorDaniele Di Proietto <diproiettod@vmware.com>
Tue, 7 Apr 2015 19:02:14 +0000 (20:02 +0100)
committerEthan Jackson <ethan@nicira.com>
Thu, 9 Apr 2015 22:00:52 +0000 (15:00 -0700)
commiteb94da30aeb32cb004c85945a593e3e5c96d0b03
tree9c201b65ae682e1e942c8d9a339f3c9d33837bf8
parent60fc3b7ba4c0dccc9799c7cec6cc77c0d19aa17a
dpif-netdev: Make datapath and flow stats atomic.

A read operation from a non atomic shared value (without external
locking) can return incorrect values.  Using the atomic semantics
prevents this from happening.

However:
* No memory barriers are used.  We don't need that kind of consistency
  for statistics (we use relaxed operations).
* The updates are not atomic, just the loads and stores.  This is ok
  because there's a single writer.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
lib/dpif-netdev.c