From patchwork Fri Jun 24 10:15:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Graf X-Patchwork-Id: 101767 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 A8FBAB6F7F for ; Fri, 24 Jun 2011 20:16:01 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753001Ab1FXKPm (ORCPT ); Fri, 24 Jun 2011 06:15:42 -0400 Received: from merlin.infradead.org ([205.233.59.134]:40800 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449Ab1FXKPl (ORCPT ); Fri, 24 Jun 2011 06:15:41 -0400 Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qa3QG-0003bJ-Bd; Fri, 24 Jun 2011 10:15:36 +0000 Received: from tgr by canuck.infradead.org with local (Exim 4.76 #1 (Red Hat Linux)) id 1Qa3QF-00037I-RY; Fri, 24 Jun 2011 10:15:35 +0000 Date: Fri, 24 Jun 2011 06:15:35 -0400 From: Thomas Graf To: Vlad Yasevich , Sridhar Samudrala Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] sctp: Reducing rwnd by sizeof(struct sk_buff) for each CHUNK is too aggressive Message-ID: <20110624101535.GB9222@canuck.infradead.org> Mail-Followup-To: Vlad Yasevich , Sridhar Samudrala , linux-sctp@vger.kernel.org, netdev@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by canuck.infradead.org See http://www.infradead.org/rpr.html Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently we subtract sizeof(struct sk_buff) of our view of the receiver's rwnd for each DATA chunk appended to a sctp packet. Reducing the rwnd by >200 bytes for each DATA chunk quickly consumes the available window and prevents max MTU sized packets (for large MTU values) from being generated in combination with small DATA chunks. The sender has to wait for the next SACK to be processed for the rwnd to be corrected. Accounting for data structures required for rx is the responsibility of the stack which is why we announce a rwnd of sk_rcvbuf/2. Signed-off-by: Thomas Graf --- 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 diff --git a/net/sctp/output.c b/net/sctp/output.c index b4f3cf0..ceb55b2 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c @@ -700,13 +700,7 @@ static void sctp_packet_append_data(struct sctp_packet *packet, /* Keep track of how many bytes are in flight to the receiver. */ asoc->outqueue.outstanding_bytes += datasize; - /* Update our view of the receiver's rwnd. Include sk_buff overhead - * while updating peer.rwnd so that it reduces the chances of a - * receiver running out of receive buffer space even when receive - * window is still open. This can happen when a sender is sending - * sending small messages. - */ - datasize += sizeof(struct sk_buff); + /* Update our view of the receiver's rwnd. */ if (datasize < rwnd) rwnd -= datasize; else