diff options
author | Ben Pfaff <blp@nicira.com> | 2013-09-12 20:45:15 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-09-12 20:46:19 -0700 |
commit | 15aaf59932a3fa3d6c6b914a62d1ba8515cedbf8 (patch) | |
tree | 7e26aa44983e998329f2b0f82e2a8d29552df879 /lib/classifier.h | |
parent | 2e31a9b8c9b4b6df61ccb12601c1b226254fb492 (diff) |
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>
Diffstat (limited to 'lib/classifier.h')
-rw-r--r-- | lib/classifier.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/classifier.h b/lib/classifier.h index ead087b9..a795b4a1 100644 --- a/lib/classifier.h +++ b/lib/classifier.h @@ -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. */ |