From patchwork Tue Apr 5 20:35:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Maloy X-Patchwork-Id: 606740 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qfgbr5ZWVz9t45 for ; Wed, 6 Apr 2016 06:35:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.b=u90SEUkH; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759999AbcDEUft (ORCPT ); Tue, 5 Apr 2016 16:35:49 -0400 Received: from smtp102.biz.mail.bf1.yahoo.com ([98.139.221.61]:48489 "EHLO smtp102.biz.mail.bf1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbcDEUfr (ORCPT ); Tue, 5 Apr 2016 16:35:47 -0400 Received: (qmail 3483 invoked from network); 5 Apr 2016 20:35:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1459888546; bh=fjggQg5CbpS/HMipgF7LZJCzXTRXgO1s+wIeYyuR4sI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=u90SEUkHcm6fIh/ADY2B/lRnHm2Q2u8hYmlQHbT7V6/JM2FzC39+zKVv3RtISQq1TUoN0rOdCn4Wpq7QlKep52ivK52TYvBzhe6EY80fefMqzspN7Ro12GA+X7zoNyvait181QOm+DKoAR80UWVc4eZ/bBMfCeR2TIbmqh7YgWA= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 3Pb78iQVM1nidpietKftCDU_tAl4nZMe0LwJQ3k3sT7Si_1 SVyUEYZ.3ZRKQQWHv82lr7_1_NqEohyNu86D4bPrVunIeXjRAJGnjP4JWiUo 5Csa_zeH7bW.a5iHMLu.ncwha5kMiQiW3G.s93zY7zbXV_64izyzk5r5NMUy _Un7e2pSgmeRrMqUq4tFGXNd1lsAHFw4RgjlvIPKYJmXa.DpUZV8AnZqkRTs ib0STQ4r4mG7XG3cY3xTy1qAx5Oe_QsiJX7Z17LCo38D2rmV55DGo8rl.HrF J92XgBHqen5q0tG_zoIrTRmUYGP1TZYMuln4jVukdDK_FP4H.xYBSDupcoyS WhbK2sN98yR0qcRmxO1xcVmEuOGBdzobfMR5BarlhCKj54lvjqE6JE6FYPjs Jg8w7Yf_HWR9xFXoITdAtqnRq7fZys0XdHIqjkmm5vAdnG8pTHd.hVkDIrt0 QMAWnbjaGWUkLFxVb_0zRGtr2FBKZrTS0tttn7kOjlbbJjThbiGvnsano8lX D89Psp4Kwv.njdi0LurywBtHTXiX4BCYRQw-- X-Yahoo-SMTP: gPXIZm2swBAFQJ_Vx0CebjUfUdhJ From: Jon Maloy To: davem@davemloft.net Cc: netdev@vger.kernel.org, Paul Gortmaker , parthasarathy.bhuvaragan@ericsson.com, richard.alpe@ericsson.com, ying.xue@windriver.com, maloy@donjonn.com, tipc-discussion@lists.sourceforge.net, Jon Maloy Subject: [PATCH net-next v2 3/3] tipc: reduce transmission rate of reset messages when link is down Date: Tue, 5 Apr 2016 16:35:36 -0400 Message-Id: <1459888536-22697-4-git-send-email-jon.maloy@ericsson.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459888536-22697-1-git-send-email-jon.maloy@ericsson.com> References: <1459888536-22697-1-git-send-email-jon.maloy@ericsson.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When a link is down, it will continuously try to re-establish contact with the peer by sending out a RESET or an ACTIVATE message at each timeout interval. The default value for this interval is currently 375 ms. This is wasteful, and may become a problem in very large clusters with dozens or hundreds of nodes being down simultaneously. We now introduce a simple backoff algorithm for these cases. The first five messages are sent at default rate; thereafter a message is sent only each 16th timer interval. This will cover the vast majority of link recycling cases, since the endpoint starting last will transmit at the higher speed, and the link should normally be established well be before the rate needs to be reduced. The only case where we will see a degradation of link re-establishment is when the endpoints remain intact, and a glitch in the transmission media is causing the link reset. We will then experience a worst-case re-establishing time of 6 seconds, something we deem acceptable. Acked-by: Ying Xue Signed-off-by: Jon Maloy --- net/tipc/link.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index 7d2bb3e..42cdbd1 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -140,6 +140,7 @@ struct tipc_link { char if_name[TIPC_MAX_IF_NAME]; u32 priority; char net_plane; + u16 rst_cnt; /* Failover/synch */ u16 drop_point; @@ -701,8 +702,6 @@ static void link_profile_stats(struct tipc_link *l) /* tipc_link_timeout - perform periodic task as instructed from node timeout */ -/* tipc_link_timeout - perform periodic task as instructed from node timeout - */ int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq) { int rc = 0; @@ -730,11 +729,13 @@ int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq) l->silent_intv_cnt++; break; case LINK_RESET: - xmit = true; + if ((l->rst_cnt++ <= 4) || !(l->rst_cnt % 16)) + xmit = true; mtyp = RESET_MSG; break; case LINK_ESTABLISHING: - xmit = true; + if ((l->rst_cnt++ <= 4) || !(l->rst_cnt % 16)) + xmit = true; mtyp = ACTIVATE_MSG; break; case LINK_PEER_RESET: @@ -833,6 +834,7 @@ void tipc_link_reset(struct tipc_link *l) l->rcv_nxt = 1; l->acked = 0; l->silent_intv_cnt = 0; + l->rst_cnt = 0; l->stats.recv_info = 0; l->stale_count = 0; l->bc_peer_is_up = false;