Commit dc343475ed062e13fc260acccaab91d7d80fd5b2
Committed by
David S. Miller
1 parent
345cda2fd6
Exists in
master
and in
7 other branches
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>
Showing 2 changed files with 7 additions and 2 deletions Side-by-side Diff
include/linux/rtnetlink.h
net/ipv4/tcp_input.c
... | ... | @@ -4080,8 +4080,10 @@ |
4080 | 4080 | static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq) |
4081 | 4081 | { |
4082 | 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 | 4087 | int mib_idx; |
4086 | 4088 | |
4087 | 4089 | if (before(seq, tp->rcv_nxt)) |
4088 | 4090 | |
... | ... | @@ -4110,13 +4112,15 @@ |
4110 | 4112 | static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb) |
4111 | 4113 | { |
4112 | 4114 | struct tcp_sock *tp = tcp_sk(sk); |
4115 | + struct dst_entry *dst = __sk_dst_get(sk); | |
4113 | 4116 | |
4114 | 4117 | if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && |
4115 | 4118 | before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { |
4116 | 4119 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST); |
4117 | 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 | 4124 | u32 end_seq = TCP_SKB_CB(skb)->end_seq; |
4121 | 4125 | |
4122 | 4126 | if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) |