From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann 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> Cc: hannes@stressinduktion.org, fw@strlen.de, netdev@vger.kernel.org To: stephen@networkplumber.org Return-path: 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 Sender: netdev-owner@vger.kernel.org List-ID: 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<