mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] ppp: transmit data frames without the unit and channel locks
@ 2026-11-29 14:43 Julius Bairaktaris
  2026-11-29 14:43 ` [PATCH net-next 1/3] " Julius Bairaktaris
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Julius Bairaktaris @ 2026-11-29 14:43 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Willem de Bruijn, Simon Horman, Shuah Khan, Qingfang Deng,
	Guillaume Nault, Sebastian Andrzej Siewior, Haoli Zhang,
	linux-ppp, netdev, linux-kernel, linux-kselftest

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-29 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 14:43 [PATCH net-next 0/3] ppp: transmit data frames without the unit and channel locks Julius Bairaktaris
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

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®