mirror of
https://github.com/openvswitch/ovs
synced 2025-10-17 14:28:02 +00:00
ofproto: Add global locking around flow table changes.
This makes 'ofproto_mutex' protect the flow table well enough that threads other than the main one can realistically modify flows. I need to look at the interface between ofproto and connmgr: I think that there might need to be some locking there too. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
@@ -46,12 +46,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Needed only for the lock annotation in struct classifier. */
|
||||
extern struct ovs_mutex ofproto_mutex;
|
||||
|
||||
/* A flow classifier. */
|
||||
struct classifier {
|
||||
int n_rules; /* Total number of rules. */
|
||||
struct hmap tables; /* Contains "struct cls_table"s. */
|
||||
struct list tables_priority; /* Tables in descending priority order */
|
||||
struct ovs_rwlock rwlock;
|
||||
struct ovs_rwlock rwlock OVS_ACQ_AFTER(ofproto_mutex);
|
||||
};
|
||||
|
||||
/* A set of rules that all have the same fields wildcarded. */
|
||||
|
Reference in New Issue
Block a user