aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDamian Lukowski <damian@tvk.rwth-aachen.de>2009-08-25 20:16:31 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-01 05:45:42 -0400
commitf1ecd5d9e7366609d640ff4040304ea197fbc618 (patch)
treeef4901d52ad0d2555094998f02d08788e197c20a /include/net
parent4d1a2d9ec1c17df077ed09a0d135bccf5637a3b7 (diff)
Revert Backoff [v3]: Revert RTO on ICMP destination unreachable
Here, an ICMP host/network unreachable message, whose payload fits to TCP's SND.UNA, is taken as an indication that the RTO retransmission has not been lost due to congestion, but because of a route failure somewhere along the path. With true congestion, a router won't trigger such a message and the patched TCP will operate as standard TCP. This patch reverts one RTO backoff, if an ICMP host/network unreachable message, whose payload fits to TCP's SND.UNA, arrives. Based on the new RTO, the retransmission timer is reset to reflect the remaining time, or - if the revert clocked out the timer - a retransmission is sent out immediately. Backoffs are only reverted, if TCP is in RTO loss recovery, i.e. if there have been retransmissions and reversible backoffs, already. Changes from v2: 1) Renaming of skb in tcp_v4_err() moved to another patch. 2) Reintroduced tcp_bound_rto() and __tcp_set_rto(). 3) Fixed code comments. Signed-off-by: Damian Lukowski <damian@tvk.rwth-aachen.de> Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/tcp.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cbb2a4889fc9..54f212ce8aaf 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -469,6 +469,7 @@ extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
469 int nonagle); 469 int nonagle);
470extern int tcp_may_send_now(struct sock *sk); 470extern int tcp_may_send_now(struct sock *sk);
471extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); 471extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
472extern void tcp_retransmit_timer(struct sock *sk);
472extern void tcp_xmit_retransmit_queue(struct sock *); 473extern void tcp_xmit_retransmit_queue(struct sock *);
473extern void tcp_simple_retransmit(struct sock *); 474extern void tcp_simple_retransmit(struct sock *);
474extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); 475extern int tcp_trim_head(struct sock *, struct sk_buff *, u32);
@@ -521,6 +522,17 @@ extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
521extern int tcp_mss_to_mtu(struct sock *sk, int mss); 522extern int tcp_mss_to_mtu(struct sock *sk, int mss);
522extern void tcp_mtup_init(struct sock *sk); 523extern void tcp_mtup_init(struct sock *sk);
523 524
525static inline void tcp_bound_rto(const struct sock *sk)
526{
527 if (inet_csk(sk)->icsk_rto > TCP_RTO_MAX)
528 inet_csk(sk)->icsk_rto = TCP_RTO_MAX;
529}
530
531static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
532{
533 return (tp->srtt >> 3) + tp->rttvar;
534}
535
524static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) 536static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
525{ 537{
526 tp->pred_flags = htonl((tp->tcp_header_len << 26) | 538 tp->pred_flags = htonl((tp->tcp_header_len << 26) |