mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
tls: drop duplicate check_app_limited in tls_push_sg
Before commit c5c37af6ec ("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 <tanggeliang@kylinos.cn>
Link: https://patch.msgid.link/5bc803abb4e27054eaffc8b26db7812e6347b0dd.1789634247.git.tanggeliang@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
05092b5433
commit
cd7e4b1e47
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user