Article View: linux.kernel.netdev
Article #24551[PATCH net v2] pppox: drop queued packets on channel handoff
From: Nicolas Dichtel
Date: Mon, 30 Nov 2026 10:16
Date: Mon, 30 Nov 2026 10:16
85 lines
13425 bytes
13425 bytes
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]); }'
Waiting for a grace period only for the lockless receive paths is not an
option, as PPPoE is going to receive packets without serialization as well,
once its __sk_receive_skb() call is removed. Instead, drop the queued
packets rather than delivering them to generic PPP, so that no grace period
is needed. These packets are early PPP control frames, which the peer
retransmits. Before the faulty commit, they were not delivered either: they
stayed in the queue until the socket was destroyed.
A receive path that observed the old state may still queue a packet after
the purge. Such a packet stays in the queue until the socket is destroyed,
as it did before the faulty commit.
This fix was tested against the reproducer: the setup rate is back to ~1100
sessions per second, the same level as with the faulty commit reverted. The
pppoe.sh and pppol2tp.sh selftests also pass.
Fixes: 92c1bf630abf ("pppox: drain queued packets on channel handoff")
Cc: stable@vger.kernel.org
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
v2:
- drop the queued packets instead of waiting for a grace period
only for lockless receive paths (Qingfang)
v1: https://lore.kernel.org/netdev/20261127152822.2098330-1-nicolas.dichtel@6wind.com/
drivers/net/ppp/pppox.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ppp/pppox.c b/drivers/net/ppp/pppox.c
index a6f72c813bef..392320d01abf 100644
--- a/drivers/net/ppp/pppox.c
+++ b/drivers/net/ppp/pppox.c
@@ -74,7 +74,6 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
switch (cmd) {
case PPPIOCGCHAN: {
- struct sk_buff *skb;
int index;
rc = -ENOTCONN;
@@ -92,17 +91,10 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
* /dev/ppp.
*/
sk->sk_state |= PPPOX_BOUND;
- /* Let lockless receive paths finish queueing against the old
- * state.
+ /* A bound socket is no longer readable: drop the packets
+ * queued before the handoff.
*/
- synchronize_net();
- /* Drain packets queued before the handoff because a bound
- * socket is no longer readable.
- */
- while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
- skb_orphan(skb);
- ppp_input(&po->chan, skb);
- }
+ skb_queue_purge(&sk->sk_receive_queue);
break;
}
default:
--
2.47.3
Technical Details
Message-ID:
<20261130101628.1560335-1-nicolas.dichtel@6wind.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374100-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374100-linux-kernel-netdev=dewy.ru From: nicolas.dichtel@6wind.com (Nicolas Dichtel) Newsgroups: linux.kernel.netdev Subject: [PATCH net v2] pppox: drop queued packets on channel handoff Date: Mon, 30 Nov 2026 11:16:03 +0100 Organization: Usenet Network Message-ID: <20261130101628.1560335-1-nicolas.dichtel@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1401427"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:SQVmYhQYbH+hu+UgbA7FxGWjE6Y= sha256:BE31Dlwnwxy2f5yV8PsSK4mG1EWmQNaTRPJNOnQNtWw= sha1:6Tv+hv0OYMm/nnLdn0p38ImUJos= sha256:ZbGz8aHh69ZCXgKycy07m5pBCFyGB9r8BklChQqcwb8= 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 CF991125FD6; Mon, 30 Nov 2026 13:16:51 +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 (2048-bit key) header.d=6wind.com 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 PAtwylNlYrQ2; Mon, 30 Nov 2026 13:16:48 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374100-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=6wind.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 16930125FD5; Mon, 30 Nov 2026 13:16:40 +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 26C8626FBC; Mon, 30 Nov 2026 10:16:37 +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=1796033793; b=xI2Iut1AuegGFm8AtePIg6IAQuuvw/kdsLozMZp7c2qA4gmcvarWWOzHupsa6v4aMzHI iepFGjwWPZBXkM2IO1ydTlByXP5tRGkpfxAx5CBK1yeA5y+82SZjh0RtmAB+EUcBOSAJW 52vpjWOu6f6rPLLm1fd1bOmmBQmjc4fNJafP+oI4UcLm7UOJ2J7vlkpxbARp56kXXrJuH 90KsPf2T43oSUmEKkYnYO1zXnTbJ/s52icEtyNc4NU9d8QfiEkpq+88e4BJkQn5RC8oU6 kQUwbIc9GcnczRtrKY405rYHIUDchOwvf15tCyr4pjbZ1e+VSkTCJnIQ8bo+J6+Wc/w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796033793; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: Received:X-Relaying-Domain:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=L4g2sFjFTHfe/R1AQJEKRtwxUvr29YdNBc92Vok1+SU=; b=pgxlGr+w7SEFqk7U2T0+rr7B+qgGYq8rFx14udUlgsmHlKj/GBPKzGpNXeq/nvLxN7Xf ToX70trOu/DGa+pj5V6m8YeZBe+QtawkU+ojCv+E6P3FH5i0p1h8FyjKUsWHh0+v0mF5A 8HjhF2fAcCQ7e28wJ81f6/6o7+YKAdXWACFuUY/JZUVy6M+Of8RkenAw37+qa+hzzoQQP AnyoQAGs77tYRndivKvH2NpXmyPl8NnUhNXfr9dLdd07nRg/f3Xf9WI2QkTYaqw8rr1Xs Z2Bh0sKP1JkfifMenJENvMGAOLhlwr8drUg5SFr7PtDKaAAWjLbAUrc08XzdXE6tUdw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=6wind.com header.i=@6wind.com header.a=rsa-sha256 header.s=google header.b=g68P4Sda; dmarc=pass header.from=6wind.com; spf=pass smtp.mailfrom=6wind.com; 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 8D73C606A68C; Mon, 30 Nov 2026 10:16:33 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.a=rsa-sha256 header.s=google header.b=g68P4Sda X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.97 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796033792; b=xTeIjRNprsLmjTrDVt0UdoD65MLNH5sgCwks+vRD9Edl5cV0GrSPFYzohPOmJpN+xwl0 U7Dbr/DypfmG0HfnpTy1THitcLSdZDK8wPJByk4Fg+kUc7RGQG5OnTPoI2BY6yTGANXcv rEbK8WNLVE5pORt3U1ooKTvzrh2/ZIDVoKrWjc5oOeib4wWHYBg5djDbMGcNbxE4aUdjR NT9DtTWkzJvvxFzIc8ItEPl45X7roqwtYvMrnJI2hXuYmIDIRSt8kI0zSddppHXL2UtOg Op5oEtObQWiWBoogwHmtoHP5Iuk2QrD/0LbrDkfxWlJN4htkg1xPtn8Py3Qscv2UXtQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796033792; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:X-Relaying-Domain: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=L4g2sFjFTHfe/R1AQJEKRtwxUvr29YdNBc92Vok1+SU=; b=cb3PmGazw+a+fgLdgAQGlVXhxlkNd1pflASZH7GEbtzCG4PMwfVPBQVbNFLUcT61wKiO zLjliHsvMuZ3AeLluZhJY44ydu+7zfixFdddbMReADidRdpni1H0uskA1rm0U1i/zLcL1 MNGg0EcGsdXVnTu3Lgy0ykeaGbdfoJsQo9TuKhqOOorGbftJ/z327ET/hd+sCO9991GxE qG6VknvoTYKsBk+OWik/+O7EXNAXXrxek501EFiGS6HJjs3JCHt41Wl4AbX6rxs+FVWLh 8g1vNDaEO5EEw3teyfAFy2d/GrlTPRhA5wZU9MLxBDwDzl1Nc+fQ9W+tz5bx79//Vrg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=6wind.com; spf=pass smtp.mailfrom=6wind.com; dkim=pass header.d=6wind.com header.i=@6wind.com header.a=rsa-sha256 header.s=google header.b=g68P4Sda; arc=none smtp.remote-ip=209.85.128.97 X-Received: from mail-wm1-f97.google.com (mail-wm1-f97.google.com [209.85.128.97]) (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 C004E606A32C for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 10:16:31 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C004E606A32C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=6wind.com X-Received: by mail-wm1-f97.google.com with SMTP id 5b1f17b1804b1-4a56e05568aso23896495e9.1 for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 02:16:31 -0800 (PST) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1796033790; x=1796638590; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=L4g2sFjFTHfe/R1AQJEKRtwxUvr29YdNBc92Vok1+SU=; b=g68P4SdaeUXTJ+eXMBDT2SzUH7+Hbxgs9bzcCsm9eKOQtIWefrGJiy7h36BcS07blL TkFbucsFEXpiGn+FDf3J7Q0d8fISq1h50iMue827SDjk8eaccPX3h1xatjHakw26ril0 j+9b/dlSz8cXzbgg4LbYTt1PipUUvDH0Nq7E5FJCVJWvzvze1nrgX+vShMo8ahInhVI3 W4Qc4aD+2Wc5K3cvMtcCDG962GadkrF77xtRxhGwJfnIRsweO7wT67M+DVW49yBTGtjv bMkfutZC/axLC8GTnnr7J62qsZwsfhvdmdfIpnkPKRQrUL98sIVc9tNe7MYrwDXhwgob UM3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796033790; x=1796638590; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=L4g2sFjFTHfe/R1AQJEKRtwxUvr29YdNBc92Vok1+SU=; b=Z4P1JVOC3Maliw6cPY2Km96ug5MxNm6QenU5OExcJYoLjY+wWCemBBLLT/3xCVO3+S ci1Rq1zr2+s34wRbc2NIw8o+xGngV9HXB0MaUJlURwvecN9sCiUYTc459UHWNqlkOzOr HmpTXYsFeqtk772BeXEish7fZkAJ7QrB/Yoavq7JDK5pXwRbqzzh6L5tF6faPhgr16Kn MKsJniIe+UzPUPh9nKbFxIjG52qfM91xdee1YqgCqH/Ktr/csRwXnUB6WvLR+dRG18vW LoAXctOIo3fwlUAQVgB7bAS17k00fu+gZLx0L2RzgZfHIQG/mgMPgL9tkM+xd4dWSb8y 0v5Q== X-Gm-Message-State: APuU4Z8Vaj9J7bNj+g7SSO8r9ChvovMKby0EtU6JqWTOBiddP3TR8R68 E1qDRkNYaeoa7ZtMzRWbREKrmNXeVTQDiy8Cc/+b8lQScSGYpO+q2wAlLJvoY8vyJQuIjrA9YWu 5KnKBsGitc6e/USACwKN2aEEIfyt3lJyTjW7V X-Gm-Gg: AZFdTZcXqM4AzakZHEvM1cM/XvVEfGkDlwL/Ijqc/d9DVAstZHDKcZEVXygrjtxavCJ 5124ehMtihL7B/E1RnYdG0k21FcECSh2bijxkN1rahyjscuxmlA22cPhCgDrJxsGABWnGnHLg6E 9d0cuqPCM1WS4vfpvIIjpTk7T+xTZObSvg0hGqLH0p6M/cQVe/UzqrxySJL/g9+fMD+pEXWS8cR CRDc7/jdkWBfQaddqMw0J5mAl2IdsMUs193tWjWwQP+LW3m7GhKpLUCkCen8HUvxhSVXyiUhV+w LtALcwAIaxcFWwg7rkeHKlNLv3CGnXoHFRKrg5mpKugB5toet6VPQnN4tVxB8sEzVC9Pjsp5CVV E51dGzo0to+HFUIP4sOy8xMQoCw== X-Received: by 2002:a05:600c:34c5:b0:4bb:bf7e:e264 with SMTP id 5b1f17b1804b1-4bbbf7ee3c5mr112804895e9.2.1796033789987; Mon, 30 Nov 2026 02:16:29 -0800 (PST) X-Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with UTF8SMTP id 5b1f17b1804b1-4bb9814eb25sm97956975e9.6.2026.11.30.02.16.29; Mon, 30 Nov 2026 02:16:29 -0800 (PST) X-Relaying-Domain: 6wind.com X-Received: from localhost (bretzel.dev.6wind.com [10.17.1.57]) by smtpservice.6wind.com (Postfix) with UTF8SMTP id D2355105E4; Mon, 30 Nov 2026 11:16:29 +0100 (CET) X-Cc: netdev@vger.kernel.org, Nicolas Dichtel <nicolas.dichtel@6wind.com>, stable@vger.kernel.org X-Mailer: git-send-email 2.47.3 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-Received-Bytes: 13166