Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With RCU in Open vSwitch it's very easy to protect objects accessed by a pointer, but sometimes a pointer is not available. One example is the vhost id for DPDK 16.07. Until DPDK 16.04 a pointer was used to access a vhost device with RCU semantics. From DPDK 16.07 an integer id (which is an array index) is used to access a vhost device. Ideally, we want the exact same RCU semantics that we had for the pointer, on the integer (atomicity, memory barriers, behaviour around quiescent states) This commit implements a new type in ovs-rcu: ovsrcu_index. The newly implemented ovsrcu_index_*() functions should be used to access the type. Even though we say "Do not, in general, declare a typedef for a struct, union, or enum.", I think we're not in the "general" case. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Tested-by: Ciara Loftus <ciara.loftus@intel.com> Acked-by: Jarno Rajahalme <jarno@ovn.org>
- Loading branch information