[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9ecd6a0-74da-4f68-81ec-5c2d5b937926@kernel.org>
Date: Wed, 14 May 2025 09:46:30 -0600
From: David Ahern <dsahern@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Neal Cardwell <ncardwell@...gle.com>, Simon Horman <horms@...nel.org>,
Kuniyuki Iwashima <kuniyu@...zon.com>, Rick Jones <jonesrick@...gle.com>,
Wei Wang <weiwan@...gle.com>, netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 01/11] tcp: add tcp_rcvbuf_grow() tracepoint
On 5/14/25 9:38 AM, Eric Dumazet wrote:
> On Wed, May 14, 2025 at 8:30 AM David Ahern <dsahern@...nel.org> wrote:
>>
>> On 5/13/25 1:39 PM, Eric Dumazet wrote:
>>> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
>>> index a35018e2d0ba27b14d0b59d3728f7181b1a51161..88beb6d0f7b5981e65937a6727a1111fd341335b 100644
>>> --- a/net/ipv4/tcp_input.c
>>> +++ b/net/ipv4/tcp_input.c
>>> @@ -769,6 +769,8 @@ void tcp_rcv_space_adjust(struct sock *sk)
>>> if (copied <= tp->rcvq_space.space)
>>> goto new_measure;
>>>
>>> + trace_tcp_rcvbuf_grow(sk, time);
>>
>> tracepoints typically take on the name of the function. Patch 2 moves a
>> lot of logic from tcp_rcv_space_adjust to tcp_rcvbuf_grow but does not
>> move this tracepoint into it. For sake of consistency, why not do that -
>> and add this patch after the code move?
>
> Prior value is needed in the tracepoint, but in patch 2, I call
> tcp_rcvbuf_grow() after it is overwritten.
>
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8ec92dec321a..6bfbe9005fdb 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -744,12 +744,16 @@ static inline void tcp_rcv_rtt_measure_ts(struct
sock *sk,
}
}
-static void tcp_rcvbuf_grow(struct sock *sk)
+static void tcp_rcvbuf_grow(struct sock *sk, int time, int copied)
{
const struct net *net = sock_net(sk);
struct tcp_sock *tp = tcp_sk(sk);
int rcvwin, rcvbuf, cap;
+ trace_tcp_rcvbuf_grow(sk, time);
+
+ tp->rcvq_space.space = copied;
+
if (!READ_ONCE(net->ipv4.sysctl_tcp_moderate_rcvbuf) ||
(sk->sk_userlocks & SOCK_RCVBUF_LOCK))
return;
@@ -794,11 +798,7 @@ void tcp_rcv_space_adjust(struct sock *sk)
if (copied <= tp->rcvq_space.space)
goto new_measure;
- trace_tcp_rcvbuf_grow(sk, time);
-
- tp->rcvq_space.space = copied;
-
- tcp_rcvbuf_grow(sk);
+ tcp_rcvbuf_grow(sk, time, copied);
new_measure:
tp->rcvq_space.seq = tp->copied_seq;
Powered by blists - more mailing lists