From patchwork Fri May 19 15:13:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 1783865 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::136; helo=smtp3.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=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=w4wmao7s; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (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 4QN9N12jwXz20dn for ; Sat, 20 May 2023 01:13:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B8A5161220; Fri, 19 May 2023 15:13:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B8A5161220 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=w4wmao7s 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 LDmFlgj7zmTA; Fri, 19 May 2023 15:13:32 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9808D60ADC; Fri, 19 May 2023 15:13:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9808D60ADC Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7D72FC0035; Fri, 19 May 2023 15:13:31 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id D7E0DC002A for ; Fri, 19 May 2023 15:13:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id AE62A60D58 for ; Fri, 19 May 2023 15:13:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org AE62A60D58 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 SNg31Xy9ai85 for ; Fri, 19 May 2023 15:13:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4D21360ADC Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20727.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::727]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4D21360ADC for ; Fri, 19 May 2023 15:13:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=khryUa5qFl5X5CWTKcFXEqR4DZ66YDpiB1vCZ/5Erf2fdOvbHgL63evDoR/h+pr8W1OL/QX39DpPzCZoGw6OOWyXRt1Qf/jucYKHjRvrMomzOdwpFasGfaiZv0m+QyGs1HYTidxiM5bLEuCe1WKLyIIaY2warWiZ+iK9XrywKmltCngHi5PJq2GfvDsITDfDyJxrRYa9xgb+RoiZGH3sSoSogwUvHTK5rOEdeo+YGmWCGhdnLLx1AWDp8h/s543HRprf9ZY8lCtwV3Q6WpXZNgP7mQpVVH8PoQPv5Av0KTgE8MyCqKPLYjlwFe1isJyKQgII/Pd14cNUWHRS39a3fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yFcRhE73frcrW1PaQs8ZqDdFMKjgRVyNFMKwKR9zj1Q=; b=n8ppbEaUEgRO7A9f2prC619Z2OZipz39+9M/Ki6MFj53R9gx3RyQLBVg10f9lvNPsMlOea31PDCkrTkBDDa5jt8dRBIuDmEbqjMkBNBVxzCwrDAuxGKDu2HCQJRusSwRzYlVE4w+dWZ97q6E6rGhnsgNIEmnK5mDhvRfTBv5tetO8r4+MawZDIxJsDf55mzNXfxLSH1tNOx14qitsinP9WVX1W6cEUUj6nkEdSOLOixiEolJshLCMwmn19b9hCu9FYo3gvy73YURigplpDgrrL06nxyHF6/9gmPD0St40JXodAllbWxVtomsgRjXvJh7wDtvxdZI4nrXNpBdSqLqtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mail.schwarz; dmarc=pass action=none header.from=mail.schwarz; dkim=pass header.d=mail.schwarz; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.schwarz; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yFcRhE73frcrW1PaQs8ZqDdFMKjgRVyNFMKwKR9zj1Q=; b=w4wmao7sjPSjY+Gy9vxCOjmtZLwshDm2Z8XACrlOvzAv+a6l0YTh0+fIMwU3C0jVzqQRT+fkSgvJKK08yctlt8ep+tU98zgHzN9YFHPlbm78qd7srR+03jq/b/PBLbar1fTyiD4xt7t7wjkpXh5FpTdwdL8O+7e2jMtMxDJNwFIK1t8piBz7aauT3XpBBeU4JeulQ9LvhoNv6J0OpslYPj7CmB+WUvCH7Nj0P0hRik1P4uVYL+0Iml0QApV503aZhkmTS/woqKpNswnRBL10mK9SeiT/sZE1RG9bXVWoAOR1jvheEx8aGzZ1kpCAEkEDaF0sLtO3PhrBDXWTJg8bRA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mail.schwarz; Received: from DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:34c::22) by AM0PR10MB3700.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:156::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 15:13:26 +0000 Received: from DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM ([fe80::9734:2f0f:f5eb:3921]) by DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM ([fe80::9734:2f0f:f5eb:3921%4]) with mapi id 15.20.6411.017; Fri, 19 May 2023 15:13:26 +0000 Date: Fri, 19 May 2023 17:13:23 +0200 To: dev@openvswitch.org Message-ID: Content-Disposition: inline X-ClientProxiedBy: FR2P281CA0169.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:99::10) To DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:34c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR10MB5244:EE_|AM0PR10MB3700:EE_ X-MS-Office365-Filtering-Correlation-Id: 2667129f-7add-46dc-7bf8-08db587b9815 x-mp-schwarz-dsgvo2: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bIqOgL156wzjGid8IQOgkz95nIS/Rk/hSNrUiQGUXJUd1lvx95GcI9hbi3K3YXM/bQBEh4Z6wo01OOHHQ0Mztvr4rvQLf8zK5Fxcqn1lanAuOXQBR3luTwJDfSUCFWKXSBP0TKISUonUDwBgvoOOkMWOYsoW7jKdxrrbGk8t8We/hNeSa4vI667aU0Juqx0R3P9lOvBWw+LwBRjkjEB8xHNJxfq0PC5cZ5JZ9PpRAF0mHKo2MJSrbDhSdhem4rL5Bub1epbzsyS1033OPDgjaOAKxvE0P6DmrkSrIi47ApFE3nh6Sp3ceMnN9jKE437sKH3zGIWGhzTiDLP7+9U+Vko2X7Mv5woeCQXQkdV0ZT+/2DvzRLUfJ0az5GH1M6Yphlg68DRHN/llRjGt/6ZNLXoRcvRU8wrP48Cdy01yjmt5CLKRKzcnrrIT+9TzI7MFCUgwouxGb5FCRBGEMpI5DpiNhQs1hlkuAYs1rKIBXu7hHkcjLStD/DveSG8iz1k06uwZqxfK3KSBbIeod+JhfeqmzNgOd9F4EJf7vttu64eZbP7NqdBfTKOHqihSlvccIoexIvo1uEaq6PhiSVrshJm/bcz2i3na++OkSq7HdG4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199021)(83380400001)(478600001)(6506007)(6512007)(26005)(9686003)(66574015)(186003)(6486002)(6666004)(8676002)(8936002)(6916009)(38100700002)(316002)(86362001)(41300700001)(66946007)(66476007)(66556008)(82960400001)(2906002)(44832011)(5660300002)(46492015); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ae+qo8q6OWhKQVP62CMi73ilopb/dM6FCYIBnh0YnyOT4u6Egyt6lp+UhLR5zLJQu7TnnbLqwWXyA844Sdpie1C0lNmmUeqIlFlRDl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3w34/4v6Ee/qzt9R9fxBzqeHCaNDZBMqIZ3L7i51Vew14s0OxBrp/XeVnRLWxUa0lS3a2MvHGQzABM1wm636MRvVD63IXg9v5qmCVaIy+whI+QcrRNPMy2a/dvwgSpNdaQG8DmPgcTh6czTF5XgY31TfHbVAFn0cd45HrcaXQezVa4U7uXbyISYx6xCF/c0GS44aOiVXb6FVWtfMDPg7gxKGXOo45pmzcBfPayXmhB11Ri/YYbSoHAMMs+/g948HLYHANYSMd/v8YDDe5U5OWDk35EbrKNvu3haGsyxRMFqlwpJWFvA61xrc1RxNAEL58wf3x+jSzwd6bvWov5PDtxwHjBAim/XoGplC1KnMZL7Iko7NHBHpgjSfdr015lur21vjmYQS6MP9Pc0oVgyYw4SRlNRrH4h5CzwWcmnbj8pcuo6KsZ6wvtj4YdF8iCgaNWl2TNgaA== X-OriginatorOrg: mail.schwarz X-MS-Exchange-CrossTenant-Network-Message-Id: 2667129f-7add-46dc-7bf8-08db587b9815 X-MS-Exchange-CrossTenant-AuthSource: DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 15:13:26.0263 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hAloAEv2Rw8wIctcuIWBziyT9zsnrA/oDVZskc6nGF1U1oNxYcE6AT1aJFdlcR4xMq0VWLJ0q+ed3o7Obo16qh3nAPGR1ChdQuKA8104+sU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3700 Subject: [ovs-dev] [PATCH] relay: allow setting 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: , X-Patchwork-Original-From: Felix Huettner via dev From: Felix Huettner Reply-To: Felix Huettner Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" previously it was not possible to set the probe interval for the connection from a relay to the backing ovsdb-server. With this change it is now possible using the `ovsdb-server/set-active-ovsdb-server-probe-interval` command. The command `ovsdb-server/set-active-ovsdb-server-probe-interval` is already used to set the probe interval for active-backup replication. However this is mutally exclusive with being a relay and the case for using the command is the same. Therefor we decided to reuse it instead of adding a new one. Signed-off-by: Felix Huettner Reviewed-by: Simon Horman --- NEWS | 4 ++++ ovsdb/ovsdb-server.c | 4 +++- ovsdb/relay.c | 15 ++++++++++++++- ovsdb/relay.h | 4 +++- 4 files changed, 24 insertions(+), 3 deletions(-) -- 2.40.0 Diese E Mail enthält möglicherweise vertrauliche Inhalte und ist nur für die Verwertung durch den vorgesehenen Empfänger bestimmt. Sollten Sie nicht der vorgesehene Empfänger sein, setzen Sie den Absender bitte unverzüglich in Kenntnis und löschen diese E Mail. Hinweise zum Datenschutz finden Sie hier. This e-mail may contain confidential content and is intended only for the specified recipient/s. If you are not the intended recipient, please inform the sender immediately and delete this e-mail. Information on data protection can be found here. diff --git a/NEWS b/NEWS index cfd466663..719517c67 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ Post-v3.1.0 conversion operation is present. For the cluster service model follow upgrade instructions in 'Upgrading from version 3.1 and earlier to 3.2 and later' section of ovsdb(7). + * When ovsdb-server is running in relay mode, the default value of probe + interval is increased to 60 seconds for the connection to the + backing server. This value is configurable with the unixctl + command - ovsdb-server/set-active-ovsdb-server-probe-interval. - IPFIX template and statistics intervals can now be configured through two new options in the IPFIX table: 'template_interval' and 'stats_interval'. - Linux kernel datapath: diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 9bad0c8dd..d29dde417 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -797,7 +797,8 @@ open_db(struct server_config *config, const char *filename) add_db(config, db); if (is_relay) { - ovsdb_relay_add_db(db->db, relay_remotes, update_schema, config); + ovsdb_relay_add_db(db->db, relay_remotes, update_schema, config, + *config->replication_probe_interval); } return NULL; } @@ -1473,6 +1474,7 @@ ovsdb_server_set_active_ovsdb_server_probe_interval(struct unixctl_conn *conn, if (*config->is_backup) { replication_set_probe_interval(probe_interval); } + ovsdb_relay_set_probe_interval(probe_interval); unixctl_command_reply(conn, NULL); } else { unixctl_command_reply( diff --git a/ovsdb/relay.c b/ovsdb/relay.c index 377f3285f..21720f62f 100644 --- a/ovsdb/relay.c +++ b/ovsdb/relay.c @@ -127,7 +127,7 @@ static struct ovsdb_cs_ops relay_cs_ops = { void ovsdb_relay_add_db(struct ovsdb *db, const char *remote, schema_change_callback schema_change_cb, - void *schema_change_aux) + void *schema_change_aux, int probe_interval) { struct relay_ctx *ctx; @@ -152,10 +152,23 @@ ovsdb_relay_add_db(struct ovsdb *db, const char *remote, shash_add(&relay_dbs, db->name, ctx); ovsdb_cs_set_leader_only(ctx->cs, false); ovsdb_cs_set_remote(ctx->cs, remote, true); + ovsdb_cs_set_probe_interval(ctx->cs, probe_interval); VLOG_DBG("added database: %s, %s", db->name, remote); } +/* Updates the probe interval for all relay connections to the specified + * value*/ +void +ovsdb_relay_set_probe_interval(int probe_interval) +{ + struct shash_node *node; + SHASH_FOR_EACH (node, &relay_dbs) { + struct relay_ctx *ctx = node->data; + ovsdb_cs_set_probe_interval(ctx->cs, probe_interval); + } +} + void ovsdb_relay_del_db(struct ovsdb *db) { diff --git a/ovsdb/relay.h b/ovsdb/relay.h index f841554ca..ccfaf3c93 100644 --- a/ovsdb/relay.h +++ b/ovsdb/relay.h @@ -33,11 +33,13 @@ typedef struct ovsdb_error *(*schema_change_callback)( void ovsdb_relay_add_db(struct ovsdb *, const char *remote, schema_change_callback schema_change_cb, - void *schema_change_aux); + void *schema_change_aux, int probe_interval); void ovsdb_relay_del_db(struct ovsdb *); void ovsdb_relay_run(void); void ovsdb_relay_wait(void); +void ovsdb_relay_set_probe_interval(int); + bool ovsdb_relay_is_connected(struct ovsdb *); #endif /* OVSDB_RELAY_H */