Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134979
b: refs/heads/master
c: 7363a5b
h: refs/heads/master
i:
  134977: 39a7afc
  134975: 6f11aec
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Mar 2, 2009
1 parent 5217b52 commit fb53e25
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0af4160d19ff2849386140881e729f9ba86f2aa
refs/heads/master: 7363a5b233734dba339f2874ff6ed6c489d3d865
63 changes: 39 additions & 24 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,44 @@ static int tcp_time_to_recover(struct sock *sk)
return 0;
}

/* New heuristics: it is possible only after we switched to restart timer
* each time when something is ACKed. Hence, we can detect timed out packets
* during fast retransmit without falling to slow start.
*
* Usefulness of this as is very questionable, since we should know which of
* the segments is the next to timeout which is relatively expensive to find
* in general case unless we add some data structure just for that. The
* current approach certainly won't find the right one too often and when it
* finally does find _something_ it usually marks large part of the window
* right away (because a retransmission with a larger timestamp blocks the
* loop from advancing). -ij
*/
static void tcp_timeout_skbs(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;

if (!tcp_is_fack(tp) || !tcp_head_timedout(sk))
return;

skb = tp->scoreboard_skb_hint;
if (tp->scoreboard_skb_hint == NULL)
skb = tcp_write_queue_head(sk);

tcp_for_write_queue_from(skb, sk) {
if (skb == tcp_send_head(sk))
break;
if (!tcp_skb_timedout(sk, skb))
break;

tcp_skb_mark_lost(tp, skb);
}

tp->scoreboard_skb_hint = skb;

tcp_verify_left_out(tp);
}

/* Mark head of queue up as lost. With RFC3517 SACK, the packets is
* is against sacked "cnt", otherwise it's against facked "cnt"
*/
Expand Down Expand Up @@ -2533,30 +2571,7 @@ static void tcp_update_scoreboard(struct sock *sk, int fast_rexmit)
tcp_mark_head_lost(sk, sacked_upto);
}

/* New heuristics: it is possible only after we switched
* to restart timer each time when something is ACKed.
* Hence, we can detect timed out packets during fast
* retransmit without falling to slow start.
*/
if (tcp_is_fack(tp) && tcp_head_timedout(sk)) {
struct sk_buff *skb;

skb = tp->scoreboard_skb_hint ? tp->scoreboard_skb_hint
: tcp_write_queue_head(sk);

tcp_for_write_queue_from(skb, sk) {
if (skb == tcp_send_head(sk))
break;
if (!tcp_skb_timedout(sk, skb))
break;

tcp_skb_mark_lost(tp, skb);
}

tp->scoreboard_skb_hint = skb;

tcp_verify_left_out(tp);
}
tcp_timeout_skbs(sk);
}

/* CWND moderation, preventing bursts due to too big ACKs
Expand Down

0 comments on commit fb53e25

Please sign in to comment.