[PATCH net 2/2] tls: drop duplicate check_app_limited in tls_push_sg

From
Geliang Tang <geliang@kernel.org>
Date
2026-09-14 07:14:59
Also in
bpf, mptcp
Reply to
Geliang Tang, 2026-09-14
From: Geliang Tang <redacted>

When the sendpage->MSG_SPLICE_PAGES migration series replaced
do_tcp_sendpages() with direct tcp_sendmsg_locked() calls, callers that
had used do_tcp_sendpages() kept an explicit tcp_rate_check_app_limited(sk)
that was originally needed to cover do_tcp_sendpages() (which did not call
tcp_rate_check_app_limited()). After the inlining, tcp_sendmsg_locked()
always provides the check, and the outer call became redundant.

The site changed here, tls_push_sg(), is a MSG_SPLICE_PAGES loop that holds
the socket lock and only iterates when size > 0; tcp_sendmsg_locked() is
invoked on every iteration with state identical to what the outer call
sees, so dropping the outer call is safe and behavior-preserving.

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.

Fixes: e117dcfd646e ("tls: Inline do_tcp_sendpages()")
Signed-off-by: Geliang Tang <redacted>
---
 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);
-- 
2.53.0
Thread (11 messages) 11 messages, 6 authors, last reply 2026-09-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help