Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout()
@ 2026-07-08 18:08 Emil Tsalapatis
  2026-07-21 13:24 ` Paolo Abeni
  2026-07-21 16:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: Emil Tsalapatis @ 2026-07-08 18:08 UTC (permalink / raw)
  To: netdev; +Cc: edumazet, ncardwell, kuniyu, davem, kuba, pabeni, Emil Tsalapatis

The tcp_syn_ack_timeout() function gets inlined by Clang,
preventing tracing. Since the call is not in the fast
path, prevent it from being inlined.

Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
---
 net/ipv4/tcp_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index bf171b5e1eb3..f7215d53bbda 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -748,7 +748,7 @@ static void tcp_write_timer(struct timer_list *t)
 	sock_put(sk);
 }
 
-void tcp_syn_ack_timeout(const struct request_sock *req)
+noinline_for_tracing void tcp_syn_ack_timeout(const struct request_sock *req)
 {
 	struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout()
  2026-07-08 18:08 [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout() Emil Tsalapatis
@ 2026-07-21 13:24 ` Paolo Abeni
  2026-07-21 14:18   ` Eric Dumazet
  2026-07-21 15:12   ` Jakub Kicinski
  2026-07-21 16:20 ` patchwork-bot+netdevbpf
  1 sibling, 2 replies; 6+ messages in thread
From: Paolo Abeni @ 2026-07-21 13:24 UTC (permalink / raw)
  To: Emil Tsalapatis, netdev, edumazet; +Cc: ncardwell, kuniyu, davem, kuba

On 7/8/26 8:08 PM, Emil Tsalapatis wrote:
> The tcp_syn_ack_timeout() function gets inlined by Clang,
> preventing tracing. Since the call is not in the fast
> path, prevent it from being inlined.
> 
> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
> ---
>  net/ipv4/tcp_timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
> index bf171b5e1eb3..f7215d53bbda 100644
> --- a/net/ipv4/tcp_timer.c
> +++ b/net/ipv4/tcp_timer.c
> @@ -748,7 +748,7 @@ static void tcp_write_timer(struct timer_list *t)
>  	sock_put(sk);
>  }
>  
> -void tcp_syn_ack_timeout(const struct request_sock *req)
> +noinline_for_tracing void tcp_syn_ack_timeout(const struct request_sock *req)
>  {
>  	struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
>  

What's the point of tracing such function? It just increment a mib. If
you want to discriminate between TFO and non TFO syn ack timeout,
possibly adding another MIB counter and incrementing it in
tcp_fastopen_synack_timer() would be better???

/P


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout()
  2026-07-21 13:24 ` Paolo Abeni
@ 2026-07-21 14:18   ` Eric Dumazet
  2026-07-21 15:12   ` Jakub Kicinski
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Dumazet @ 2026-07-21 14:18 UTC (permalink / raw)
  To: Paolo Abeni; +Cc: Emil Tsalapatis, netdev, ncardwell, kuniyu, davem, kuba

On Tue, Jul 21, 2026 at 3:24 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> On 7/8/26 8:08 PM, Emil Tsalapatis wrote:
> > The tcp_syn_ack_timeout() function gets inlined by Clang,
> > preventing tracing. Since the call is not in the fast
> > path, prevent it from being inlined.
> >
> > Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
> > ---
> >  net/ipv4/tcp_timer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
> > index bf171b5e1eb3..f7215d53bbda 100644
> > --- a/net/ipv4/tcp_timer.c
> > +++ b/net/ipv4/tcp_timer.c
> > @@ -748,7 +748,7 @@ static void tcp_write_timer(struct timer_list *t)
> >       sock_put(sk);
> >  }
> >
> > -void tcp_syn_ack_timeout(const struct request_sock *req)
> > +noinline_for_tracing void tcp_syn_ack_timeout(const struct request_sock *req)
> >  {
> >       struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
> >
>
> What's the point of tracing such function? It just increment a mib. If
> you want to discriminate between TFO and non TFO syn ack timeout,
> possibly adding another MIB counter and incrementing it in
> tcp_fastopen_synack_timer() would be better???

Tracing has some merits that a MIB counter can not replace :)

Emil, next time add a link to the V1, this would have helped to
understand the motivation.

https://mail-archive.com/linux-trace-kernel@vger.kernel.org/msg24624.html

Reviewed-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout()
  2026-07-21 13:24 ` Paolo Abeni
  2026-07-21 14:18   ` Eric Dumazet
