From patchwork Thu Apr 20 09:23:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangchuanlei X-Patchwork-Id: 1771156 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::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::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 4Q2Bzk5HC3z23tD for ; Thu, 20 Apr 2023 19:23:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9329E42026; Thu, 20 Apr 2023 09:23:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9329E42026 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 GACw8qEFUooU; Thu, 20 Apr 2023 09:23:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6E813405AE; Thu, 20 Apr 2023 09:23:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6E813405AE Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 32E93C0036; Thu, 20 Apr 2023 09:23:42 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id D4F71C002A for ; Thu, 20 Apr 2023 09:23:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A16A641EB2 for ; Thu, 20 Apr 2023 09:23:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A16A641EB2 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 vYr_T97ttH1S for ; Thu, 20 Apr 2023 09:23:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DB960405AE Received: from unicom145.biz-email.net (unicom145.biz-email.net [210.51.26.145]) by smtp4.osuosl.org (Postfix) with ESMTPS id DB960405AE for ; Thu, 20 Apr 2023 09:23:37 +0000 (UTC) Received: from unicom145.biz-email.net by unicom145.biz-email.net ((D)) with ASMTP (SSL) id QFS00032; Thu, 20 Apr 2023 17:23:32 +0800 Received: from localhost.localdomain (10.180.204.133) by jtjnmail201609.home.langchao.com (10.100.2.9) with Microsoft SMTP Server id 15.1.2507.23; Thu, 20 Apr 2023 17:23:31 +0800 From: wangchuanlei To: Date: Thu, 20 Apr 2023 05:23:27 -0400 Message-ID: <20230420092327.115565-1-wangchuanlei@inspur.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.180.204.133] tUid: 2023420172332b1c819db31187c2d16082ea2ee3690a1 X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com Cc: dev@openvswitch.org Subject: [ovs-dev] [Patch ovn v2] pinctrl: fix restart of controller when bfd min_tx set to 1 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" Signed-off-by: wangchuanlei Acked-by: Ales Musil --- controller/pinctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 795847729..97a5e392f 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -7190,7 +7190,9 @@ bfd_monitor_send_msg(struct rconn *swconn, long long int *bfd_time) pinctrl_send_bfd_tx_msg(swconn, entry, false); tx_timeout = MAX(entry->local_min_tx, entry->remote_min_rx); - tx_timeout -= random_range((tx_timeout * 25) / 100); + if (tx_timeout >= 4) { + tx_timeout -= random_range(tx_timeout / 4); + } entry->next_tx = cur_time + tx_timeout; next: if (*bfd_time > entry->next_tx) {