]> git.proxmox.com Git - mirror_ovs.git/commitdiff
upcall: Configure datapath max-revalidator through ovs-vsctl.
authorVlad Buslov <vladbu@mellanox.com>
Sun, 21 Jul 2019 08:34:21 +0000 (11:34 +0300)
committerBen Pfaff <blp@ovn.org>
Wed, 21 Aug 2019 22:28:01 +0000 (15:28 -0700)
This patch adds a new configuration option, "max-revalidator" to the
Open_vSwitch "other-config" column. This sets maximum allowed ravalidator
timeout. Actual timeout value is determined at runtime as minimum of
"max-idle" and "max-revalidator".

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-provider.h
ofproto/ofproto.c
ofproto/ofproto.h
vswitchd/bridge.c
vswitchd/vswitch.xml

index 731ee7280029ca4242a28a091932504e638806d1..b3598742b4d175f29452283518f6b83706cb0b0c 100644 (file)
@@ -978,7 +978,8 @@ udpif_revalidator(void *arg)
                           duration);
             }
 
-            poll_timer_wait_until(start_time + MIN(ofproto_max_idle, 500));
+            poll_timer_wait_until(start_time + MIN(ofproto_max_idle,
+                                                   ofproto_max_revalidator));
             seq_wait(udpif->reval_seq, last_reval_seq);
             latch_wait(&udpif->exit_latch);
             latch_wait(&udpif->pause_latch);
index 7907d4bfb4166c4616e3537f7c721327c11e09a7..92b384448f27cdb9a70afdc6ef6890d283141378 100644 (file)
@@ -524,6 +524,10 @@ extern unsigned ofproto_flow_limit;
  * on system load and other factors. This variable is subject to change. */
 extern unsigned ofproto_max_idle;
 
+/* Maximum timeout (in ms) for revalidator timer.
+ * Revalidator timeout is a minimum of max_idle and max_revalidator values. */
+extern unsigned ofproto_max_revalidator;
+
 /* Number of upcall handler and revalidator threads. Only affects the
  * ofproto-dpif implementation. */
 extern size_t n_handlers, n_revalidators;
index 1d6fc00696f8eeb9bdbc94d2a57bd07f937197af..6f1d327ee87dded16fad71a2898ad0e3ac2acd66 100644 (file)
@@ -306,6 +306,7 @@ struct ovs_mutex ofproto_mutex = OVS_MUTEX_INITIALIZER;
 
 unsigned ofproto_flow_limit = OFPROTO_FLOW_LIMIT_DEFAULT;
 unsigned ofproto_max_idle = OFPROTO_MAX_IDLE_DEFAULT;
+unsigned ofproto_max_revalidator = OFPROTO_MAX_REVALIDATOR_DEFAULT;
 
 size_t n_handlers, n_revalidators;
 
@@ -702,6 +703,15 @@ ofproto_set_max_idle(unsigned max_idle)
     ofproto_max_idle = max_idle;
 }
 
+/* Sets the maximum allowed revalidator timeout. */
+void
+ofproto_set_max_revalidator(unsigned max_revalidator)
+{
+    if (max_revalidator >= 100) {
+        ofproto_max_revalidator = max_revalidator;
+    }
+}
+
 /* If forward_bpdu is true, the NORMAL action will forward frames with
  * reserved (e.g. STP) destination Ethernet addresses. if forward_bpdu is false,
  * the NORMAL action will drop these frames. */
index 6e4afffa17e0040a915a996594802e25283022ab..6e17fd317fbca54fe25abb25a6ce258a45fa7576 100644 (file)
@@ -308,6 +308,7 @@ int ofproto_port_dump_done(struct ofproto_port_dump *);
 
 #define OFPROTO_FLOW_LIMIT_DEFAULT 200000
 #define OFPROTO_MAX_IDLE_DEFAULT 10000 /* ms */
+#define OFPROTO_MAX_REVALIDATOR_DEFAULT 500 /* ms */
 
 const char *ofproto_port_open_type(const struct ofproto *,
                                    const char *port_type);
@@ -335,6 +336,7 @@ void ofproto_set_in_band_queue(struct ofproto *, int queue_id);
 void ofproto_set_bundle_idle_timeout(unsigned timeout);
 void ofproto_set_flow_limit(unsigned limit);
 void ofproto_set_max_idle(unsigned max_idle);
+void ofproto_set_max_revalidator(unsigned max_revalidator);
 void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu);
 void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time,
                                   size_t max_entries);
index 2976771aeababe6a1e4480be3262005ad58a5d87..be093af1d821a0f0a76865d8576ccd14980de680 100644 (file)
@@ -601,6 +601,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
                                         OFPROTO_FLOW_LIMIT_DEFAULT));
     ofproto_set_max_idle(smap_get_int(&ovs_cfg->other_config, "max-idle",
                                       OFPROTO_MAX_IDLE_DEFAULT));
+    ofproto_set_max_revalidator(smap_get_int(&ovs_cfg->other_config,
+                                             "max-revalidator",
+                                             OFPROTO_MAX_REVALIDATOR_DEFAULT));
     ofproto_set_vlan_limit(smap_get_int(&ovs_cfg->other_config, "vlan-limit",
                                        LEGACY_MAX_VLAN_HEADERS));
     ofproto_set_bundle_idle_timeout(smap_get_int(&ovs_cfg->other_config,
index 027aee2f523bc65c4044593d2e257fad12d25d71..533823c3d853af7bc93bb8d5f02701bc3c74dfae 100644 (file)
         </p>
     </column>
 
+      <column name="other_config" key="max-revalidator"
+              type='{"type": "integer", "minInteger": 100}'>
+        <p>
+          The maximum time (in ms) that revalidator threads will wait before
+          executing flow revalidation. Note that this is maximum allowed value.
+          Actual timeout used by OVS is minimum of max-idle and max-revalidator
+          values. Tweaking this value is discouraged unless you know exactly
+          what you're doing.
+        </p>
+        <p>
+          The default is 500.
+        </p>
+      </column>
+
       <column name="other_config" key="hw-offload"
               type='{"type": "boolean"}'>
         <p>