Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3337912imu; Sun, 11 Nov 2018 12:41:35 -0800 (PST) X-Google-Smtp-Source: AJdET5e8D2e6yI9LYaCH9TJIElG3eht544AiStSnUqK6kj9Td+eRhNNu27ghp79JnWTHeu88cY/s X-Received: by 2002:a17:902:6b46:: with SMTP id g6-v6mr17205891plt.33.1541968895614; Sun, 11 Nov 2018 12:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968895; cv=none; d=google.com; s=arc-20160816; b=qZX/8oUv9TJBP96FVaDQaKGqdYAX7Ao2NZFAHUOmw8LTcC1o8E/VlMKZZqK8XCPQX3 Q7OC9lh3vPWZ4TJopvJ7bberGiHTUPHI29s1TZB/ErxbwHEAnTuwWQUy7s42UXdhzZ0e 5HP8ycwzJKZR/ZBrXdau7B0CqVl6G710Z739TL/t7RIrfEcfjktdjM22LoIGLA0IITm+ lajn3t67fJvRzTeIEpndGd9ufwzhiixK1OXBvN7AOOMXeo6d3/+zSPuBhJQq0tI06PTU BBM6FwaXCVEIbm74UrJHqRmgwjbn6ZmgpXG4cTth/JVrwH5ppBQSZ2FtBauGlx4ZyWMK WLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=V289tlqs6UnFV73jiXtcpWKxlk1RgnaMjjMj5l9YuOQ=; b=CckoJOEibR/Fzx8JzdGQQ+3ASmCbx26k5ApD39gAHdAOYJy4GchNqKoIV/Xbz2EdsS TCW6wxlelyAY0wzQseltOnSfKJgHalIgHg13pkYpF1R8OWNReEpbKTAjYliZw5JGA2PD k/RUyPg23qjpDm5GAn/fxdK6FtRoHgjGStgphiPycIkhIqJVVyzmHBOgOKYe+y/8EWPg vOTzkjoqhOTkcvWKK/iGHRHjgqo5coLNOEwGJ27nfmIOopc8YzFQ73W9UXe1NGkluxgA 6vxZe5/zugnd82V4GsCHOI6GE9WxGqEpfrntAkkOGQjlIuLTjlS6+dBeY/2D5fYzknYa lw/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y35-v6si14024349pgl.14.2018.11.11.12.41.20; Sun, 11 Nov 2018 12:41:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730087AbeKLGa3 (ORCPT + 99 others); Mon, 12 Nov 2018 01:30:29 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49438 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729548AbeKLFsE (ORCPT ); Mon, 12 Nov 2018 00:48:04 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsQ-0000lJ-Go; Sun, 11 Nov 2018 19:58:34 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsO-0001OH-69; Sun, 11 Nov 2018 19:58:32 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Xin Long" , "Marcelo Ricardo Leitner" , "David S. Miller" , "Neil Horman" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 028/366] sctp: fix identification of new acks for SFR-CACC In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Marcelo Ricardo Leitner commit 51446780fc33e45cb790c05a7fa2c5bf7e8bc53b upstream. It's currently written as: if (!tchunk->tsn_gap_acked) { [1] tchunk->tsn_gap_acked = 1; ... } if (TSN_lte(tsn, sack_ctsn)) { if (!tchunk->tsn_gap_acked) { /* SFR-CACC processing */ ... } } Which causes the SFR-CACC processing on ack reception to never process, as tchunk->tsn_gap_acked is always true by then. Block [1] was moved to that position by the commit marked below. This patch fixes it by doing SFR-CACC processing earlier, before tsn_gap_acked is set to true. Fixes: 31b02e154940 ("sctp: Failover transmitted list on transport delete") Signed-off-by: Marcelo Ricardo Leitner Reviewed-by: Xin Long Acked-by: Neil Horman Signed-off-by: David S. Miller [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- net/sctp/outqueue.c | 48 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 25 deletions(-) --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -1346,7 +1346,7 @@ static void sctp_check_transmitted(struc * the outstanding bytes for this chunk, so only * count bytes associated with a transport. */ - if (transport) { + if (transport && !tchunk->tsn_gap_acked) { /* If this chunk is being used for RTT * measurement, calculate the RTT and update * the RTO using this value. @@ -1358,14 +1358,34 @@ static void sctp_check_transmitted(struc * first instance of the packet or a later * instance). */ - if (!tchunk->tsn_gap_acked && - !tchunk->resent && + if (!tchunk->resent && tchunk->rtt_in_progress) { tchunk->rtt_in_progress = 0; rtt = jiffies - tchunk->sent_at; sctp_transport_update_rto(transport, rtt); } + + if (TSN_lte(tsn, sack_ctsn)) { + /* + * SFR-CACC algorithm: + * 2) If the SACK contains gap acks + * and the flag CHANGEOVER_ACTIVE is + * set the receiver of the SACK MUST + * take the following action: + * + * B) For each TSN t being acked that + * has not been acked in any SACK so + * far, set cacc_saw_newack to 1 for + * the destination that the TSN was + * sent to. + */ + if (sack->num_gap_ack_blocks && + q->asoc->peer.primary_path->cacc. + changeover_active) + transport->cacc.cacc_saw_newack + = 1; + } } /* If the chunk hasn't been marked as ACKED, @@ -1397,28 +1417,6 @@ static void sctp_check_transmitted(struc restart_timer = 1; forward_progress = true; - if (!tchunk->tsn_gap_acked) { - /* - * SFR-CACC algorithm: - * 2) If the SACK contains gap acks - * and the flag CHANGEOVER_ACTIVE is - * set the receiver of the SACK MUST - * take the following action: - * - * B) For each TSN t being acked that - * has not been acked in any SACK so - * far, set cacc_saw_newack to 1 for - * the destination that the TSN was - * sent to. - */ - if (transport && - sack->num_gap_ack_blocks && - q->asoc->peer.primary_path->cacc. - changeover_active) - transport->cacc.cacc_saw_newack - = 1; - } - list_add_tail(&tchunk->transmitted_list, &q->sacked); } else {