mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julius Bairaktaris <julius@bairaktaris.de>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
	Qingfang Deng <qingfang.deng@linux.dev>,
	Guillaume Nault <gnault@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Haoli Zhang <26031212468@stu.xidian.edu.cn>,
	linux-ppp@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [PATCH net-next 0/3] ppp: transmit data frames without the unit and channel locks
Date: Sun, 29 Nov 2026 15:43:16 +0100	[thread overview]
Message-ID: <20261129144319.1489366-1-julius@bairaktaris.de> (raw)

Every data frame sent on a PPP unit takes ppp->wlock in
ppp_xmit_process() and the channel's downl in ppp_push(), so CPUs that
send on one unit at the same time go through the channel and the lower
device one frame at a time. On a router that shapes its upload with
cake_mq on an ifb in front of a PPPoE device, the CAKE instance of each
CPU dequeues into that one ppp device.

Patch 1 sends a data frame straight to the channel when none of the work
done under those locks applies, for a channel that opts in with a new
lockless_xmit flag. Patch 2 sets the flag for PPPoE. Patch 3 adds a
selftest that sends from every CPU at once and compares the PPP and
Ethernet counters.

Measured on the bench: on a Xiaomi AX3600 (IPQ8074, four Cortex-A53)
uploading over PPPoE with 8 TCP streams, shaped to 160 Mbit/s by cake_mq
on ifb4pppoe-wan, the router's CPU time fell from 24.2 % to 21.0 % of
400 % with patches 1 and 2 on its 6.18 kernel (three interleaved pairs
of 60 s runs, 23.8-24.8 % against 18.9-22.6 %), at the same goodput of
149.6 to 150.0 Mbit/s and the same latency under load.

Patch 1 relies on ppp_unregister_channel() clearing pch->chan only after
ppp_disconnect_channel() has removed the channel from ppp->channels and
waited for a grace period. A PPPIOCDISCONN running at the same time lets
the unregister skip that wait today; "ppp: serialize channel operations
with unregister" closes that window:
https://lore.kernel.org/netdev/20261119084333.371234-1-26031212468@stu.xidian.edu.cn/

In a 4-CPU KVM guest, pppoe.sh and ppp_async.sh pass in five runs on a
KASAN and lockdep kernel with the series, and two rounds of stopping the
client pppd while one TCP and one UDP sender per CPU transmit, then
reconnecting, end without a report.

I used Claude (Anthropic) to help write these patches.

Julius Bairaktaris (3):
  ppp: transmit data frames without the unit and channel locks
  pppoe: transmit without the PPP channel lock
  selftests: net: ppp: send on PPPoE from every CPU at once

 drivers/net/ppp/ppp_generic.c            | 85 ++++++++++++++++++++++--
 drivers/net/ppp/pppoe.c                  |  7 +-
 include/linux/ppp_channel.h              |  1 +
 tools/testing/selftests/net/ppp/config   |  4 ++
 tools/testing/selftests/net/ppp/pppoe.sh | 83 +++++++++++++++++++++++
 5 files changed, 170 insertions(+), 10 deletions(-)


base-commit: f89726ffabef1b08c52e6163b7ab94b0d5f15503
-- 
2.53.0


             reply	other threads:[~2026-11-29 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 14:43 Julius Bairaktaris [this message]
2026-11-29 14:43 ` [PATCH net-next 1/3] " Julius Bairaktaris
2026-11-29 14:43 ` [PATCH net-next 2/3] pppoe: transmit without the PPP channel lock Julius Bairaktaris
2026-11-29 14:43 ` [PATCH net-next 3/3] selftests: net: ppp: send on PPPoE from every CPU at once Julius Bairaktaris

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=20261129144319.1489366-1-julius@bairaktaris.de \
    --to=julius@bairaktaris.de \
    --cc=26031212468@stu.xidian.edu.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gnault@redhat.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qingfang.deng@linux.dev \
    --cc=shuah@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

all inboxes | Powered by JetHome®