From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.97 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== 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== 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 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 ; Mon, 30 Nov 2026 10:16:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C004E606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=6wind.com 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 Received: by mail-wm1-f97.google.com with SMTP id 5b1f17b1804b1-4a56e05568aso23896495e9.1 for ; Mon, 30 Nov 2026 02:16:31 -0800 (PST) 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) 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 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) From: Nicolas Dichtel To: "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , Andrew Lunn , James Chapman , Willem de Bruijn , Simon Horman , Qingfang Deng Cc: netdev@vger.kernel.org, Nicolas Dichtel , stable@vger.kernel.org Subject: [PATCH net v2] pppox: drop queued packets on channel handoff Date: Mon, 30 Nov 2026 11:16:03 +0100 Message-ID: <20261130101628.1560335-1-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 2.47.3 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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