From patchwork Tue Dec 15 23:05:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: laurent chavey X-Patchwork-Id: 41224 X-Patchwork-Delegate: shemminger@vyatta.com 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 BF5EEB6F19 for ; Wed, 16 Dec 2009 10:05:32 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762015AbZLOXF0 (ORCPT ); Tue, 15 Dec 2009 18:05:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761238AbZLOXFZ (ORCPT ); Tue, 15 Dec 2009 18:05:25 -0500 Received: from 216-239-44-51.google.com ([216.239.44.51]:8192 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761386AbZLOXFX (ORCPT ); Tue, 15 Dec 2009 18:05:23 -0500 Received: from spaceape23.eur.corp.google.com (spaceape23.eur.corp.google.com [172.28.16.75]) by smtp-out.google.com with ESMTP id nBFN5L2E013371 for ; Tue, 15 Dec 2009 15:05:22 -0800 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1260918322; bh=JgGONIYMpYdV1fmn/OFlACDfruw=; h=From:Date:Message-Id:To:CC:Subject; b=EIdd/48XK6QmW44gRYGfar/dHGBpGBYtfVErEeU24wd1Tcsw1f+qKrc2EUfkp7Dp6 U74t7WDC4hPZFXykanJgQ== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:date:message-id:to:cc:subject:x-system-of-record; b=LN08bbsKx6yEtRT842L7jRF5KZMe/5QzKTzpNkdIJpkl2H04nSHRe9N4wqf6DveV1 FTyJHd6VAFKCFopcvyIOQ== Received: from yxe1 (yxe1.prod.google.com [10.190.2.1]) by spaceape23.eur.corp.google.com with ESMTP id nBFN5Ijq031702 for ; Tue, 15 Dec 2009 15:05:18 -0800 Received: by yxe1 with SMTP id 1so434450yxe.3 for ; Tue, 15 Dec 2009 15:05:17 -0800 (PST) Received: by 10.150.47.2 with SMTP id u2mr471233ybu.245.1260918317552; Tue, 15 Dec 2009 15:05:17 -0800 (PST) Received: from chavey.mtv.corp.google.com (chavey.mtv.corp.google.com [172.22.64.28]) by mx.google.com with ESMTPS id 9sm131754ywf.20.2009.12.15.15.05.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Dec 2009 15:05:16 -0800 (PST) From: chavey@google.com Date: Tue, 15 Dec 2009 15:05:15 -0800 Message-Id: To: shemminger@vyatta.com CC: netdev@vger.kernel.org, therbert@google.com, chavey@google.com, eric.dumazet@gmail.com Subject: [PATCH] Add initrwnd to iproute2 X-System-Of-Record: true Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add initrwnd option parsing to iproute. This option uses the new rtnetlink init_rcvwnd to set the TCP initial receive window size advertised by passive and active TCP connections. Signed-off-by: Laurent Chavey --- doc/ip-cref.tex | 5 +++++ include/linux/rtnetlink.h | 2 ++ ip/iproute.c | 13 ++++++++++++- 3 files changed, 19 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 diff --git a/doc/ip-cref.tex b/doc/ip-cref.tex index bb4eb78..2f6511a 100644 --- a/doc/ip-cref.tex +++ b/doc/ip-cref.tex @@ -1324,7 +1324,12 @@ peers are allowed to send to us. If it is not given, Linux uses the value selected with \verb|sysctl| variable \verb|net/ipv4/tcp_reordering|. +\item \verb|initrwnd NUMBER| +--- [2.6.33+ only] Initial receive window size for connections to + this destination. The actual window size is this value multiplied + by the MSS (''Maximal Segment Size'') of the connection. The default + value is zero, meaning to use Slow Start value. \item \verb|nexthop NEXTHOP| diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 63d1c69..3373544 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -371,6 +371,8 @@ enum #define RTAX_FEATURES RTAX_FEATURES RTAX_RTO_MIN, #define RTAX_RTO_MIN RTAX_RTO_MIN + RTAX_INITRWND, +#define RTAX_INITRWND RTAX_INITRWND __RTAX_MAX }; diff --git a/ip/iproute.c b/ip/iproute.c index bf0f31b..5df1eaf 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -51,6 +51,7 @@ static const char *mx_names[RTAX_MAX+1] = { [RTAX_INITCWND] = "initcwnd", [RTAX_FEATURES] = "features", [RTAX_RTO_MIN] = "rto_min", + [RTAX_INITRWND] = "initrwnd", }; static void usage(void) __attribute__((noreturn)); @@ -73,7 +74,7 @@ static void usage(void) fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ]\n"); fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"); fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n"); - fprintf(stderr, " [ rto_min TIME ]\n"); + fprintf(stderr, " [ rto_min TIME ] [ initrwnd NUMBER ]\n"); fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n"); fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n"); fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n"); @@ -842,6 +843,16 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) if (get_unsigned(&win, *argv, 0)) invarg("\"initcwnd\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITCWND, win); + } else if (matches(*argv, "initrwnd") == 0) { + unsigned win; + NEXT_ARG(); + if (strcmp(*argv, "lock") == 0) { + mxlock |= (1<