Netdev List
 help / color / mirror / Atom feed
From: Qingfang Deng <qingfang.deng@linux.dev>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	James Chapman <jchapman@katalix.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net] pppox: only wait for a grace period for lockless receive paths
Date: Sat, 28 Nov 2026 00:08:02 +0800	[thread overview]
Message-ID: <78e175b3-7f97-422a-928a-a05616f9c445@linux.dev> (raw)
In-Reply-To: <20261127152822.2098330-1-nicolas.dichtel@6wind.com>

Hi,

On 11/27/2026 11:28 PM, Nicolas Dichtel wrote:
> Commit 92c1bf630abf ("pppox: drain queued packets on channel handoff")
> added a synchronize_net() call to PPPIOCGCHAN, so that the receive paths
> that observed the old state finish queueing their packets before the queue
> is drained.
> 
> PPPIOCGCHAN is issued once per session by PPP daemons, so each session
> setup now waits for a full RCU grace period. With accel-ppp, the PPPoE
> session setup rate drops from ~1100 to ~250 sessions per second, and the
> latency of pppox_ioctl() goes from a few microseconds to 4-8 ms.
> 
> The regression was triggered in CI testing by a PPPoE performance test
> (accel-ppp server in a VM using ConnectX-6 VFs, bngblaster client) on an
> unmodified kernel. It was validated by reverting 92c1bf630abf, which
> restores the v7.2 setup rate, and by measuring the latency of pppox_ioctl()
> while PPPoE sessions are being set up:
> 
>    bpftrace -e 'kprobe:pppox_ioctl { @s[tid] = nsecs }
>      kretprobe:pppox_ioctl /@s[tid]/ {
>        @us = hist((nsecs - @s[tid]) / 1000); delete(@s[tid]); }'
> 
> Only L2TP needs this grace period:
> 
> - PPPoE receives packets through __sk_receive_skb(), which takes the socket
>    spinlock and moves the skb to the backlog when the socket is owned by the
>    user. As pppox_ioctl() holds lock_sock(), pppoe_rcv_core() either
>    completes before the PPPOX_BOUND transition, or runs from release_sock()
>    and sees the new state.
> 
> - PPTP never queues packets to sk_receive_queue: pptp_rcv_core() always
>    hands them to ppp_input(). Moreover, PPPOX_BOUND is set as early as
>    pptp_bind().
> 
> - pppol2tp_recv() tests PPPOX_BOUND and queues packets under
>    rcu_read_lock() only, without taking the socket lock, so it can race with
>    the transition. Waiting for a grace period is required there.
> 
> Add a lockless_rcv flag to struct pppox_proto, set it for L2TP only, and
> wait for a grace period only when it is set.

I'm going to remove the serializing __sk_receive_skb() from PPPoE, then 
this issue will resurface.

Please consider either using the non-blocking call_rcu(), or just 
dropping all the skbs in the receive queue.

Best regards,
Qingfang

      reply	other threads:[~2026-11-27 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 15:28 [PATCH net] pppox: only wait for a grace period for lockless receive paths Nicolas Dichtel
2026-11-27 16:08 ` Qingfang Deng [this message]

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=78e175b3-7f97-422a-928a-a05616f9c445@linux.dev \
    --to=qingfang.deng@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jchapman@katalix.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=willemb@google.com \
    /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