Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67079
b: refs/heads/master
c: 4cd8299
h: refs/heads/master
i:
  67077: c1a22a7
  67075: 2d61ec1
  67071: b1e4fa7
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Oct 12, 2007
1 parent 8466eee commit 46a7042
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 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: d193594299064d386a2705928cd61ab2ca3d7cee
refs/heads/master: 4cd829995b86e0359796780d43d2f210cb5cf021
26 changes: 16 additions & 10 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,18 +1711,23 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
tcp_clear_retrans_hints_partial(tp);
}

void tcp_clear_retrans(struct tcp_sock *tp)
static void tcp_clear_retrans_partial(struct tcp_sock *tp)
{
tp->retrans_out = 0;

tp->fackets_out = 0;
tp->sacked_out = 0;
tp->lost_out = 0;

tp->undo_marker = 0;
tp->undo_retrans = 0;
}

void tcp_clear_retrans(struct tcp_sock *tp)
{
tcp_clear_retrans_partial(tp);

tp->fackets_out = 0;
tp->sacked_out = 0;
}

/* Enter Loss state. If "how" is not zero, forget all SACK information
* and reset tags completely, otherwise preserve SACKs. If receiver
* dropped its ofo queue, we will know this due to reneging detection.
Expand All @@ -1732,7 +1737,6 @@ void tcp_enter_loss(struct sock *sk, int how)
const struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
int cnt = 0;

/* Reduce ssthresh if it has not yet been made inside this window. */
if (icsk->icsk_ca_state <= TCP_CA_Disorder || tp->snd_una == tp->high_seq ||
Expand All @@ -1746,31 +1750,33 @@ void tcp_enter_loss(struct sock *sk, int how)
tp->snd_cwnd_stamp = tcp_time_stamp;

tp->bytes_acked = 0;
tcp_clear_retrans(tp);
tcp_clear_retrans_partial(tp);

if (tcp_is_reno(tp))
tcp_reset_reno_sack(tp);

if (!how) {
/* Push undo marker, if it was plain RTO and nothing
* was retransmitted. */
tp->undo_marker = tp->snd_una;
tcp_clear_retrans_hints_partial(tp);
} else {
tp->sacked_out = 0;
tp->fackets_out = 0;
tcp_clear_all_retrans_hints(tp);
}

tcp_for_write_queue(skb, sk) {
if (skb == tcp_send_head(sk))
break;
cnt += tcp_skb_pcount(skb);

if (TCP_SKB_CB(skb)->sacked&TCPCB_RETRANS)
tp->undo_marker = 0;
TCP_SKB_CB(skb)->sacked &= (~TCPCB_TAGBITS)|TCPCB_SACKED_ACKED;
if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED) || how) {
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_ACKED;
TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
tp->lost_out += tcp_skb_pcount(skb);
} else {
tp->sacked_out += tcp_skb_pcount(skb);
tp->fackets_out = cnt;
}
}
tcp_verify_left_out(tp);
Expand Down

0 comments on commit 46a7042

Please sign in to comment.