From 3297a3cbdcf0000f00bf40920e3cc33ec82f2582 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Tue, 7 May 2024 11:17:16 +0800 Subject: [PATCH] use __tcp_space_from_win TODO Signed-off-by: Geliang Tang --- net/ipv4/tcp_input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 4ccfec4bb6248..a9329b072b94b 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -237,9 +237,8 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb) * when we update icsk_ack.rcv_mss. */ if (unlikely(len != icsk->icsk_ack.rcv_mss)) { - u64 val = (u64)skb->len << TCP_RMEM_TO_WIN_SCALE; + u64 val = __tcp_space_from_win(skb->truesize, skb->len); - do_div(val, skb->truesize); tcp_sk(sk)->scaling_ratio = val ? val : 1; } icsk->icsk_ack.rcv_mss = min_t(unsigned int, len,