mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
tcp: derive delack_max with tcp_rto_min helper
Rto_min now has multiple sources, ordered by preprecedence high to low: ip route option rto_min, icsk->icsk_rto_min. When derive delack_max from rto_min, we should not only use ip route option, but should use tcp_rto_min helper to get the correct rto_min. Signed-off-by: Kevin Yang <yyd@google.com> Reviewed-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Yuchung Cheng <ycheng@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Tony Lu <tonylu@linux.alibaba.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
69e0b33a7f
commit
512bd0f9f9
1 changed files with 2 additions and 9 deletions
|
@ -4163,16 +4163,9 @@ EXPORT_SYMBOL(tcp_connect);
|
|||
|
||||
u32 tcp_delack_max(const struct sock *sk)
|
||||
{
|
||||
const struct dst_entry *dst = __sk_dst_get(sk);
|
||||
u32 delack_max = inet_csk(sk)->icsk_delack_max;
|
||||
u32 delack_from_rto_min = max(tcp_rto_min(sk), 2) - 1;
|
||||
|
||||
if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) {
|
||||
u32 rto_min = dst_metric_rtt(dst, RTAX_RTO_MIN);
|
||||
u32 delack_from_rto_min = max_t(int, 1, rto_min - 1);
|
||||
|
||||
delack_max = min_t(u32, delack_max, delack_from_rto_min);
|
||||
}
|
||||
return delack_max;
|
||||
return min(inet_csk(sk)->icsk_delack_max, delack_from_rto_min);
|
||||
}
|
||||
|
||||
/* Send out a delayed ack, the caller does the policy checking
|
||||
|
|
Loading…
Add table
Reference in a new issue