From patchwork Mon Jul 25 13:36:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerrit Renker X-Patchwork-Id: 106667 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 A6A9EB6F8B for ; Mon, 25 Jul 2011 23:37:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751958Ab1GYNhN (ORCPT ); Mon, 25 Jul 2011 09:37:13 -0400 Received: from dee.erg.abdn.ac.uk ([139.133.204.82]:38458 "EHLO erg.abdn.ac.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751941Ab1GYNhK (ORCPT ); Mon, 25 Jul 2011 09:37:10 -0400 Received: from laptev.erg.abdn.ac.uk (Debian-exim@ra-gerrit.erg.abdn.ac.uk [139.133.204.38]) by erg.abdn.ac.uk (8.13.4/8.13.4) with ESMTP id p6PDadSV002305 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 25 Jul 2011 14:36:40 +0100 (BST) Received: from root by laptev.erg.abdn.ac.uk with local (Exim 4.72) (envelope-from ) id 1QlLKp-0001l4-Gw; Mon, 25 Jul 2011 07:36:39 -0600 From: Gerrit Renker To: davem@davemloft.net Cc: dccp@vger.kernel.org, netdev@vger.kernel.org, Samuel Jero Subject: [PATCH 6/7] dccp ccid-2: increment cwnd correctly Date: Mon, 25 Jul 2011 07:36:35 -0600 Message-Id: <1311600996-6712-7-git-send-email-gerrit@erg.abdn.ac.uk> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-ERG-MailScanner: Found to be clean X-ERG-MailScanner-From: root@erg.abdn.ac.uk X-Spam-Status: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Samuel Jero This patch fixes an issue where CCID-2 will not increase the congestion window for numerous RTTs after an idle period, application-limited period, or a loss once the algorithm is in Congestion Avoidance. What happens is that, when CCID-2 is in Congestion Avoidance mode, it will increase hc->tx_packets_acked by one for every packet and will increment cwnd every cwnd packets. However, if there is now an idle period in the connection, cwnd will be reduced, possibly below the slow start threshold. This will cause the connection to go into Slow Start. However, in Slow Start CCID-2 performs this test to increment cwnd every second ack: ++hc->tx_packets_acked == 2 Unfortunately, this will be incorrect, if cwnd previous to the idle period was larger than 2 and if tx_packets_acked was close to cwnd. For example: cwnd=50 and tx_packets_acked=45. In this case, the current code, will increment tx_packets_acked until it equals two, which will only be once tx_packets_acked (an unsigned 32-bit integer) overflows. My fix is simply to change that test for tx_packets_acked greater than or equal to two in slow start. Signed-off-by: Samuel Jero Acked-by: Gerrit Renker --- net/dccp/ccids/ccid2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c @@ -411,7 +411,7 @@ static void ccid2_new_ack(struct sock *sk, struct ccid2_seq *seqp, if (hc->tx_cwnd < dp->dccps_l_seq_win && r_seq_used < dp->dccps_r_seq_win) { if (hc->tx_cwnd < hc->tx_ssthresh) { - if (*maxincr > 0 && ++hc->tx_packets_acked == 2) { + if (*maxincr > 0 && ++hc->tx_packets_acked >= 2) { hc->tx_cwnd += 1; *maxincr -= 1; hc->tx_packets_acked = 0;