[PATCH RFC] Allow disabling of DSACK TCP option per route

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gilad Ben-Yossef
Date: Tuesday, October 20, 2009 - 8:22 am

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>

---
 include/linux/rtnetlink.h |    1 +
 net/ipv4/tcp_input.c      |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 6784b34..e78b60c 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -381,6 +381,7 @@ enum
 #define RTAX_FEATURE_NO_TSTAMP	0x00000004
 #define RTAX_FEATURE_ALLFRAG	0x00000008
 #define RTAX_FEATURE_NO_WSCALE	0x00000010
+#define RTAX_FEATURE_NO_DSACK	0x00000020
 
 struct rta_session
 {
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4f5e914..4262da5 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,
 static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
+	struct dst_entry *dst = __sk_dst_get(sk);
 
-	if (tcp_is_sack(tp) && sysctl_tcp_dsack) {
+	if (tcp_is_sack(tp) && sysctl_tcp_dsack &&
+	    !dst_feature(dst, RTAX_FEATURE_NO_DSACK)) {
 		int mib_idx;
 
 		if (before(seq, tp->rcv_nxt))
@@ -4110,13 +4112,15 @@ static void tcp_dsack_extend(struct sock *sk, u32 seq, u32 end_seq)
 static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
+	struct dst_entry *dst = __sk_dst_get(sk);
 
 	if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 	    before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
 		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);
 		tcp_enter_quickack_mode(sk);
 
-		if (tcp_is_sack(tp) && sysctl_tcp_dsack) {
+		if (tcp_is_sack(tp) && sysctl_tcp_dsack &&
+		    !dst_feature(dst, RTAX_FEATURE_NO_DSACK)) {
 			u32 end_seq = TCP_SKB_CB(skb)->end_seq;
 
 			if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC] Per route TCP options, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
[PATCH RFC] Allow tcp_parse_options to consult dst entry, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
[PATCH RFC] Add dst_feature to query route entry features, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
[PATCH RFC] Add the no SACK route option feature, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
[PATCH RFC] Allow disabling TCP timestamp options per route, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
[PATCH RFC] Allow to turn off TCP window scale opt per route, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
[PATCH RFC] Allow disabling of DSACK TCP option per route, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
[PATCH RFC] Document future removal of sysctl_tcp_* options, Gilad Ben-Yossef, (Tue Oct 20, 8:22 am)
Re: [PATCH RFC] Per route TCP options, Eric Dumazet, (Tue Oct 20, 8:44 am)
Re: [PATCH RFC] Per route TCP options, Gilad Ben-Yossef, (Tue Oct 20, 9:11 am)
Re: [PATCH RFC] Per route TCP options, Rick Jones, (Tue Oct 20, 9:26 am)
Re: [PATCH RFC] Per route TCP options, =?ISO-8859-15?Q?Ilpo ..., (Tue Oct 20, 11:53 am)
Re: [PATCH RFC] Per route TCP options, David Miller, (Tue Oct 20, 5:36 pm)
Re: [PATCH RFC] Allow to turn off TCP window scale opt per ..., Stephen Hemminger, (Tue Oct 20, 6:40 pm)
Re: [PATCH RFC] Per route TCP options, Bill Fink, (Tue Oct 20, 7:13 pm)
Re: [PATCH RFC] Per route TCP options, Gilad Ben-Yossef, (Wed Oct 21, 1:04 am)
Re: [PATCH RFC] Per route TCP options, Gilad Ben-Yossef, (Wed Oct 21, 1:10 am)
Re: [PATCH RFC] Per route TCP options, Gilad Ben-Yossef, (Wed Oct 21, 1:15 am)
Re: [PATCH RFC] Per route TCP options, Florian Westphal, (Wed Oct 21, 1:21 am)
Re: [PATCH RFC] Per route TCP options, Gilad Ben-Yossef, (Wed Oct 21, 1:27 am)
Re: [PATCH RFC] Per route TCP options, Gilad Ben-Yossef, (Wed Oct 21, 1:40 am)