From patchwork Sat Mar 18 23:50:27 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Vladislav Odintsov
X-Patchwork-Id: 1758583
Return-Path:
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org
(client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org;
envelope-from=ovs-dev-bounces@openvswitch.org; receiver=)
Authentication-Results: legolas.ozlabs.org;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20210112 header.b=ci8JNGhr;
dkim-atps=neutral
Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4PfHnM1cskz1yWp
for ; Sun, 19 Mar 2023 10:50:47 +1100 (AEDT)
Received: from localhost (localhost [127.0.0.1])
by smtp2.osuosl.org (Postfix) with ESMTP id D9DB0404B5;
Sat, 18 Mar 2023 23:50:44 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D9DB0404B5
Authentication-Results: smtp2.osuosl.org;
dkim=fail reason="signature verification failed" (2048-bit key)
header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112
header.b=ci8JNGhr
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from smtp2.osuosl.org ([127.0.0.1])
by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id a4wRg-4DELAt; Sat, 18 Mar 2023 23:50:43 +0000 (UTC)
Received: from lists.linuxfoundation.org (lf-lists.osuosl.org
[IPv6:2605:bc80:3010:104::8cd3:938])
by smtp2.osuosl.org (Postfix) with ESMTPS id A1702404C4;
Sat, 18 Mar 2023 23:50:42 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A1702404C4
Received: from lf-lists.osuosl.org (localhost [127.0.0.1])
by lists.linuxfoundation.org (Postfix) with ESMTP id B3185C008F;
Sat, 18 Mar 2023 23:50:41 +0000 (UTC)
X-Original-To: dev@openvswitch.org
Delivered-To: ovs-dev@lists.linuxfoundation.org
Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])
by lists.linuxfoundation.org (Postfix) with ESMTP id 6A43DC008D
for ; Sat, 18 Mar 2023 23:50:38 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by smtp1.osuosl.org (Postfix) with ESMTP id 3B99481EAE
for ; Sat, 18 Mar 2023 23:50:38 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3B99481EAE
Authentication-Results: smtp1.osuosl.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com
header.a=rsa-sha256 header.s=20210112 header.b=ci8JNGhr
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from smtp1.osuosl.org ([127.0.0.1])
by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 0Sn3VmCn22Qk for ;
Sat, 18 Mar 2023 23:50:37 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 459C681EAD
Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com
[IPv6:2a00:1450:4864:20::231])
by smtp1.osuosl.org (Postfix) with ESMTPS id 459C681EAD
for ; Sat, 18 Mar 2023 23:50:37 +0000 (UTC)
Received: by mail-lj1-x231.google.com with SMTP id a32so8658150ljr.9
for ; Sat, 18 Mar 2023 16:50:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20210112; t=1679183435;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=PR2SWFuIhpgHqhYbQ3VgnGaGYYz6kijTWbozvz0B8Rw=;
b=ci8JNGhrXu2yCNbR7fs6QD9AyOF35LUxpwQIVgSN51rFXr8KcCRkU2FLtRg22LKOtc
yObeUHyqclK/GMNIV3RkzKtfg2hjLHfidWmJ0ivAcSmIsWfD+C1JGtJ5CsIdjOnhgD/3
slRuKtqVaCuKSzRRnGpZHFuuXDrVZXLsAlugGuDVKN1KAqFyOO18DofieXi0tL5JA39J
fbmA/P2y/Z/NKtpeE+slTJns4YJ/uFdaDIFavEyNh2St8fhc8rlLHpbBSlO57t53TZBu
qtPgyMH0RsvUKOc/HHNh/zwgeNE7gIqvNSAgdodbVOHc/aqqqk9SHZGrTpHaq9J6FhW4
NzJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112; t=1679183435;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=PR2SWFuIhpgHqhYbQ3VgnGaGYYz6kijTWbozvz0B8Rw=;
b=jgT0OXV8fK53IC9CfCx67/jG0xJhrJ33YAz6alIdIX/ShpKBG+A2tcvnGo7r2WCuTO
5q1g9pQI8AN4d6QaThTymR6zgq+OH1NCprtxefM+hSUKlGGgc8o2UleWPqPjccM3tpW5
oMRxldZ1EtvyLm7X3ajtWTf9BybLj2QokQLsoRPinhrr43MdHydtR4Oexy5xJVVqa1xy
E8onUbE8Lh2Wk1iQ5Rc7NnNErKaAKf5lonRlfY55LNqUYx/9tiVHGc/d1HSZvR+F621L
c8qzVf8krv/edYZ5rcxQh7+UGnTqKUIp/v66oyIEXQ+3MMm2axpQijbdeufK99nrBZP2
HvIA==
X-Gm-Message-State: AO0yUKVZ19hBxYEz/+0/G/k1f/jlfGabbKKJeLc7n7LVEsKi9r5W0BNI
JuJA5KdKbQlAMWkzwE1It4sHmuoTFOA=
X-Google-Smtp-Source:
AK7set+ToyN6yd0T9wKTbUtKjagRjQI5p+SFklgN/35cmLmfTXxGZO95KH+k+gwtXF7bMZDBps3EOg==
X-Received: by 2002:a05:651c:b1e:b0:295:9517:b98f with SMTP id
b30-20020a05651c0b1e00b002959517b98fmr2459511ljr.15.1679183434656;
Sat, 18 Mar 2023 16:50:34 -0700 (PDT)
Received: from ip-10-70-112-12.vpc-1e810be1.internal
(c2-178-216-98-9.elastic.cloud.croc.ru. [178.216.98.9])
by smtp.gmail.com with ESMTPSA id
v6-20020a2e9f46000000b0029c13f4d519sm162007ljk.119.2023.03.18.16.50.33
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 18 Mar 2023 16:50:34 -0700 (PDT)
From: Vladislav Odintsov
To: dev@openvswitch.org
Date: Sun, 19 Mar 2023 02:50:27 +0300
Message-Id: <20230318235031.3793301-3-odivlad@gmail.com>
X-Mailer: git-send-email 2.36.1
In-Reply-To: <20230318235031.3793301-1-odivlad@gmail.com>
References: <20230318235031.3793301-1-odivlad@gmail.com>
MIME-Version: 1.0
Cc: Vladislav Odintsov
Subject: [ovs-dev] [PATCH ovn 2/6] ic: add support to configure ovsdb
inactivity probe
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"
IDL to local AZ DBs (OVN_Northbound, OVN_Southbound) should be configured
in NB DB, table NB_Global, column options:ic_probe_interval.
IDL to global DBs (OVN_IC_Northbound, OVN_IC_Southbound) should be
configured in IC NB DB, table IC_NB_Global, column
options:ic_probe_interval.
Signed-off-by: Vladislav Odintsov
---
ic/ovn-ic.c | 28 ++++++++++++++++++++++++++++
ovn-ic-nb.xml | 14 ++++++++++++++
ovn-nb.xml | 13 +++++++++++++
3 files changed, 55 insertions(+)
diff --git a/ic/ovn-ic.c b/ic/ovn-ic.c
index 1d0a062f6..feb100859 100644
--- a/ic/ovn-ic.c
+++ b/ic/ovn-ic.c
@@ -35,6 +35,7 @@
#include "lib/ovn-util.h"
#include "memory.h"
#include "openvswitch/poll-loop.h"
+#include "ovsdb-idl.h"
#include "simap.h"
#include "smap.h"
#include "sset.h"
@@ -1871,6 +1872,31 @@ update_ssl_config(void)
}
}
+static void
+update_idl_probe_interval(struct ovsdb_idl *ovn_sb_idl,
+ struct ovsdb_idl *ovn_nb_idl,
+ struct ovsdb_idl *ovn_icsb_idl,
+ struct ovsdb_idl *ovn_icnb_idl)
+{
+ const struct nbrec_nb_global *nb = nbrec_nb_global_first(ovn_nb_idl);
+ int interval = -1;
+ if (nb) {
+ interval = smap_get_int(&nb->options, "ic_probe_interval", interval);
+ }
+ set_idl_probe_interval(ovn_sb_idl, ovnsb_db, interval);
+ set_idl_probe_interval(ovn_nb_idl, ovnnb_db, interval);
+
+ const struct icnbrec_ic_nb_global *icnb =
+ icnbrec_ic_nb_global_first(ovn_icnb_idl);
+ int ic_interval = -1;
+ if (icnb) {
+ ic_interval = smap_get_int(&icnb->options, "ic_probe_interval",
+ ic_interval);
+ }
+ set_idl_probe_interval(ovn_icsb_idl, ovn_ic_sb_db, ic_interval);
+ set_idl_probe_interval(ovn_icnb_idl, ovn_ic_nb_db, ic_interval);
+}
+
int
main(int argc, char *argv[])
{
@@ -2071,6 +2097,8 @@ main(int argc, char *argv[])
state.paused = false;
while (!exiting) {
update_ssl_config();
+ update_idl_probe_interval(ovnsb_idl_loop.idl, ovnnb_idl_loop.idl,
+ ovnisb_idl_loop.idl, ovninb_idl_loop.idl);
memory_run();
if (memory_should_report()) {
struct simap usage = SIMAP_INITIALIZER(&usage);
diff --git a/ovn-ic-nb.xml b/ovn-ic-nb.xml
index a693611c3..8c53bec3b 100644
--- a/ovn-ic-nb.xml
+++ b/ovn-ic-nb.xml
@@ -47,6 +47,20 @@
This column provides general key/value settings. The supported
options are described individually below.
+
+
+
+ The inactivity probe interval of the connection to the OVN IC
+ Northbound and Southbound databases from ovn-ic
, 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.
+
+
diff --git a/ovn-nb.xml b/ovn-nb.xml
index 73f707aa0..fd32070f2 100644
--- a/ovn-nb.xml
+++ b/ovn-nb.xml
@@ -202,6 +202,19 @@
+
+
+ The inactivity probe interval of the connection to the OVN Northbound
+ and Southbound databases from ovn-ic
, 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.
+
+
+
When used, this configuration value specifies the time, in