From patchwork Thu Mar 21 16:55:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1060288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="my53/YiP"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44QCl03BPnz9sRY for ; Fri, 22 Mar 2019 04:02:19 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3E1A71675; Thu, 21 Mar 2019 16:55:27 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id AB9CC1674 for ; Thu, 21 Mar 2019 16:55:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 69CA8872 for ; Thu, 21 Mar 2019 16:55:26 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id a3so4650658pff.11 for ; Thu, 21 Mar 2019 09:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jMB03xUZ9NMmNjJDB6hg9OFYZmDbU3oqskemwfqvMzI=; b=my53/YiP3w47sxALgpc9lsxzu6BdIIfY5HxhFRc6JOgjf6FhbtJ3ZBtIL7hVo8oIv7 5nJruLCSNEvnD30HcW3oCtTHNalwDGqrOroUl3hVhprTEDXtzjD2qUahaPOb8WvYusoB 4l9fOfqpM3640gYnaXKtAliPgf12sMdR935mAUQSeVJB0QdJ03BMmRZwc+9C6/7FRuhR s4WcXYrarUoLXu7npwhEeYVgwR7AIl8kt/JIfJq4jFmhu4m08jKWFOOllcWzWjTAy3Ne /+c4aqXjIzNtRLGhyYuOBd3XXNyHIW94uy/+Sk3oZNvsSrVxfreNkiQjbe+F+wOs71sU eMiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jMB03xUZ9NMmNjJDB6hg9OFYZmDbU3oqskemwfqvMzI=; b=RfFwbb78rhBR/bQjbM5YU7i5INZ0i32tGLpzcEFvM0H9ur2uge6zDFYTlZ1ytM4j/K k0pG6cS64Gji3nwt1ZuOjPr7jDTzByH2RHhWfJpJg1fXtRNAlsihpWz1Bnh9OKy4cn6L a/aVRr5AiFhhHWb+eYKHXx/XPkO0eTOYZJZDgzbBHpawaZRH90Zgi/OY6E6kc7jNA3qR Cr+uuh1TRscdMOBDQbB01COX5TE34a+Mg6G0j2d6AcCqLvrnPwobM/D5Y8UvJXA2ZWqY 0r2n8jxlNMTGkC4Obt6SshtkYuSaBCNM99bDxWaFDWcJiI4YYBWA5lcdJ2Rt6xjq6neP x7hA== X-Gm-Message-State: APjAAAXsiKzyeK2ZijXoW5FcEH38uPAgTLuLbuhWKiaUfS/9CPPcoATn sYrEhZwnj0c3ziBcfFoL7QaID35a X-Google-Smtp-Source: APXvYqyR75xR8Y0ZNToOvuJmpWUg0nJhdfILAo6wuk0TjPsVLwxmqHt9L36Cdztj+zwaqIDldqz8Qw== X-Received: by 2002:a63:fb45:: with SMTP id w5mr4276732pgj.118.1553187325856; Thu, 21 Mar 2019 09:55:25 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-76-21-108-74.hsd1.ca.comcast.net. [76.21.108.74]) by smtp.gmail.com with ESMTPSA id x23sm4604165pfa.36.2019.03.21.09.55.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 09:55:25 -0700 (PDT) From: Han Zhou X-Google-Original-From: Han Zhou To: dev@openvswitch.org Date: Thu, 21 Mar 2019 09:55:15 -0700 Message-Id: <1553187315-107323-1-git-send-email-hzhou8@ebay.com> X-Mailer: git-send-email 2.1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] reconnect.c: Don't transition back to ACTIVE when forced to RECONNECT. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Han Zhou Currently, whenever there is activity on the session, the FSM is transitioned to ACTIVE. However, this causes reconnect_force_reconnect() failed to work once there are traffic received from remote after transition to RECONNECT, it will skip the reconnection phase and directly go back to ACTIVE for the old session. This patch fixes it so that when FSM is in RECONNECT state, it doesn't transition back to ACTIVE directly. Signed-off-by: Han Zhou --- lib/reconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reconnect.c b/lib/reconnect.c index 0f21378..e2901ab 100644 --- a/lib/reconnect.c +++ b/lib/reconnect.c @@ -495,7 +495,7 @@ reconnect_connect_failed(struct reconnect *fsm, long long int now, int error) void reconnect_activity(struct reconnect *fsm, long long int now) { - if (fsm->state != S_ACTIVE) { + if (fsm->state != S_ACTIVE && fsm->state != S_RECONNECT) { reconnect_transition__(fsm, now, S_ACTIVE); } fsm->last_activity = now;