From: Eric Dumazet Date: Fri, 13 Nov 2020 15:08:09 +0000 (-0800) Subject: tcp: avoid indirect call to tcp_stream_memory_free() X-Git-Tag: accepted/tizen/unified/20230118.172025~8321^2~254^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c5f2ced136a7196c41ca2c16b8c2646e9b042ce;p=platform%2Fkernel%2Flinux-rpi.git tcp: avoid indirect call to tcp_stream_memory_free() Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski --- diff --git a/include/net/sock.h b/include/net/sock.h index a5c6ae7..1d29aea 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -60,7 +60,7 @@ #include #include #include - +#include #include #include #include @@ -1264,13 +1264,17 @@ static inline void sk_refcnt_debug_release(const struct sock *sk) #define sk_refcnt_debug_release(sk) do { } while (0) #endif /* SOCK_REFCNT_DEBUG */ +INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int wake)); + static inline bool __sk_stream_memory_free(const struct sock *sk, int wake) { if (READ_ONCE(sk->sk_wmem_queued) >= READ_ONCE(sk->sk_sndbuf)) return false; return sk->sk_prot->stream_memory_free ? - sk->sk_prot->stream_memory_free(sk, wake) : true; + INDIRECT_CALL_1(sk->sk_prot->stream_memory_free, + tcp_stream_memory_free, + sk, wake) : true; } static inline bool sk_stream_memory_free(const struct sock *sk)