diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-11-25 00:11:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 00:11:55 -0500 |
commit | e1aa680fa40e7492260a09cb57d94002245cc8fe (patch) | |
tree | 67afc8d71c9de6f76036942cd442d628ae26a4f3 /net/ipv4/tcp_input.c | |
parent | 4a17fc3add594fcc1c778e93a95b6ecf47f630e5 (diff) |
tcp: move tcp_simple_retransmit to tcp_input
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 097294b7da3e..8085704863fb 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1002,7 +1002,8 @@ static void tcp_skb_mark_lost(struct tcp_sock *tp, struct sk_buff *skb) | |||
1002 | } | 1002 | } |
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb) | 1005 | static void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, |
1006 | struct sk_buff *skb) | ||
1006 | { | 1007 | { |
1007 | tcp_verify_retransmit_hint(tp, skb); | 1008 | tcp_verify_retransmit_hint(tp, skb); |
1008 | 1009 | ||
@@ -2559,6 +2560,56 @@ static void tcp_mtup_probe_success(struct sock *sk, struct sk_buff *skb) | |||
2559 | tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); | 2560 | tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); |
2560 | } | 2561 | } |
2561 | 2562 | ||
2563 | /* Do a simple retransmit without using the backoff mechanisms in | ||
2564 | * tcp_timer. This is used for path mtu discovery. | ||
2565 | * The socket is already locked here. | ||
2566 | */ | ||
2567 | void tcp_simple_retransmit(struct sock *sk) | ||
2568 | { | ||
2569 | const struct inet_connection_sock *icsk = inet_csk(sk); | ||
2570 | struct tcp_sock *tp = tcp_sk(sk); | ||
2571 | struct sk_buff *skb; | ||
2572 | unsigned int mss = tcp_current_mss(sk, 0); | ||
2573 | u32 prior_lost = tp->lost_out; | ||
2574 | |||
2575 | tcp_for_write_queue(skb, sk) { | ||
2576 | if (skb == tcp_send_head(sk)) | ||
2577 | break; | ||
2578 | if (skb->len > mss && | ||
2579 | !(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) { | ||
2580 | if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) { | ||
2581 | TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS; | ||
2582 | tp->retrans_out -= tcp_skb_pcount(skb); | ||
2583 | } | ||
2584 | tcp_skb_mark_lost_uncond_verify(tp, skb); | ||
2585 | } | ||
2586 | } | ||
2587 | |||
2588 | tcp_clear_retrans_hints_partial(tp); | ||
2589 | |||
2590 | if (prior_lost == tp->lost_out) | ||
2591 | return; | ||
2592 | |||
2593 | if (tcp_is_reno(tp)) | ||
2594 | tcp_limit_reno_sacked(tp); | ||
2595 | |||
2596 | tcp_verify_left_out(tp); | ||
2597 | |||
2598 | /* Don't muck with the congestion window here. | ||
2599 | * Reason is that we do not increase amount of _data_ | ||
2600 | * in network, but units changed and effective | ||
2601 | * cwnd/ssthresh really reduced now. | ||
2602 | */ | ||
2603 | if (icsk->icsk_ca_state != TCP_CA_Loss) { | ||
2604 | tp->high_seq = tp->snd_nxt; | ||
2605 | tp->snd_ssthresh = tcp_current_ssthresh(sk); | ||
2606 | tp->prior_ssthresh = 0; | ||
2607 | tp->undo_marker = 0; | ||
2608 | tcp_set_ca_state(sk, TCP_CA_Loss); | ||
2609 | } | ||
2610 | tcp_xmit_retransmit_queue(sk); | ||
2611 | } | ||
2612 | |||
2562 | /* Process an event, which can update packets-in-flight not trivially. | 2613 | /* Process an event, which can update packets-in-flight not trivially. |
2563 | * Main goal of this function is to calculate new estimate for left_out, | 2614 | * Main goal of this function is to calculate new estimate for left_out, |
2564 | * taking into account both packets sitting in receiver's buffer and | 2615 | * taking into account both packets sitting in receiver's buffer and |