From patchwork Fri Jun 23 22:59:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Ricardo Leitner X-Patchwork-Id: 780305 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 3wvYnF3N9yz9s3T for ; Sat, 24 Jun 2017 09:00:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uSyoCfuA"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754525AbdFWW7x (ORCPT ); Fri, 23 Jun 2017 18:59:53 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:33416 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942AbdFWW7v (ORCPT ); Fri, 23 Jun 2017 18:59:51 -0400 Received: by mail-qt0-f194.google.com with SMTP id c20so7619308qte.0; Fri, 23 Jun 2017 15:59:51 -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:in-reply-to:references; bh=3nwEu7+QgHAIcI/UxRZt7mxbGo0n4DGM1fxc0LXB7+4=; b=uSyoCfuACXkVtGVcPWy25hfof8RCLC5+YgvGLWu/CNntguVaOQjytDtsdXYnejsMSh EdEuGHhIAm/jmhq+iQKP8XJ+DsCAbwG3rPgXm1B5Xbex1m2xEl3tPHUFS8U+dh04HaIG T/exRl5M5PI6kr/hgcL0hhwGdAqfQsMSIOgG0FomhYjArLGUts8l/qz5yGINTkIMJOVj z1I/NIyTZLYAYY6GBg0cd4F/T2cwT0rV/MXqG4OyIxftqNhNil2QIfCWPlV8UfjiKGNx 3vOvTPmvjc4SVM0JTGduw74nx77AMJJSj2SOePzFzZkF9TcMvB5U1htSge+yEHa0Sl+V oElA== 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:in-reply-to :references; bh=3nwEu7+QgHAIcI/UxRZt7mxbGo0n4DGM1fxc0LXB7+4=; b=ailMm3BX1Wb6K6RjcRdUEWV+wnghUNBb9fF9z9B5uHOQdY64F41umapjXR+Xgl/Vp5 YxpnXjTKPYZXliRY3C9Dqk4chq5gM5p7LUMuWHAD0Wf7cTaFVMyP9AUe8RMpZYtPcF+l ulcIww+FksOmiABkk7wDrfNHEPrT/K/yw5QRCUQq1yy3svGPQ5rwEjqZwOvtYEsvwkHQ iQs/LUf7UBedMqZ7A7jPD4G9dWY+ejvgg8sQuQVGCivOEF29AQJlKkvy01XGyxR6lReX TVtQ267VJyKf1v6r0PLNYnLwFXIO914qi3+xv4JaYXNWObGZ/TKpAn6TcC+7dhJ7bSag WAew== X-Gm-Message-State: AKS2vOxlGXQMUTU3Zx5NZZu4s4/iMw8P9mUs05TmbVBbjbgWubZub0io aMWR+Oq54MBEKgAK X-Received: by 10.200.34.66 with SMTP id p2mr13992596qtp.2.1498258790506; Fri, 23 Jun 2017 15:59:50 -0700 (PDT) Received: from localhost.localdomain.com ([2001:1284:f013:2e37:5ee0:c5ff:fe34:bf34]) by smtp.gmail.com with ESMTPSA id m187sm4287605qke.17.2017.06.23.15.59.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 15:59:49 -0700 (PDT) From: Marcelo Ricardo Leitner To: netdev@vger.kernel.org Cc: linux-sctp@vger.kernel.org, Neil Horman , Vlad Yasevich Subject: [PATCH net-next 1/4] sctp: update order of adjustments of partial_bytes_acked and cwnd Date: Fri, 23 Jun 2017 19:59:33 -0300 Message-Id: <98e065d2430bf0997c1d3ece3a56af78a60e7ce3.1498251459.git.marcelo.leitner@gmail.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org RFC4960 Errata 3.12 says RFC4960 is unclear about the order of adjustments applied to partial_bytes_acked and cwnd in the congestion avoidance phase, and that the actual order should be: partial_bytes_acked is reset to (partial_bytes_acked - cwnd). Next, cwnd is increased by MTU. We were first increasing cwnd, and then subtracting the new value pba, which leads to a different result as pba is smaller than what it should and could cause cwnd to not grow as much. See-also: https://tools.ietf.org/html/draft-ietf-tsvwg-rfc4960-errata-01#section-3.12 Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/transport.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 721eeebfcd8a50609877db61ede41575e012606a..04b6dd1a07ded25fe5874518b0944a6d9df4099b 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -452,17 +452,18 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport, * chunks acknowledged by the new Cumulative TSN Ack and by * Gap Ack Blocks. * - * When partial_bytes_acked is equal to or greater than cwnd - * and before the arrival of the SACK the sender had cwnd or - * more bytes of data outstanding (i.e., before arrival of the - * SACK, flightsize was greater than or equal to cwnd), - * increase cwnd by MTU, and reset partial_bytes_acked to - * (partial_bytes_acked - cwnd). + * When partial_bytes_acked is equal to or greater than + * cwnd and before the arrival of the SACK the sender + * had cwnd or more bytes of data outstanding (i.e., + * before arrival of the SACK, flightsize was greater + * than or equal to cwnd), partial_bytes_acked is reset + * to (partial_bytes_acked - cwnd). Next, cwnd is + * increased by MTU. (RFC 4960 Errata 3.12) */ pba += bytes_acked; if (pba >= cwnd) { + pba = pba - cwnd; cwnd += pmtu; - pba = ((cwnd < pba) ? (pba - cwnd) : 0); } pr_debug("%s: congestion avoidance: transport:%p, "