From patchwork Wed Mar 4 08:36:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1248872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48XS0W0lRTz9s3x for ; Wed, 4 Mar 2020 19:36:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9EA3A867F0; Wed, 4 Mar 2020 08:36:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3UN-HV6M4DAi; Wed, 4 Mar 2020 08:36:39 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 5E38D86614; Wed, 4 Mar 2020 08:36:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 45E54C089F; Wed, 4 Mar 2020 08:36:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9C087C013E for ; Wed, 4 Mar 2020 08:36:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 96B4D86614 for ; Wed, 4 Mar 2020 08:36:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AyususXjeZlo for ; Wed, 4 Mar 2020 08:36:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7AD02860F1 for ; Wed, 4 Mar 2020 08:36:36 +0000 (UTC) X-Originating-IP: 115.99.44.80 Received: from nummac.local (unknown [115.99.44.80]) (Authenticated sender: numans@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id A33AC1C005D; Wed, 4 Mar 2020 08:36:29 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Wed, 4 Mar 2020 14:06:17 +0530 Message-Id: <20200304083617.481725-1-numans@ovn.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Cc: Girish Moodalbail Subject: [ovs-dev] [PATCH ovn] ovn-northd: Add the option to configure probe interval X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Numan Siddique This patch adds the option 'NB_Global.options:probe_interval' to configure the probe interval for the North and South db connections from ovn-northd. Requested-by: Girish Moodalbail Signed-off-by: Numan Siddique Acked-by: Han Zhou --- northd/ovn-northd.c | 16 ++++++++++++++++ ovn-nb.xml | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 0d43322cf..a3746f7ea 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -92,6 +92,10 @@ static bool controller_event_en; * all locally handled, having just one mac is good enough. */ static char svc_monitor_mac[ETH_ADDR_STRLEN + 1]; +/* Default probe interval for NB and SB DB connections. */ +#define DEFAULT_PROBE_INTERVAL_MSEC 5000 +static int probe_interval = DEFAULT_PROBE_INTERVAL_MSEC; + #define MAX_OVN_TAGS 4096 /* Pipeline stages. */ @@ -10858,6 +10862,14 @@ ovnnb_db_run(struct northd_context *ctx, smap_destroy(&options); } + /* Update the probe interval. */ + probe_interval = smap_get_int(&nb->options, "probe_interval", + DEFAULT_PROBE_INTERVAL_MSEC); + + if (probe_interval > 0 && probe_interval < 1000) { + probe_interval = 1000; + } + controller_event_en = smap_get_bool(&nb->options, "controller_event", false); @@ -11818,6 +11830,10 @@ main(int argc, char *argv[]) poll_immediate_wake(); } + + ovsdb_idl_set_probe_interval(ovnnb_idl_loop.idl, probe_interval); + ovsdb_idl_set_probe_interval(ovnsb_idl_loop.idl, probe_interval); + poll_block(); if (should_service_stop()) { exiting = true; diff --git a/ovn-nb.xml b/ovn-nb.xml index f30cc9ee9..f9b028aa0 100644 --- a/ovn-nb.xml +++ b/ovn-nb.xml @@ -134,6 +134,19 @@ + +

+ The inactivity probe interval of the connection to the OVN Northbound + and Southbound databases, in milliseconds. + If the value is zero, it disables the connection keepalive feature. +

+ +

+ If the value is nonzero, then it will be forced to a value of + at least 1000 ms. +

+
+

These options control how routes are advertised between OVN