From patchwork Fri Jul 22 01:23:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangchuanlei X-Patchwork-Id: 1659332 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.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LpsCF1wfcz9s1l for ; Fri, 22 Jul 2022 11:23:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BADD860ED0; Fri, 22 Jul 2022 01:23:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BADD860ED0 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 vYop-ua0lAOp; Fri, 22 Jul 2022 01:23:34 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0397C60899; Fri, 22 Jul 2022 01:23:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0397C60899 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AB7C4C0033; Fri, 22 Jul 2022 01:23:32 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id BB9E9C002D for ; Fri, 22 Jul 2022 01:23:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 96001408DC for ; Fri, 22 Jul 2022 01:23:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 96001408DC 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 mTNK-Bha1ICC for ; Fri, 22 Jul 2022 01:23:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D82564061C Received: from ssh248.corpemail.net (ssh248.corpemail.net [210.51.61.248]) by smtp2.osuosl.org (Postfix) with ESMTPS id D82564061C for ; Fri, 22 Jul 2022 01:23:28 +0000 (UTC) Received: from ([60.208.111.195]) by ssh248.corpemail.net ((D)) with ASMTP (SSL) id QYT00023 for ; Fri, 22 Jul 2022 09:23:23 +0800 Received: from localhost.localdomain (10.180.206.78) by jtjnmail201608.home.langchao.com (10.100.2.8) with Microsoft SMTP Server id 15.1.2507.9; Fri, 22 Jul 2022 09:23:23 +0800 From: wangchuanlei To: Date: Thu, 21 Jul 2022 21:23:19 -0400 Message-ID: <20220722012319.30152-1-wangchuanlei@inspur.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.180.206.78] tUid: 20227220923232c7dd5053a0b40023e88b845a9b5758e 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: wangchuanlei Subject: [ovs-dev] [PATCH ovn] pinctrl: fix monitor state when using udp(icmp) to check healthy state. 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" When vm of backend do not send reply packet, monitor state should change state from waiting to offline, but code of current is to online, this is a bug, this patch is to fix it! Signed-off-by: wangchuanlei --- controller/pinctrl.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 38e8590af..1a21c7704 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -7526,13 +7526,9 @@ svc_monitors_run(struct rconn *swconn, case SVC_MON_S_WAITING: if (current_time > svc_mon->wait_time) { - if (svc_mon->protocol == SVC_MON_PROTO_TCP) { - svc_mon->n_failures++; - svc_mon->state = SVC_MON_S_OFFLINE; - } else { - svc_mon->n_success++; - svc_mon->state = SVC_MON_S_ONLINE; - } + svc_mon->n_failures++; + svc_mon->state = SVC_MON_S_OFFLINE; + svc_mon->next_send_time = current_time + svc_mon->interval; next_run_time = svc_mon->next_send_time; } else {