From patchwork Tue Apr 24 21:17:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Ricardo Leitner X-Patchwork-Id: 903877 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AK5kjAoX"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40Vx514tQbz9ry1 for ; Wed, 25 Apr 2018 07:18:13 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751236AbeDXVSL (ORCPT ); Tue, 24 Apr 2018 17:18:11 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:37973 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbeDXVSH (ORCPT ); Tue, 24 Apr 2018 17:18:07 -0400 Received: by mail-qt0-f196.google.com with SMTP id z23-v6so24166755qti.5; Tue, 24 Apr 2018 14:18:06 -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=HClC6dfuDZSJ1Fmbm5ccbAYXFnyUb8mGFnYeU3bEyyo=; b=AK5kjAoX69wybRaTqk9p/PUhUwk3ak8ZsKsBbZKbSfjw+PIZY/CyF8bhRmXNMNPret oY5mT1xZqDSVjy2sv5zHW73XWz6AnwwkvUV9PrpO2zAbANoL6I5rgoxMEOdncCe1NCAc cTxNXzuzZ+H2SxFjpZlQKGwWd7roUBuA/1KPC+xaLTZBCFPoFM1oNF4Y69Ag0NpM/5vK +QZ71r5b6lT8CuV3qls++fTlmf3IHZtM1lKSiV+yeuEb92Ls3VkhhANkYdqMrBbopW6a IZ9/AEGym4NGHhiixy8t31/CTebuFnfssj9DO82FU8PgAE7x7gpVSzAWzAVoyoaZI1Ec kzGA== 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=HClC6dfuDZSJ1Fmbm5ccbAYXFnyUb8mGFnYeU3bEyyo=; b=ukYCyg4aYLIMrSxUw0XpfUmXCNH46sHrScMY3zzmIOZ68Y/w/v4J5/k7Xhe9zAfRGC 8eLOzFv4ANpCrEvtOKuc1xePnZwxpPSSAVuqleiAua7yQTO56WJ8vcNw+JCkiasmxCE9 6Euc36j3CP6NpX2JJguhTnhqiGiw+J/tFMAy1ypf1z5AHY20EnfBOI8c6Irj5HK9rbSH vTZ2z6d3usKSOvTqdtzGO6SZlYl9oq/gKihRgM439qvFQxd+igROP+vFSQQkio9QMDH8 QzJx22MbJnHBcGzgqfYg47z0yLxDryV3KpS1PZkP6hWLJ0bL0Amx5RZ/UWuqijtgvOR5 E01A== X-Gm-Message-State: ALQs6tBgBoeQJygq+elkPi/E76IsctEha8/ZHjZbhL4ZrfmsJWf21KUe 1GVsHhWed9rrlSAQZ30CidUDiwol X-Google-Smtp-Source: AIpwx49EgKGPwany+B1fnzOjZPsboJNeT4Z8bK8IBFBriHuoJJzVnzJtGmUkc5b9kcRrJzHgbqIW9Q== X-Received: by 2002:ac8:18f:: with SMTP id x15-v6mr30465917qtf.413.1524604685836; Tue, 24 Apr 2018 14:18:05 -0700 (PDT) Received: from localhost.localdomain ([177.10.56.96]) by smtp.gmail.com with ESMTPSA id x3-v6sm11199536qtf.48.2018.04.24.14.18.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Apr 2018 14:18:05 -0700 (PDT) Received: by localhost.localdomain (Postfix, from userid 1000) id E686B181E39; Tue, 24 Apr 2018 18:18:02 -0300 (-03) From: Marcelo Ricardo Leitner To: netdev@vger.kernel.org Cc: linux-sctp@vger.kernel.org, Xin Long , Vlad Yasevich , Neil Horman Subject: [PATCH net-next] sctp: fix identification of new acks for SFR-CACC Date: Tue, 24 Apr 2018 18:17:35 -0300 Message-Id: <4e837f7eaf67a1a964d1b3418aa3cf759f512535.1524603870.git.marcelo.leitner@gmail.com> X-Mailer: git-send-email 2.14.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- Even though this is a -stable candidate, please apply it to net-next to avoid conflicts with subsequent patches in my queue. Thanks. net/sctp/outqueue.c | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) -- 2.14.3 diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index f211b3db6a3543073e113da121bb28518b0af491..dee7cbd5483149024f2f3195db2fe4d473b1a00a 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -1457,7 +1457,7 @@ static void sctp_check_transmitted(struct sctp_outq *q, * 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. @@ -1469,14 +1469,34 @@ static void sctp_check_transmitted(struct sctp_outq *q, * first instance of the packet or a later * instance). */ - if (!tchunk->tsn_gap_acked && - !sctp_chunk_retransmitted(tchunk) && + if (!sctp_chunk_retransmitted(tchunk) && 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, @@ -1508,28 +1528,6 @@ static void sctp_check_transmitted(struct sctp_outq *q, 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 {