@ 2026-07-21 15:12   ` Jakub Kicinski
  2026-07-21 16:03     ` Paolo Abeni
  1 sibling, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2026-07-21 15:12 UTC (permalink / raw)
  To: Paolo Abeni; +Cc: Emil Tsalapatis, netdev, edumazet, ncardwell, kuniyu, davem

On Tue, 21 Jul 2026 15:24:52 +0200 Paolo Abeni wrote:
> On 7/8/26 8:08 PM, Emil Tsalapatis wrote:
> > The tcp_syn_ack_timeout() function gets inlined by Clang,
> > preventing tracing. Since the call is not in the fast
> > path, prevent it from being inlined.
> > 
> > Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
> > ---
> >  net/ipv4/tcp_timer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
> > index bf171b5e1eb3..f7215d53bbda 100644
> > --- a/net/ipv4/tcp_timer.c
> > +++ b/net/ipv4/tcp_timer.c
> > @@ -748,7 +748,7 @@ static void tcp_write_timer(struct timer_list *t)
> >  	sock_put(sk);
> >  }
> >  
> > -void tcp_syn_ack_timeout(const struct request_sock *req)
> > +noinline_for_tracing void tcp_syn_ack_timeout(const struct request_sock *req)
> >  {
> >  	struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
> >    
> 
> What's the point of tracing such function? It just increment a mib. If
> you want to discriminate between TFO and non TFO syn ack timeout,
> possibly adding another MIB counter and incrementing it in
> tcp_fastopen_synack_timer() would be better???

FWIW we seem to capture the 5 tuple when it happens, not just mib
counter. Internal commit (form 2019) just says we want to know when 
syn-ack is blackholed, unclear under what conditions this happens.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout()
  2026-07-21 15:12   ` Jakub Kicinski
@ 2026-07-21 16:03     ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2026-07-21 16:03 UTC (permalink / raw)
  To: Jakub Kicinski, edumazet
  Cc: Emil Tsalapatis, netdev, ncardwell, kuniyu, davem

On 7/21/26 5:12 PM, Jakub Kicinski wrote:
> On Tue, 21 Jul 2026 15:24:52 +0200 Paolo Abeni wrote:
>> On 7/8/26 8:08 PM, Emil Tsalapatis wrote:
>>> The tcp_syn_ack_timeout() function gets inlined by Clang,
>>> preventing tracing. Since the call is not in the fast
>>> path, prevent it from being inlined.
>>>
>>> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
>>> ---
>>>  net/ipv4/tcp_timer.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
>>> index bf171b5e1eb3..f7215d53bbda 100644
>>> --- a/net/ipv4/tcp_timer.c
>>> +++ b/net/ipv4/tcp_timer.c
>>> @@ -748,7 +748,7 @@ static void tcp_write_timer(struct timer_list *t)
>>>  	sock_put(sk);
>>>  }
>>>  
>>> -void tcp_syn_ack_timeout(const struct request_sock *req)
>>> +noinline_for_tracing void tcp_syn_ack_timeout(const struct request_sock *req)
>>>  {
>>>  	struct net *net = read_pnet(&inet_rsk(req)->ireq_net);
>>>    
>>
>> What's the point of tracing such function? It just increment a mib. If
>> you want to discriminate between TFO and non TFO syn ack timeout,
>> possibly adding another MIB counter and incrementing it in
>> tcp_fastopen_synack_timer() would be better???
> 
> FWIW we seem to capture the 5 tuple when it happens, not just mib
> counter. Internal commit (form 2019) just says we want to know when 
> syn-ack is blackholed, unclear under what conditions this happens.
Thanks for the context infos. I'm fine with the patch as-is.

/P


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout()
  2026-07-08 18:08 [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout() Emil Tsalapatis
  2026-07-21 13:24 ` Paolo Abeni
@ 2026-07-21 16:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-21 16:20 UTC (permalink / raw)
  To: Emil Tsalapatis; +Cc: netdev, edumazet, ncardwell, kuniyu, davem, kuba, pabeni

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed,  8 Jul 2026 14:08:37 -0400 you wrote:
> The tcp_syn_ack_timeout() function gets inlined by Clang,
> preventing tracing. Since the call is not in the fast
> path, prevent it from being inlined.
> 
> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
> ---
>  net/ipv4/tcp_timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout()
    https://git.kernel.org/netdev/net-next/c/d05338c1290e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-21 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 18:08 [PATCH net-next] net/tcp: Prevent inlining tcp_syn_ack_timeout() Emil Tsalapatis
2026-07-21 13:24 ` Paolo Abeni
2026-07-21 14:18   ` Eric Dumazet
2026-07-21 15:12   ` Jakub Kicinski
2026-07-21 16:03     ` Paolo Abeni
2026-07-21 16:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox