From cd7e4b1e479622ffc117bc7215c0796d7acb8dd1 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Thu, 17 Sep 2026 16:42:06 +0800 Subject: [PATCH] tls: drop duplicate check_app_limited in tls_push_sg Before commit c5c37af6ecad9 ("tcp: Convert do_tcp_sendpages() to use MSG_SPLICE_PAGES"), do_tcp_sendpages() did not call tcp_rate_check_app_limited() internally, so callers needed an explicit tcp_rate_check_app_limited() to cover it. That commit replaced do_tcp_sendpages() with direct tcp_sendmsg_locked() calls, which perform the check on every path that queues data. The outer call became redundant but was left in place. The site changed here, tls_push_sg(), holds the socket lock and invokes tcp_sendmsg_locked() on every iteration. The early-return paths in tcp_sendmsg_locked() that skip tcp_rate_check_app_limited() -- the MSG_ZEROCOPY allocation failure and MSG_FASTOPEN branches -- return without queueing any MSG_SPLICE_PAGES data, so there is no functional consequence from omitting the outer check. A potential benefit of this change is that it facilitates future reuse of tls_push_sg() for KTLS support in protocols beyond TCP, such as MPTCP. Since tcp_rate_check_app_limited() is TCP-specific while sendmsg_locked() is a generic interface in struct proto_ops, this change allows us to switch to different protocols via sk->sk_socket->ops->sendmsg_locked() without carrying protocol-specific assumptions. Signed-off-by: Geliang Tang Link: https://patch.msgid.link/5bc803abb4e27054eaffc8b26db7812e6347b0dd.1789634247.git.tanggeliang@kylinos.cn Signed-off-by: Jakub Kicinski --- net/tls/tls_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index fbb274287aa5..8bdb78718a8d 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -185,8 +185,6 @@ int tls_push_sg(struct sock *sk, ctx->splicing_pages = true; while (1) { - /* is sending application-limited? */ - tcp_rate_check_app_limited(sk); p = sg_page(sg); retry: bvec_set_page(&bvec, p, size, offset);