summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorGeliang Tang <tanggeliang@kylinos.cn>2026-09-22 19:06:18 +0800
committerAlexei Starovoitov <ast@kernel.org>2026-09-23 02:08:02 +0000
commit91f8613d95ad8cd99d8baf094806d1ef98bc6380 (patch)
tree8992884a6f7c830e31161dbbb84dd4f59a42556d /net/ipv4
parent93f65ee79cf97f2f8a3cc832875d817755034de4 (diff)
downloadlinux-next-91f8613d95ad8cd99d8baf094806d1ef98bc6380.tar.gz
linux-next-91f8613d95ad8cd99d8baf094806d1ef98bc6380.zip
bpf: Drop duplicate check_app_limited in tcp_bpf_push
Commit c5c37af6ecad9 ("tcp: Convert do_tcp_sendpages() to use MSG_SPLICE_PAGES") moved tcp_rate_check_app_limited() inside do_tcp_sendpages(), turning it into a wrapper around tcp_sendmsg_locked(). Later, commit ebf2e8860eea ("tcp_bpf: Inline do_tcp_sendpages as it's now a wrapper around tcp_sendmsg") inlined the wrapper in tcp_bpf_push() with direct tcp_sendmsg_locked() calls, which perform the check on every path that queues data, but kept the outer tcp_rate_check_app_limited() that was previously needed to cover do_tcp_sendpages(). The outer call is now redundant. The site changed here, tcp_bpf_push(), 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 tcp_bpf_push() for sockmap 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> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev> Link: https://patch.msgid.link/1f7dc605b16fc0590f7cbf5a27d57271926c01ce.1790074764.git.tanggeliang@kylinos.cn
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_bpf.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c
index 2e234d155b5e..d5fcf3ce4861 100644
--- a/net/ipv4/tcp_bpf.c
+++ b/net/ipv4/tcp_bpf.c
@@ -108,7 +108,6 @@ static int tcp_bpf_push(struct sock *sk, struct sk_msg *msg, u32 apply_bytes,
off = sge->offset;
page = sg_page(sge);
- tcp_rate_check_app_limited(sk);
retry:
msghdr.msg_flags = flags | MSG_SPLICE_PAGES;
has_tx_ulp = tls_sw_has_ctx_tx(sk);