aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@codefidence.com>2009-10-28 00:15:27 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-29 04:28:48 -0400
commitdc343475ed062e13fc260acccaab91d7d80fd5b2 (patch)
treea7bf4c52a5a65e579b397000624f416294777a96
parent345cda2fd695534be5a4494f1b59da9daed33663 (diff)
Allow disabling of DSACK TCP option per route
Add and use no DSCAK bit in the features field. Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com> Sigend-off-by: Ori Finkelman <ori@comsleep.com> Sigend-off-by: Yony Amit <yony@comsleep.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--net/ipv4/tcp_input.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 6784b342cbbf..e78b60cd65a4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -381,6 +381,7 @@ enum
381#define RTAX_FEATURE_NO_TSTAMP 0x00000004 381#define RTAX_FEATURE_NO_TSTAMP 0x00000004
382#define RTAX_FEATURE_ALLFRAG 0x00000008 382#define RTAX_FEATURE_ALLFRAG 0x00000008
383#define RTAX_FEATURE_NO_WSCALE 0x00000010 383#define RTAX_FEATURE_NO_WSCALE 0x00000010
384#define RTAX_FEATURE_NO_DSACK 0x00000020
384 385
385struct rta_session 386struct rta_session
386{ 387{
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 393c56921dcb..ba0eab65fe80 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4080,8 +4080,10 @@ static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq,
4080static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq) 4080static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq)
4081{ 4081{
4082 struct tcp_sock *tp = tcp_sk(sk); 4082 struct tcp_sock *tp = tcp_sk(sk);
4083 struct dst_entry *dst = __sk_dst_get(sk);
4083 4084
4084 if (tcp_is_sack(tp) && sysctl_tcp_dsack) { 4085 if (tcp_is_sack(tp) && sysctl_tcp_dsack &&
4086 !dst_feature(dst, RTAX_FEATURE_NO_DSACK)) {
4085 int mib_idx; 4087 int mib_idx;
4086 4088
4087 if (before(seq, tp->rcv_nxt)) 4089 if (before(seq, tp->rcv_nxt))
@@ -4110,13 +4112,15 @@ static void tcp_dsack_extend(struct sock *sk, u32 seq, u32 end_seq)
4110static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb) 4112static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb)
4111{ 4113{
4112 struct tcp_sock *tp = tcp_sk(sk); 4114 struct tcp_sock *tp = tcp_sk(sk);
4115 struct dst_entry *dst = __sk_dst_get(sk);
4113 4116
4114 if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && 4117 if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
4115 before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { 4118 before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
4116 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST); 4119 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);
4117 tcp_enter_quickack_mode(sk); 4120 tcp_enter_quickack_mode(sk);
4118 4121
4119 if (tcp_is_sack(tp) && sysctl_tcp_dsack) { 4122 if (tcp_is_sack(tp) && sysctl_tcp_dsack &&
4123 !dst_feature(dst, RTAX_FEATURE_NO_DSACK)) {
4120 u32 end_seq = TCP_SKB_CB(skb)->end_seq; 4124 u32 end_seq = TCP_SKB_CB(skb)->end_seq;
4121 4125
4122 if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) 4126 if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))