From: Geliang Tang 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 always provide the check internally. The outer call became redundant but was left in place. 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. Signed-off-by: Geliang Tang --- 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