From patchwork Sat Mar 18 23:50:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1758584 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=140.211.166.137; helo=smtp4.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=KORRiqdC; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4PfHnQ3jtyz1yWp for ; Sun, 19 Mar 2023 10:50:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C6B5F415FC; Sat, 18 Mar 2023 23:50:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C6B5F415FC Authentication-Results: smtp4.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=KORRiqdC X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BsoNvJ11o4kN; Sat, 18 Mar 2023 23:50:45 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 176CC415EB; Sat, 18 Mar 2023 23:50:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 176CC415EB Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 62F05C0093; Sat, 18 Mar 2023 23:50:42 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4D8B2C008D for ; Sat, 18 Mar 2023 23:50:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2952A60E5D for ; Sat, 18 Mar 2023 23:50:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2952A60E5D Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KORRiqdC X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mO6-empp4UMd for ; Sat, 18 Mar 2023 23:50:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 399CA60ADD Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by smtp3.osuosl.org (Postfix) with ESMTPS id 399CA60ADD for ; Sat, 18 Mar 2023 23:50:38 +0000 (UTC) Received: by mail-lj1-x22d.google.com with SMTP id y14so8667600ljq.4 for ; Sat, 18 Mar 2023 16:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679183436; 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=6lpJ5HABEiwrQQH1W6A2nBORmt5bXuaG8VhyiPBcC64=; b=KORRiqdCTETf63cW7a645LhlpgmdOqwCQqHR/ZYjy5NkXLAs9Efo+8CpDF3ePw7WLt LriXlvtad9GEgM7847yZ/RLmwi4/hWK+cPWJSHv/j1u6wTLnXDn7sdZpCCkSU9x8O3IB MFdl41qWGXEgUqba7g+j4S6V68F4zXu3Nn/jhEbfehK6YisPJi5V0INaK7rRNPhm9F42 m7Gf3VhYLTf0Il0mQsw4NMBkJYSKoHzbBDI33i2l887w9N5uA0dwzeEEhUEm6f3y8aqd Rd3npUDcwEOaMsYkrzZs0B0GE2JZJocs/dekgl0LDR2qQYSN4VClSlcgON9PXxZ+yE1a pzig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679183436; 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=6lpJ5HABEiwrQQH1W6A2nBORmt5bXuaG8VhyiPBcC64=; b=cMDE2cR95guOwQlwnmfYjRm/xpn5eFj46C43zTu1nSABTtG51YohCQkafuSZ/sCD3u R5WFiYfBopCiYGX0KTXzrwjWVR9iPYDCRRmFphXau2m/9lAR+5Ngjq2XvTDdjOVmwUJw WcSmCQw0uztp5JZmQbquqBe6x1O2WpeK9lKS1IzjvVpiM0y23+V92vWMFyRpXQuw3wiL +lNlKpumcKgVQMWtUFq1AHBXwIkVsH3pw8HO5bzGrWSfYBHFF0dnrqEH3Ahi+qqyYO/R vDU8TwaR+VbmKOG3VBVuZmvywn3gmSVP4c5UprGlzcpXJbHC6wtDXEXJUiF0gCSyGdj1 /UDQ== X-Gm-Message-State: AO0yUKU1JPfTDVuxw1diUBAiOsb+Wq9u1307xu/BW1RLz8zHQTH60r8+ BR3UNEOQ6dQvq8TAQBHjC/HE70xw9Y0= X-Google-Smtp-Source: AK7set8itqgzbtQFYqM738yxjpzkLPH252bgpOJjAdUkvSKfGGNOBDq2IMsvUqMIWciC2GRoW9m82Q== X-Received: by 2002:a2e:b819:0:b0:295:a932:8e40 with SMTP id u25-20020a2eb819000000b00295a9328e40mr4125095ljo.17.1679183435543; Sat, 18 Mar 2023 16:50:35 -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.34 (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:28 +0300 Message-Id: <20230318235031.3793301-4-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 3/6] controller-vtep: add support to configure inactivity 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" This patch adds new configuration option for ovn-controller-vtep service to supply OVSDB (only OVN_Southbound DB) probe interval value. It can be configured through Hardware_Vtep database, Global table, column other_config:ovn-remote-probe-interval. Signed-off-by: Vladislav Odintsov --- controller-vtep/ovn-controller-vtep.8.xml | 14 ++++++++++++++ controller-vtep/ovn-controller-vtep.c | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/controller-vtep/ovn-controller-vtep.8.xml b/controller-vtep/ovn-controller-vtep.8.xml index 0b9987bdb..89acae7ed 100644 --- a/controller-vtep/ovn-controller-vtep.8.xml +++ b/controller-vtep/ovn-controller-vtep.8.xml @@ -96,6 +96,20 @@ connected hardware_vtep database changes. The default value is considered false if this option is not defined. + +
other_config:ovn-remote-probe-interval
+
+

+ The inactivity probe interval of the connection to the OVN Southbound + database, 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/controller-vtep/ovn-controller-vtep.c b/controller-vtep/ovn-controller-vtep.c index 26f8fd115..8023bb869 100644 --- a/controller-vtep/ovn-controller-vtep.c +++ b/controller-vtep/ovn-controller-vtep.c @@ -31,6 +31,7 @@ #include "openvswitch/poll-loop.h" #include "simap.h" #include "ovsdb-idl.h" +#include "smap.h" #include "stream.h" #include "stream-ssl.h" #include "unixctl.h" @@ -88,6 +89,20 @@ check_northd_version(struct ovsdb_idl *vtep_idl, struct ovsdb_idl *ovnsb_idl, return true; } +/* Set probe interval, based on user configuration and the remote. */ +static void +update_idl_probe_interval(struct ovsdb_idl *ovn_sb_idl, + struct ovsdb_idl *vtep_idl) +{ + const struct vteprec_global *cfg = vteprec_global_first(vtep_idl); + int interval = -1; + if (cfg) { + interval = smap_get_int(&cfg->other_config, + "ovn-remote-probe-interval", interval); + } + set_idl_probe_interval(ovn_sb_idl, ovnsb_remote, interval); +} + int main(int argc, char *argv[]) { @@ -179,6 +194,8 @@ main(int argc, char *argv[]) simap_destroy(&usage); } + update_idl_probe_interval(ovnsb_idl_loop.idl, vtep_idl_loop.idl); + if (ovsdb_idl_has_ever_connected(ovnsb_idl_loop.idl) && ovsdb_idl_has_ever_connected(vtep_idl_loop.idl) && check_northd_version(vtep_idl_loop.idl, ovnsb_idl_loop.idl,