From patchwork Fri Dec 5 15:28:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Borkmann X-Patchwork-Id: 418149 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 5BB5F1400E7 for ; Sat, 6 Dec 2014 02:29:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751009AbaLEP3A (ORCPT ); Fri, 5 Dec 2014 10:29:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51566 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbaLEP27 (ORCPT ); Fri, 5 Dec 2014 10:28:59 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB5FSLZD023591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Dec 2014 10:28:21 -0500 Received: from localhost (vpn1-7-97.ams2.redhat.com [10.36.7.97]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sB5FSJgb032510; Fri, 5 Dec 2014 10:28:20 -0500 From: Daniel Borkmann To: stephen@networkplumber.org Cc: hannes@stressinduktion.org, fw@strlen.de, netdev@vger.kernel.org Subject: [PATCH iproute2 -next] ip: route: add congestion control setting Date: Fri, 5 Dec 2014 16:28:18 +0100 Message-Id: <1417793298-6439-1-git-send-email-dborkman@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds configuration and dumping of congestion control metric for ip route, f.e.: ip route add dev congctl [lock] Signed-off-by: Daniel Borkmann --- Stephen, this patch is already rebased on top of Florian's ECN patch [1]. Thanks! [1] http://patchwork.ozlabs.org/patch/407729/ include/linux/rtnetlink.h | 2 ++ ip/iproute.c | 24 +++++++++++++++++++++--- man/man8/ip-route.8.in | 25 ++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index ae23d94..0c68a1a 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -390,6 +390,8 @@ enum { #define RTAX_INITRWND RTAX_INITRWND RTAX_QUICKACK, #define RTAX_QUICKACK RTAX_QUICKACK + RTAX_CC_ALGO, +#define RTAX_CC_ALGO RTAX_CC_ALGO __RTAX_MAX }; diff --git a/ip/iproute.c b/ip/iproute.c index 5a496a9..18f7de7 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -53,6 +53,7 @@ static const char *mx_names[RTAX_MAX+1] = { [RTAX_RTO_MIN] = "rto_min", [RTAX_INITRWND] = "initrwnd", [RTAX_QUICKACK] = "quickack", + [RTAX_CC_ALGO] = "congctl", }; static void usage(void) __attribute__((noreturn)); @@ -80,8 +81,7 @@ static void usage(void) fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"); fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n"); fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] [ initrwnd NUMBER ]\n"); - fprintf(stderr, " [ features FEATURES ]\n"); - fprintf(stderr, " [ quickack BOOL ]\n"); + fprintf(stderr, " [ features FEATURES ] [ quickack BOOL ] [ congctl NAME ]\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"); @@ -545,10 +545,12 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) fprintf(fp, " %s", mx_names[i]); else fprintf(fp, " metric %d", i); + if (mxlock & (1<