From patchwork Mon Aug 1 13:01:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangchuanlei X-Patchwork-Id: 1662545 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.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4LxJKm0bZRz9sCD for ; Mon, 1 Aug 2022 23:06:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1B78D40168; Mon, 1 Aug 2022 13:06:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1B78D40168 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 BAEhBmJTMGPd; Mon, 1 Aug 2022 13:06:31 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 53FF640488; Mon, 1 Aug 2022 13:06:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 53FF640488 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1DE6EC0033; Mon, 1 Aug 2022 13:06:30 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 84581C002D for ; Mon, 1 Aug 2022 13:06:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4BC9040488 for ; Mon, 1 Aug 2022 13:06:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4BC9040488 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 Iz945YvTm99g for ; Mon, 1 Aug 2022 13:06:26 +0000 (UTC) X-Greylist: delayed 00:05:09 by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0A01D40168 Received: from mtakt64.mailrelay.cn (mtakt64.mailrelay.cn [110.34.169.4]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0A01D40168 for ; Mon, 1 Aug 2022 13:06:25 +0000 (UTC) Received: from jtjnmail201601.home.langchao.com (unknown [60.208.111.195]) by smtp.mailrelay.cn (Postfix) with ESMTPS id BCB1B41A605D for ; Mon, 1 Aug 2022 21:01:13 +0800 (CST) Received: from localhost.localdomain (10.180.206.78) by jtjnmail201601.home.langchao.com (10.100.2.1) with Microsoft SMTP Server id 15.1.2507.9; Mon, 1 Aug 2022 21:01:13 +0800 From: wangchuanlei To: Date: Mon, 1 Aug 2022 09:01:03 -0400 Message-ID: <20220801130103.153590-1-wangchuanlei@inspur.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.180.206.78] Cc: wangchuanlei Subject: [ovs-dev] [PATCH ovn] pinctrl: fix bug of monitor status in health check 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 from waiting to offline, this patch is to fix it! Signed-off-by: wangchuanlei --- controller/pinctrl.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 38e8590af..8226ad868 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -7526,13 +7526,8 @@ 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 {