From patchwork Sun Jul 21 08:34:21 2019
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Roi Dayan
X-Patchwork-Id: 1134516
Return-Path:
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org;
spf=pass (mailfrom) smtp.mailfrom=openvswitch.org
(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;
envelope-from=ovs-dev-bounces@openvswitch.org;
receiver=)
Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none)
header.from=mellanox.com
Received: from mail.linuxfoundation.org (mail.linuxfoundation.org
[140.211.169.12])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
bits)) (No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 45ryks0960z9s00
for ;
Sun, 21 Jul 2019 18:36:21 +1000 (AEST)
Received: from mail.linux-foundation.org (localhost [127.0.0.1])
by mail.linuxfoundation.org (Postfix) with ESMTP id 120F3B7D;
Sun, 21 Jul 2019 08:35:07 +0000 (UTC)
X-Original-To: dev@openvswitch.org
Delivered-To: ovs-dev@mail.linuxfoundation.org
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
[172.17.192.35])
by mail.linuxfoundation.org (Postfix) with ESMTPS id E366DB79
for ; Sun, 21 Jul 2019 08:35:03 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
by smtp1.linuxfoundation.org (Postfix) with ESMTP id BA638E6
for ; Sun, 21 Jul 2019 08:34:53 +0000 (UTC)
Received: from Internal Mail-Server by MTLPINE2 (envelope-from
roid@mellanox.com)
with ESMTPS (AES256-SHA encrypted); 21 Jul 2019 11:34:47 +0300
Received: from r-vnc05.mtr.labs.mlnx (r-vnc05.mtr.labs.mlnx [10.208.0.115])
by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6L8YlS1015331;
Sun, 21 Jul 2019 11:34:47 +0300
From: Roi Dayan
To: dev@openvswitch.org
Date: Sun, 21 Jul 2019 11:34:21 +0300
Message-Id: <1563698063-28256-2-git-send-email-roid@mellanox.com>
X-Mailer: git-send-email 2.7.0
In-Reply-To: <1563698063-28256-1-git-send-email-roid@mellanox.com>
References: <1563698063-28256-1-git-send-email-roid@mellanox.com>
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE,
UNPARSEABLE_RELAY autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
smtp1.linux-foundation.org
Cc: Simon Horman ,
Vlad Buslov
Subject: [ovs-dev] [PATCH 1/3] upcall: Configure datapath max-revalidator
through ovs-vsctl.
X-BeenThere: ovs-dev@openvswitch.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
MIME-Version: 1.0
Sender: ovs-dev-bounces@openvswitch.org
Errors-To: ovs-dev-bounces@openvswitch.org
From: Vlad Buslov
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
Acked-by: Roi Dayan
---
ofproto/ofproto-dpif-upcall.c | 3 ++-
ofproto/ofproto-provider.h | 4 ++++
ofproto/ofproto.c | 10 ++++++++++
ofproto/ofproto.h | 2 ++
vswitchd/bridge.c | 3 +++
vswitchd/vswitch.xml | 14 ++++++++++++++
6 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 731ee7280029..b3598742b4d1 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -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);
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index 7907d4bfb416..92b384448f27 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -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;
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 1d6fc00696f8..6f1d327ee87d 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -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. */
diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
index 6e4afffa17e0..6e17fd317fbc 100644
--- a/ofproto/ofproto.h
+++ b/ofproto/ofproto.h
@@ -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);
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 2976771aeaba..be093af1d821 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -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,
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 027aee2f523b..533823c3d853 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -190,6 +190,20 @@
+
+
+ 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.
+
+
+ The default is 500.
+
+
+