From: Eric Dumazet Date: Wed, 21 Jul 2021 09:06:14 +0000 (-0700) Subject: tcp: avoid indirect call in tcp_new_space() X-Git-Tag: xarray-5.18~1187^2~426 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=739b2adf99e99f076601df412ec9aa92302c701f;p=users%2Fwilly%2Fxarray.git tcp: avoid indirect call in tcp_new_space() 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 Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 149ceb5c94ff..bef2c8b64d83 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)