X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto-provider.h;h=f081482dc4fea1fda29768f6be74af21c242bbb9;hb=82377f4d4ab6de76318f649190d0301f117b270e;hp=41d106a9781a52de2b836576f192db36e51f8a99;hpb=e3b5693319c461a5909507b9ede57db326c07df2;p=sliver-openvswitch.git diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 41d106a97..f081482dc 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -19,7 +19,6 @@ /* Definitions for use within ofproto. */ -#include "ofproto/ofproto.h" #include "cfm.h" #include "classifier.h" #include "heap.h" @@ -27,6 +26,8 @@ #include "list.h" #include "ofp-errors.h" #include "ofp-util.h" +#include "ofproto/ofproto.h" +#include "ovs-thread.h" #include "shash.h" #include "simap.h" #include "timeval.h" @@ -75,7 +76,9 @@ struct ofproto { /* Optimisation for flow expiry. * These flows should all be present in tables. */ - struct list expirable; /* Expirable 'struct rule"s in all tables. */ + struct ovs_mutex expirable_mutex; + struct list expirable OVS_GUARDED; /* Expirable 'struct rule"s in all + tables. */ /* Meter table. * OpenFlow meters start at 1. To avoid confusion we leave the first @@ -219,11 +222,13 @@ struct rule { long long int created; /* Creation time. */ long long int modified; /* Time of last modification. */ long long int used; /* Last use; time created if never used. */ - uint16_t hard_timeout; /* In seconds from ->modified. */ - uint16_t idle_timeout; /* In seconds from ->used. */ uint8_t table_id; /* Index in ofproto's 'tables' array. */ bool send_flow_removed; /* Send a flow removed message? */ + struct ovs_mutex timeout_mutex; + uint16_t hard_timeout OVS_GUARDED; /* In seconds from ->modified. */ + uint16_t idle_timeout OVS_GUARDED; /* In seconds from ->used. */ + /* Eviction groups. */ bool evictable; /* If false, prevents eviction. */ struct heap_node evg_node; /* In eviction_group's "rules" heap. */ @@ -261,7 +266,8 @@ rule_from_cls_rule(const struct cls_rule *cls_rule) void ofproto_rule_update_used(struct rule *, long long int used); void ofproto_rule_expire(struct rule *, uint8_t reason); -void ofproto_rule_destroy(struct rule *); +void ofproto_rule_destroy(struct ofproto *, struct classifier *cls, + struct rule *) OVS_REQ_WRLOCK(cls->rwlock); bool ofproto_rule_has_out_port(const struct rule *, ofp_port_t out_port);