diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-11-10 20:14:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-10 20:14:59 -0500 |
commit | 6a438bbe68c7013a42d9c5aee5a40d7dafdbe6ec (patch) | |
tree | 09775f0479168cd53494155a5789e78df218b497 /include | |
parent | caa20d9abe810be2ede9612b6c9db6ce7d6edf80 (diff) |
[TCP]: speed up SACK processing
Use "hints" to speed up the SACK processing. Various forms
of this have been used by TCP developers (Web100, STCP, BIC)
to avoid the 2x linear search of outstanding segments.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tcp.h | 15 | ||||
-rw-r--r-- | include/net/sock.h | 6 | ||||
-rw-r--r-- | include/net/tcp.h | 9 |
3 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 737b32e52956..0e1da6602e05 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -307,6 +307,21 @@ struct tcp_sock { | |||
307 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ | 307 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ |
308 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ | 308 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ |
309 | 309 | ||
310 | struct tcp_sack_block recv_sack_cache[4]; | ||
311 | |||
312 | /* from STCP, retrans queue hinting */ | ||
313 | struct sk_buff* lost_skb_hint; | ||
314 | |||
315 | struct sk_buff *scoreboard_skb_hint; | ||
316 | struct sk_buff *retransmit_skb_hint; | ||
317 | struct sk_buff *forward_skb_hint; | ||
318 | struct sk_buff *fastpath_skb_hint; | ||
319 | |||
320 | int fastpath_cnt_hint; | ||
321 | int lost_cnt_hint; | ||
322 | int retransmit_cnt_hint; | ||
323 | int forward_cnt_hint; | ||
324 | |||
310 | __u16 advmss; /* Advertised MSS */ | 325 | __u16 advmss; /* Advertised MSS */ |
311 | __u16 prior_ssthresh; /* ssthresh saved at recovery start */ | 326 | __u16 prior_ssthresh; /* ssthresh saved at recovery start */ |
312 | __u32 lost_out; /* Lost packets */ | 327 | __u32 lost_out; /* Lost packets */ |
diff --git a/include/net/sock.h b/include/net/sock.h index ff13c4cc287a..982b4ecd187b 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1247,6 +1247,12 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk) | |||
1247 | (skb != (struct sk_buff *)&(sk)->sk_write_queue); \ | 1247 | (skb != (struct sk_buff *)&(sk)->sk_write_queue); \ |
1248 | skb = skb->next) | 1248 | skb = skb->next) |
1249 | 1249 | ||
1250 | /*from STCP for fast SACK Process*/ | ||
1251 | #define sk_stream_for_retrans_queue_from(skb, sk) \ | ||
1252 | for (; (skb != (sk)->sk_send_head) && \ | ||
1253 | (skb != (struct sk_buff *)&(sk)->sk_write_queue); \ | ||
1254 | skb = skb->next) | ||
1255 | |||
1250 | /* | 1256 | /* |
1251 | * Default write policy as shown to user space via poll/select/SIGIO | 1257 | * Default write policy as shown to user space via poll/select/SIGIO |
1252 | */ | 1258 | */ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 6e6f0f3f1dd8..0f9848011972 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1207,6 +1207,15 @@ static inline void tcp_mib_init(void) | |||
1207 | TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1); | 1207 | TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1); |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | /*from STCP */ | ||
1211 | static inline void clear_all_retrans_hints(struct tcp_sock *tp){ | ||
1212 | tp->lost_skb_hint = NULL; | ||
1213 | tp->scoreboard_skb_hint = NULL; | ||
1214 | tp->retransmit_skb_hint = NULL; | ||
1215 | tp->forward_skb_hint = NULL; | ||
1216 | tp->fastpath_skb_hint = NULL; | ||
1217 | } | ||
1218 | |||
1210 | /* /proc */ | 1219 | /* /proc */ |
1211 | enum tcp_seq_states { | 1220 | enum tcp_seq_states { |
1212 | TCP_SEQ_STATE_LISTENING, | 1221 | TCP_SEQ_STATE_LISTENING, |