[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>
This commit is contained in:
committed by
David S. Miller
parent
caa20d9abe
commit
6a438bbe68
@@ -307,6 +307,21 @@ struct tcp_sock {
|
||||
struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
|
||||
struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
|
||||
|
||||
struct tcp_sack_block recv_sack_cache[4];
|
||||
|
||||
/* from STCP, retrans queue hinting */
|
||||
struct sk_buff* lost_skb_hint;
|
||||
|
||||
struct sk_buff *scoreboard_skb_hint;
|
||||
struct sk_buff *retransmit_skb_hint;
|
||||
struct sk_buff *forward_skb_hint;
|
||||
struct sk_buff *fastpath_skb_hint;
|
||||
|
||||
int fastpath_cnt_hint;
|
||||
int lost_cnt_hint;
|
||||
int retransmit_cnt_hint;
|
||||
int forward_cnt_hint;
|
||||
|
||||
__u16 advmss; /* Advertised MSS */
|
||||
__u16 prior_ssthresh; /* ssthresh saved at recovery start */
|
||||
__u32 lost_out; /* Lost packets */
|
||||
|
||||
@@ -1247,6 +1247,12 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk)
|
||||
(skb != (struct sk_buff *)&(sk)->sk_write_queue); \
|
||||
skb = skb->next)
|
||||
|
||||
/*from STCP for fast SACK Process*/
|
||||
#define sk_stream_for_retrans_queue_from(skb, sk) \
|
||||
for (; (skb != (sk)->sk_send_head) && \
|
||||
(skb != (struct sk_buff *)&(sk)->sk_write_queue); \
|
||||
skb = skb->next)
|
||||
|
||||
/*
|
||||
* Default write policy as shown to user space via poll/select/SIGIO
|
||||
*/
|
||||
|
||||
@@ -1207,6 +1207,15 @@ static inline void tcp_mib_init(void)
|
||||
TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1);
|
||||
}
|
||||
|
||||
/*from STCP */
|
||||
static inline void clear_all_retrans_hints(struct tcp_sock *tp){
|
||||
tp->lost_skb_hint = NULL;
|
||||
tp->scoreboard_skb_hint = NULL;
|
||||
tp->retransmit_skb_hint = NULL;
|
||||
tp->forward_skb_hint = NULL;
|
||||
tp->fastpath_skb_hint = NULL;
|
||||
}
|
||||
|
||||
/* /proc */
|
||||
enum tcp_seq_states {
|
||||
TCP_SEQ_STATE_LISTENING,
|
||||
|
||||
Reference in New Issue
Block a user