[ovs-git] [openvswitch/ovs] d16154: ofproto-dpif: Use acquire/release barriers with 't...
noreply at github.com
Wed Jan 18 23:41:25 UTC 2017
Author: Jarno Rajahalme <jarno at ovn.org>
Date: 2017-01-18 (Wed, 18 Jan 2017)
ofproto-dpif: Use acquire/release barriers with 'tables_version'.
Use memory_order_release when updating the tables version number to
make sure no memory accesses before the atomic_store (possibly
relating to setting up the new version) are reordered to take place
after the atomic_store, which makes the new version available to other
Correspondingly, use memory_order_acquire when reading the
current tables_version to make sure no later memory accesses (possibly
relating to the current version) are reordered to take place before
the atomic_read to ensure that those memory accesses can not relate to
an older version than returned by the atomic_read.
Suggested-by: Daniele Di Proietto <ddiproietto at vmware.com>
Fixes: 621b8064b7 ("ofproto: Infra for table versioning.")
Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>
More information about the git