ofproto-dpif-xlate: Fix fin_timeout to make rules expirable.
[sliver-openvswitch.git] / ofproto / ofproto-provider.h
index aa262bc..72ba3be 100644 (file)
@@ -65,8 +65,8 @@ struct ofproto {
     struct shash port_by_name;
     unsigned long *ofp_port_ids;/* Bitmap of used OpenFlow port numbers. */
     struct simap ofp_requests;  /* OpenFlow port number requests. */
-    ofp_port_t alloc_port_no;   /* Last allocated OpenFlow port number. */
-    ofp_port_t max_ports;       /* Max possible OpenFlow port num, plus one. */
+    uint16_t alloc_port_no;     /* Last allocated OpenFlow port number. */
+    uint16_t max_ports;         /* Max possible OpenFlow port num, plus one. */
 
     /* Flow tables. */
     struct oftable *tables;
@@ -114,7 +114,7 @@ struct ofproto {
 };
 
 void ofproto_init_tables(struct ofproto *, int n_tables);
-void ofproto_init_max_ports(struct ofproto *, ofp_port_t max_ports);
+void ofproto_init_max_ports(struct ofproto *, uint16_t max_ports);
 
 struct ofproto *ofproto_lookup(const char *name);
 struct ofport *ofproto_get_port(const struct ofproto *, ofp_port_t ofp_port);
@@ -262,6 +262,10 @@ struct rule {
  * ofproto-dpif implementation */
 extern unsigned flow_eviction_threshold;
 
+/* Number of upcall handler threads. Only affects the ofproto-dpif
+ * implementation. */
+extern unsigned n_handler_threads;
+
 /* Determines which model to use for handling misses in the ofproto-dpif
  * implementation */
 extern enum ofproto_flow_miss_model flow_miss_model;
@@ -277,6 +281,9 @@ void ofproto_rule_expire(struct rule *rule, uint8_t reason)
     OVS_RELEASES(rule->evict);
 void ofproto_rule_destroy(struct ofproto *, struct classifier *cls,
                           struct rule *) OVS_REQ_WRLOCK(cls->rwlock);
+void ofproto_rule_reduce_timeouts(struct rule *rule, uint16_t idle_timeout,
+                                  uint16_t hard_timeout)
+    OVS_EXCLUDED(rule->ofproto->expirable_mutex, rule->timeout_mutex);
 
 bool ofproto_rule_has_out_port(const struct rule *, ofp_port_t out_port);