🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23642

Re: [PATCH net] pppox: only wait for a grace period for lockless receive paths

#23642
From: Qingfang Deng
Date: Fri, 27 Nov 2026 16:08
51 lines
10709 bytes
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
Technical Details
Message-ID: <78e175b3-7f97-422a-928a-a05616f9c445@linux.dev>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372843-linux-kernel-netdev=dewy.ru
References: <20261127152822.2098330-1-nicolas.dichtel@6wind.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372843-linux-kernel-netdev=dewy.ru
From: qingfang.deng@linux.dev (Qingfang Deng)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] pppox: only wait for a grace period for lockless
 receive paths
Date: Sat, 28 Nov 2026 00:08:02 +0800
Organization: Usenet Network
Message-ID: <78e175b3-7f97-422a-928a-a05616f9c445@linux.dev>
References: <20261127152822.2098330-1-nicolas.dichtel@6wind.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="768878"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:1kZgFP5CkkgsCuG3YSUNqzD747Y= sha256:hKi8232mni5c82NlVihGust8JIiJ5CbNcdDyB01c5R4=
	sha1:g4Cnh0UYjSoEq/MwGwxTXxAMmZU= sha256:2SoCYzSnFF042FoV5+J+g+N4KGVXEvZVbuN82XQzTlo=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 21534125F61; Fri, 27 Nov 2026 19:08:31 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id qr-FxJOGTm27;
	Fri, 27 Nov 2026 19:08:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372843-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 808F7125F5E; Fri, 27 Nov 2026 19:08:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 1435D2E421; Fri, 27 Nov 2026 16:08:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795795694;
	b=sVqNbbXpwljH5LMd/DkWs2kqFpvjaNik8Np8rge/QdHKowuWe403H+yT+xdi/aJrVs8K
	 Tl10YF1VL+TT2LkJzbMjKHymwnWCzlF8nHIOrNJcOn6X7Kjf/ZpSuex6PiS1mUQ1fdiWG
	 dHUOvB1qCXiIRFUDOliOJQ6q/DjvIjAa3zOnrHsXvCkT7Zee/j9pxn96h4+t9g+ff0Sr+
	 bTDhOSDU3AYunpuCrdktIsMODEuUDeyU+8zHVhMukqkkRq4yPppzOT56Oe9RKWOVy3MYi
	 NQ+PmQL5NcCFQTAE5TJJiI59dpBHBr9y8bWKeokoqZ4pN2wViPcCpvYl3nE9ZYxXFng==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795795694;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=XTqrcgRB76wYzP87xai+N/ckpVG15bTxN+bKetQXfgs=;
	b=u13yTkM+Zd+e5YHj97twOj/YCeE/zYW498YYj/GgdMwVPG3O5Fyi1ghGP5gKn0Dy/7vs
	 Z2qdzxM35CBVJRCgk+05E0LYFrAxCXx3FeXGf7H89hX9mpop+Fe84SDK0T23uMdyP/n99
	 a/FDf76mNg+p2MgIqnTAl8X/Pul5ifJSf6bYf8HPwDX3m+0pvwyrQXDC0cLSGwaoSpUiy
	 3UEJ98ymuLBJvXvFcfp1d2h4PVSWzAwe6jVq/qlc/8qxpGWKSTlXTJD31ZRckvv0y6sw7
	 BDqFqNCR+Ff84L0RN/cnx422r6BGrHXn163O24G0x5uFQzuVCUufNphZETPozipV1mw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MhEwuZkd;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CB00606A329;
	Fri, 27 Nov 2026 16:08:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MhEwuZkd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.130
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795795693;
	b=oliPRhVKTcd9f8YLm69Ah14lTAy8970tr30GevfV/Te0tNjurqTF/GQvcJlxef1CcuYH
	 V7reFOsU10BLWX17T0JXhApdKtt2QIJ2KZ42hQP3YsitEMx9+l/aKwgaJ7ytzvt6r6VOY
	 9l6KmMYNnR15SuW5i3IugEfp26EOPgBPoEhmJ2Bepej+pWe9s73xoJV1lBZjfEs1XtVNN
	 YM/6CHtdbLR9I8EHgDrpT/hEHVIzXpj3ZF47XR9R8Y17wMSCBnvVXVHLUbn8Mqgh6nYgA
	 hZtudcDvZlFTzMxvs05HfE7WEJ09e6T0bOl6frq7agdIASV9d2dN4VXi0F2uyD1TDJg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795795693;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=XTqrcgRB76wYzP87xai+N/ckpVG15bTxN+bKetQXfgs=;
	b=DvtzO9b9NHnSn6vBLOqDUH4dq3BOC8tDfBX6zl+WMIdNKMgZFJ6R9zc2ODp3DkxNOtJE
	 oigXUr5RlPE5yd3wlBQJqxnGhAMnMoKzdoExB1mN9ruYgkZdThlDHLk+WsuosIJ7jvE0P
	 iw5aSGJYUw9Ydzrk2GGl8o09n1kJ/6BA4ZrQ9lY2qm6qkRfAbJaIf7TpYNJEHhZlbtj9q
	 ntwFXY3ZHv1jGFnZTbcjZXJSDo01nelXHS07ST9d3801L99H2apEmI+s5dO7gdrAGy5X7
	 qm0k/fs2JGigdWv1U05fILEP7v/W6DCyNlWDnf0uzAf0wLYkH7k98s9cPf7lZzXpubw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MhEwuZkd;
	arc=none smtp.remote-ip=95.215.58.130
X-Received: from mta1.migadu.com (out-130.mta1.migadu.com [95.215.58.130])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1671A606A31F
	for <netdev@vger.kernel.org>; Fri, 27 Nov 2026 16:08:11 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1671A606A31F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=6RNB7N0/otlPYlDWppGx8VvcotVx4MUqa6ZJF+cWIno=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1795795690; v=1; x=1796400490;
 b=MhEwuZkdImq9E+9w3n2WdrSltZVRDOBJIIn9+N3MG+LsnsRm4TIZ+6Sr7jKjcrDnc1N+FzA7
 /DUd6WhPY3PYo0ardLeeqCH/aW/iIBSlrvWJuzTiVuz1VKcDeHJ3FRqzUqqOkJLefsH45MWYDX+
 rPhfvUCSoZaQj+kKOwfqOvqQ=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id de26b562f168ec27;
	Fri, 27 Nov 2026 16:08:09 +0000
X-Mizu-Trace-ID: de26b562f168ec27
X-Migadu-Flow: FLOW_OUT
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-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
X-In-Reply-To: <20261127152822.2098330-1-nicolas.dichtel@6wind.com>