From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 727AAC4724C for ; Fri, 1 May 2020 13:42:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49EAC20757 for ; Fri, 1 May 2020 13:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588340577; bh=Be9Qa6GEzWbRRy7dTkQYaBQVuBFzIUuPT0a5TYhUR9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rvoMQR9oJzUxV7VwexQ+Lk7NdvJWOWvSceG64O78mXiVl4AfYu9haYpBXHKxf5d63 Mc4XAFNpI4zE63jqJjbkgoPsK+E6H42iP/iSw9p8iUf1J7zCjv4i/HBPnQrCAdcjX8 nBL7bM1QkVDTgl/HuZE1+UOH/EK5ShNF/cMeGR9I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731567AbgEANmz (ORCPT ); Fri, 1 May 2020 09:42:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:43680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731327AbgEANmy (ORCPT ); Fri, 1 May 2020 09:42:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00B8020757; Fri, 1 May 2020 13:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588340573; bh=Be9Qa6GEzWbRRy7dTkQYaBQVuBFzIUuPT0a5TYhUR9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fe2llFqXt9xTiSJXZ7atknijd83Py6zsfGiGlOojaFekN0egDBXhh7MMVHcHUpaQ7 /0YOuJvtJIyxqaJwgcLZ5dc2zSGJTnwMf4nvkpbucQpTEr70cu3EfrwfDPXFYLpb1I qTbRoS2qFe1b1oF9GPklcDsBde/UzfwcN+EvvT8U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Maloy , Tuong Lien , "David S. Miller" Subject: [PATCH 5.6 037/106] tipc: fix incorrect increasing of link window Date: Fri, 1 May 2020 15:23:10 +0200 Message-Id: <20200501131548.327398089@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131543.421333643@linuxfoundation.org> References: <20200501131543.421333643@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tuong Lien commit edadedf1c5b4e4404192a0a4c3c0c05e3b7672ab upstream. In commit 16ad3f4022bb ("tipc: introduce variable window congestion control"), we allow link window to change with the congestion avoidance algorithm. However, there is a bug that during the slow-start if packet retransmission occurs, the link will enter the fast-recovery phase, set its window to the 'ssthresh' which is never less than 300, so the link window suddenly increases to that limit instead of decreasing. Consequently, two issues have been observed: - For broadcast-link: it can leave a gap between the link queues that a new packet will be inserted and sent before the previous ones, i.e. not in-order. - For unicast: the algorithm does not work as expected, the link window jumps to the slow-start threshold whereas packet retransmission occurs. This commit fixes the issues by avoiding such the link window increase, but still decreasing if the 'ssthresh' is lowered. Fixes: 16ad3f4022bb ("tipc: introduce variable window congestion control") Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/tipc/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1065,7 +1065,7 @@ static void tipc_link_update_cwin(struct /* Enter fast recovery */ if (unlikely(retransmitted)) { l->ssthresh = max_t(u16, l->window / 2, 300); - l->window = l->ssthresh; + l->window = min_t(u16, l->ssthresh, l->window); return; } /* Enter slow start */