From: Petr Oros <poros@redhat.com>
To: netdev@vger.kernel.org
Cc: Petr Oros <poros@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Shuah Khan <shuah@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Jani Nikula <jani.nikula@intel.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Jiri Pirko <jiri@resnulli.us>, Ivan Vecera <ivecera@redhat.com>,
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>,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [PATCH net-next v2 00/14] dpll: add a simulated DPLL device driver
Date: Thu, 5 Nov 2026 16:18:38 +0100 [thread overview]
Message-ID: <20261105151852.1844305-1-poros@redhat.com> (raw)
The DPLL subsystem has no in-tree driver that can run without real
hardware, so core changes and userspace tooling are hard to exercise in
CI, and the pin-on-pin and reference sync paths see almost no coverage
outside the vendors' labs. This series adds dpllsim, a simulated DPLL
device driver, together with selftests that run against it.
The driver is controlled through configfs, following gpio-sim. Writing a
clock ID into a device directory and setting "live" to 1 registers a
DPLL device with the core. Pins are directories under pins/ with their
type, frequency, direction and priority as attributes, and all of them
are registered when the device goes live. The split between creating
the configuration and going live keeps the register and unregister
paths reachable from userspace, so they can be exercised repeatedly
without reloading the module. Nothing in the simulator is a stable ABI.
The patches follow the shape of the zl3073x introduction. The
driver starts with the device alone, then gains pins and the static pin
operations one at a time (state, priority, frequency, phase adjustment),
and every feature patch is followed by the selftest that covers it. The
last two patches add concurrency stress tests and reference tracker
leak tests for the lifecycle paths.
The simulation loop (lock state machine, phase and frequency
measurements, monitoring features), the topology features (MUX pin
hierarchies, reference sync, media failure injection), netdevsim
integration and device mode setting follow in two further series once
this one is in, to stay within the 15 patch limit.
The driver and the selftests were developed with an LLM coding
assistant (Claude Code) working under my direction. I chose the
configfs design, the split into one feature per patch and the test
scenarios, and I reviewed every line. The assistant wrote most of the
code and the first drafts of the changelogs, and it found and fixed
bugs by running the suite on the lab host. The series then went
through several rounds of an LLM based patch reviewer whose findings
were fixed, and through a mutation test in which deliberately broken
driver and core code was caught by the tests.
The selftests live in tools/testing/selftests/drivers/net/dpll and run
with "make -C tools/testing/selftests TARGETS=drivers/net/dpll
run_tests". By default they create dpllsim devices; with
DPLL_DEV_ID=<id> the basic and feature scripts run against an existing
device instead, so the same suite exercises real hardware. The whole
suite was run through the kselftest runner on an ice E810 host with
CONFIG_KASAN, CONFIG_PROVE_LOCKING and CONFIG_DPLL_REFCNT_TRACKER
enabled, against the simulator and, with DPLL_DEV_ID, against the ice
DPLL, where the tests that need a simulator skip and the pin state and
priorities of the hardware are left as they were. All pass with no
warnings in dmesg.
---
v2:
- sort tools/testing/selftests/drivers/net/dpll/config alphabetically
and make the scripts clean under the shellcheck run of the netdev CI
(quoted exit and return values, shellcheck directives for the globals
shared between the library and the scripts and for the optional
argument of dpllsim_setup_standard_device())
v1: https://lore.kernel.org/all/20261103093910.596225-1-poros@redhat.com/
---
Petr Oros (14):
dpll: dpllsim: Add simulated DPLL device driver
selftests: dpll: add test library and device lifecycle tests
dpll: dpllsim: Add configurable pins
selftests: dpll: add pin enumeration and property tests
dpll: dpllsim: Add support to set input pin state
selftests: dpll: add pin state tests
dpll: dpllsim: Add support to get/set priority on input pins
selftests: dpll: add pin priority test
dpll: dpllsim: Add support to set frequency on pins
selftests: dpll: add pin frequency test
dpll: dpllsim: Add support to adjust phase
selftests: dpll: add pin phase adjust test
selftests: dpll: add concurrency stress tests
selftests: dpll: add reference leak tests
Documentation/driver-api/dpllsim.rst | 72 ++
Documentation/driver-api/index.rst | 1 +
MAINTAINERS | 9 +
drivers/dpll/Kconfig | 1 +
drivers/dpll/Makefile | 1 +
drivers/dpll/dpllsim/Kconfig | 16 +
drivers/dpll/dpllsim/Makefile | 4 +
drivers/dpll/dpllsim/core.c | 471 ++++++++++
drivers/dpll/dpllsim/dpll.c | 475 ++++++++++
drivers/dpll/dpllsim/dpllsim.h | 99 ++
tools/testing/selftests/Makefile | 1 +
.../selftests/drivers/net/dpll/Makefile | 16 +
.../testing/selftests/drivers/net/dpll/config | 6 +
.../selftests/drivers/net/dpll/dpll_basic.sh | 221 +++++
.../drivers/net/dpll/dpll_features.sh | 397 ++++++++
.../drivers/net/dpll/dpll_reftrack.sh | 184 ++++
.../selftests/drivers/net/dpll/dpll_stress.sh | 562 ++++++++++++
.../selftests/drivers/net/dpll/settings | 1 +
.../selftests/drivers/net/lib/sh/dpll_lib.sh | 850 ++++++++++++++++++
19 files changed, 3387 insertions(+)
create mode 100644 Documentation/driver-api/dpllsim.rst
create mode 100644 drivers/dpll/dpllsim/Kconfig
create mode 100644 drivers/dpll/dpllsim/Makefile
create mode 100644 drivers/dpll/dpllsim/core.c
create mode 100644 drivers/dpll/dpllsim/dpll.c
create mode 100644 drivers/dpll/dpllsim/dpllsim.h
create mode 100644 tools/testing/selftests/drivers/net/dpll/Makefile
create mode 100644 tools/testing/selftests/drivers/net/dpll/config
create mode 100755 tools/testing/selftests/drivers/net/dpll/dpll_basic.sh
create mode 100755 tools/testing/selftests/drivers/net/dpll/dpll_features.sh
create mode 100755 tools/testing/selftests/drivers/net/dpll/dpll_reftrack.sh
create mode 100755 tools/testing/selftests/drivers/net/dpll/dpll_stress.sh
create mode 100644 tools/testing/selftests/drivers/net/dpll/settings
create mode 100644 tools/testing/selftests/drivers/net/lib/sh/dpll_lib.sh
--
2.56.0
next reply other threads:[~2026-11-05 15:19 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 15:18 Petr Oros [this message]
2026-11-05 15:18 ` [PATCH net-next v2 01/14] dpll: dpllsim: Add simulated DPLL device driver Petr Oros
2026-11-06 10:47 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-11-06 10:48 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-11-06 10:48 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-11-06 10:48 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-11-06 10:41 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 06/14] selftests: dpll: add pin state tests Petr Oros
2026-11-06 10:49 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-11-06 10:49 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 08/14] selftests: dpll: add pin priority test Petr Oros
2026-11-06 10:50 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-11-06 10:50 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-11-06 10:51 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-11-06 10:51 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-11-06 10:51 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-11-06 10:52 ` Ivan Vecera
2026-11-05 15:18 ` [PATCH net-next v2 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-11-06 10:47 ` Ivan Vecera
2026-11-06 12:27 ` [PATCH net-next v2 00/14] dpll: add a simulated DPLL device driver Jiri Pirko
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=20261105151852.1844305-1-poros@redhat.com \
--to=poros@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=arkadiusz.kubalewski@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=ivecera@redhat.com \
--cc=jani.nikula@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rdunlap@infradead.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=vadim.fedorenko@linux.dev \
/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