From b4d1efcf1d4384296d6d6b4f8378f8c408cefc98 Mon Sep 17 00:00:00 2001 From: =?ISO-8859-1?q?Ilpo=20J=E4rvinen?= Date: Tue, 19 Aug 2008 08:20:16 +0300 Subject: [PATCH] tcp/frto: make frto per route configurable MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Needs iproute2 support since it isn't able to set RTAX_FEATURES currently (ie., also the other TCP variant related RTAX_FEATUREs won't work, they've been unused since the addition in 2003 or so). Signed-off-by: Ilpo Järvinen --- include/linux/rtnetlink.h | 1 + net/ipv4/tcp_input.c | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index f4d386c..e628062 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -373,6 +373,7 @@ enum #define RTAX_FEATURE_SACK 0x00000002 #define RTAX_FEATURE_TIMESTAMP 0x00000004 #define RTAX_FEATURE_ALLFRAG 0x00000008 +#define RTAX_FEATURE_FRTO 0x00000010 struct rta_session { diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 1f5e604..4f1cc0e 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1709,11 +1709,15 @@ int tcp_use_frto(struct sock *sk) { const struct tcp_sock *tp = tcp_sk(sk); const struct inet_connection_sock *icsk = inet_csk(sk); + struct dst_entry *dst = __sk_dst_get(sk); struct sk_buff *skb; if (!sysctl_tcp_frto) return 0; + if (dst && (dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_FRTO)) + return 0; + /* MTU probe and F-RTO won't really play nicely along currently */ if (icsk->icsk_mtup.probe_size) return 0; -- 1.5.2.2