mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
tcp: share code through function, not through copy-paste. :-)
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ee6aac5950
commit
41834b7332
@ -3052,6 +3052,13 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, int flag)
|
|||||||
tcp_xmit_retransmit_queue(sk);
|
tcp_xmit_retransmit_queue(sk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt)
|
||||||
|
{
|
||||||
|
tcp_rtt_estimator(sk, seq_rtt);
|
||||||
|
tcp_set_rto(sk);
|
||||||
|
inet_csk(sk)->icsk_backoff = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Read draft-ietf-tcplw-high-performance before mucking
|
/* Read draft-ietf-tcplw-high-performance before mucking
|
||||||
* with this code. (Supersedes RFC1323)
|
* with this code. (Supersedes RFC1323)
|
||||||
*/
|
*/
|
||||||
@ -3073,10 +3080,8 @@ static void tcp_ack_saw_tstamp(struct sock *sk, int flag)
|
|||||||
* in window is lost... Voila. --ANK (010210)
|
* in window is lost... Voila. --ANK (010210)
|
||||||
*/
|
*/
|
||||||
struct tcp_sock *tp = tcp_sk(sk);
|
struct tcp_sock *tp = tcp_sk(sk);
|
||||||
const __u32 seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
|
|
||||||
tcp_rtt_estimator(sk, seq_rtt);
|
tcp_valid_rtt_meas(sk, tcp_time_stamp - tp->rx_opt.rcv_tsecr);
|
||||||
tcp_set_rto(sk);
|
|
||||||
inet_csk(sk)->icsk_backoff = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tcp_ack_no_tstamp(struct sock *sk, u32 seq_rtt, int flag)
|
static void tcp_ack_no_tstamp(struct sock *sk, u32 seq_rtt, int flag)
|
||||||
@ -3093,9 +3098,7 @@ static void tcp_ack_no_tstamp(struct sock *sk, u32 seq_rtt, int flag)
|
|||||||
if (flag & FLAG_RETRANS_DATA_ACKED)
|
if (flag & FLAG_RETRANS_DATA_ACKED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tcp_rtt_estimator(sk, seq_rtt);
|
tcp_valid_rtt_meas(sk, seq_rtt);
|
||||||
tcp_set_rto(sk);
|
|
||||||
inet_csk(sk)->icsk_backoff = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void tcp_ack_update_rtt(struct sock *sk, const int flag,
|
static inline void tcp_ack_update_rtt(struct sock *sk, const int flag,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user