[PATCH net-next] tcp: avoid indirect call in tcp_new_space()

Subsystems: networking [general], networking [tcp], the rest

STALE1869d

2 messages, 2 authors, 2021-07-21 · open the first message on its own page

[PATCH net-next] tcp: avoid indirect call in tcp_new_space()

From: Eric Dumazet <hidden>
Date: 2021-07-21 09:20:24

From: Eric Dumazet <edumazet@google.com>

For tcp sockets, sk->sk_write_space is most probably sk_stream_write_space().

Other sk->sk_write_space() calls in TCP are slow path and do not deserve
any change.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 149ceb5c94ffcd4499d3054fae31bd296a9e0bcd..bef2c8b64d83a0f3d4cca90f9b12912bf3d00807 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5383,7 +5383,7 @@ static void tcp_new_space(struct sock *sk)
 		tp->snd_cwnd_stamp = tcp_jiffies32;
 	}
 
-	sk->sk_write_space(sk);
+	INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);
 }
 
 static void tcp_check_space(struct sock *sk)
-- 
2.32.0.402.g57bb445576-goog

Re: [PATCH net-next] tcp: avoid indirect call in tcp_new_space()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-07-21 16:10:11

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed, 21 Jul 2021 02:06:14 -0700 you wrote:
From: Eric Dumazet <edumazet@google.com>

For tcp sockets, sk->sk_write_space is most probably sk_stream_write_space().

Other sk->sk_write_space() calls in TCP are slow path and do not deserve
any change.

[...]
Here is the summary with links:
  - [net-next] tcp: avoid indirect call in tcp_new_space()
    https://git.kernel.org/netdev/net-next/c/739b2adf99e9

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help