From nobody Fri Sep 25 10:07:23 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE6154921B5; Tue, 15 Sep 2026 11:19:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471200; cv=none; b=AB64cKhlvh/Gte155vOODN5PwiHNwwFZyNpkGRqXXcCXuBNFghWWrdkLtgmI7I/jNwMK7qTaodEHQGo3LQ2E5D8hFFjlAu8W3VYgsLR70ce5fe0cFa35mRD9SKNmT6Qtpfi2kP8ePpDjiNe2/KlpIKVlGe+sIapWyWBtZDURARg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471200; c=relaxed/simple; bh=9ep/406Rb8nnAOQ9JDsuFzpTP2x1PWLPr3y6tACJdFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DZWD+sJYMaE3h6WkIiQ4OBAxDZmzrDILJ0qT3H0hEse46WXAiy015bW/nwimQObPC8oi6py6zROvUrbrhKSdoP7SxMdxsoKFPhsSC5ucnRRswQFqE5hFDuQX2hzgd58fkhEZx+l+3KgETk41lkxhq1fqK1jRZsM141UOi2Tbwo8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Uyvsl+9i; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Uyvsl+9i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 811F91F00898; Tue, 15 Sep 2026 11:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789471198; bh=QiA+5cZ8KyMykVw4PN+8CaI6Fu4uho+z9OgsW3ypx2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Uyvsl+9iiUHuA6fthqcbIQDdk92In9KiRj5+2jOroEOPsDuhVAmj9MvmTu7CqoS5k R5+/xMvUy7UwC4jdyb3Fu6k3EmvJq9gwavsxn6AMxEz/3AOsNt3GD4ryt1NvH905LO IHHZzrR5GgiGOvS774uRPBFik6SUo4Eyyru3aQnEAn8IqzFCLu6vAfSTLx+P9hTOBs ttkgtQ+k2DVNc0YhwxnVCMqlYQZpf4aDwNJSgutSKVjNeMMy9SaSi5sJsOS3QDF/1p +U/+NviNV0ElHZT4YA3/84kqrNI6K9pJPRt5AwFAe0TAtQamUbpIAf+LWjVM+qS8tc zC3lh89lrcQNg== From: Geliang Tang To: John Fastabend , Jakub Sitnicki , Jiayuan Chen , Eric Dumazet , Neal Cardwell , Kuniyuki Iwashima , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Sabrina Dubroca , David Howells , Matthieu Baerts , Mat Martineau Cc: Geliang Tang , netdev@vger.kernel.org, bpf@vger.kernel.org, mptcp@lists.linux.dev Subject: [PATCH bpf-next v2 1/2] bpf: drop duplicate check_app_limited in tcp_bpf_push Date: Tue, 15 Sep 2026 19:19:31 +0800 Message-ID: <87e00ef420af81974b590f9057cc08234324d45d.1789469930.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, tcp_bpf_push(), 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 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 --- net/ipv4/tcp_bpf.c | 1 - 1 file changed, 1 deletion(-) 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 =3D sge->offset; page =3D sg_page(sge); =20 - tcp_rate_check_app_limited(sk); retry: msghdr.msg_flags =3D flags | MSG_SPLICE_PAGES; has_tx_ulp =3D tls_sw_has_ctx_tx(sk); --=20 2.53.0 From nobody Fri Sep 25 10:07:23 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88B73496D3F; Tue, 15 Sep 2026 11:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471206; cv=none; b=PcXr/A1NlRATTDu9Xqt/AJaD+mPHPNF8rwMMfWv070UoqhS5ZUnmjVvd464smrbrfSR45Prm/Oi2ILlquP4R3Hf4vuQh2gVbDJ6yDVhq/NGgU2zWz84DRZyR1G3TS4B6DXJuW7Ozlb790CwcyqST9z2nxu7s0vhHile6FhIbxuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471206; c=relaxed/simple; bh=vNUdFCVgdA62Cf8qEHEufNJbGZyIEnbO3FGfBJdJzvI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i7x5oZfIZspiBWhn6BlSuUcZibcLFb5NniBHK1MIyCj0Lwm1ck+4hC2Y43dFXpLdhPMTc/6JD/QMu4kCtYrfI7X+BucUmWW8VgzzahUOBRSgOmMa11pfnpFf+swMvnw+mb4IfyEBkOk4Rb2Z3aYsgGCvUuoYqnHHb8oCPkpaIvA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e7Y3SWkM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e7Y3SWkM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CFE41F000FF; Tue, 15 Sep 2026 11:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789471205; bh=oacHrx6Ec/7yCmjpaG4M8wdAlOdhWbEJKeTsZaf8RgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e7Y3SWkMZBCdk6HlmUnV7N98Ow6iZfAme4Jp8MwPEnyrA8ISr/bGKT56eOM1ZMFjH 3mCkX8JIu9jS5oVTRPM85NVlV9IoL4zIE+10xzy06zbdNBAffsebC2h0Ui/8YEvqyX BfAY7AOcJZFlZCObRDEzLHncUNNs2E60O2/xmxH080v4qSLDzPTbqFXG5Tbs98i7kQ QI4mjFTllqKL9zZD+zndyblYILQK4vCd7pSnAaMpCDGgiNQtFbkgtqdr5U5vw82of1 uj8ta17EuzDvtR69ASKurwiLB3VFTM5ZKQo0NB0XQunzhSKXDUVMsTUPDVntTBE21L Pm+sR12T6enRg== From: Geliang Tang To: John Fastabend , Jakub Sitnicki , Jiayuan Chen , Eric Dumazet , Neal Cardwell , Kuniyuki Iwashima , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Sabrina Dubroca , David Howells , Matthieu Baerts , Mat Martineau Cc: Geliang Tang , netdev@vger.kernel.org, bpf@vger.kernel.org, mptcp@lists.linux.dev Subject: [PATCH net-next v2 2/2] tls: drop duplicate check_app_limited in tls_push_sg Date: Tue, 15 Sep 2026 19:19:32 +0800 Message-ID: <34d03d3fcb5a953c1d5abeb160a58dc94465db3e.1789469930.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, =20 ctx->splicing_pages =3D true; while (1) { - /* is sending application-limited? */ - tcp_rate_check_app_limited(sk); p =3D sg_page(sg); retry: bvec_set_page(&bvec, p, size, offset); --=20 2.53.0