BPF List
 help / color / mirror / Atom feed
From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Geliang Tang <geliang@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Jakub Sitnicki <jakub@cloudflare.com>,
	Eric Dumazet <edumazet@google.com>,
	Neal Cardwell <ncardwell@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Matthieu Baerts <matttbe@kernel.org>,
	Mat Martineau <martineau@kernel.org>
Cc: Geliang Tang <tanggeliang@kylinos.cn>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	mptcp@lists.linux.dev
Subject: Re: [PATCH bpf-next v4] bpf: drop duplicate check_app_limited in tcp_bpf_push
Date: Tue, 22 Sep 2026 20:03:07 +0800	[thread overview]
Message-ID: <f56e2df4-1f2b-44e6-b807-dccb60d5393e@linux.dev> (raw)
In-Reply-To: <1f7dc605b16fc0590f7cbf5a27d57271926c01ce.1790074764.git.tanggeliang@kylinos.cn>


On 9/22/26 7:06 PM, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> 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>


Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>


Thanks


  parent reply	other threads:[~2026-09-22 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 11:06 [PATCH bpf-next v4] bpf: drop duplicate check_app_limited in tcp_bpf_push Geliang Tang
2026-09-22 11:57 ` bot+bpf-ci
2026-09-22 12:03 ` Jiayuan Chen [this message]
2026-09-23  2:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f56e2df4-1f2b-44e6-b807-dccb60d5393e@linux.dev \
    --to=jiayuan.chen@linux.dev \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tanggeliang@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox