From: Paul Greenwalt <paul.greenwalt@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Paul Greenwalt <paul.greenwalt@intel.com>
Subject: [PATCH iwl-next v2 0/4] idpf: add devlink info support with selftest
Date: Thu, 3 Sep 2026 04:27:38 -0400 [thread overview]
Message-ID: <20260903082742.43837-1-paul.greenwalt@intel.com> (raw)
Add initial devlink support for idpf and a matching selftest.
Patch 1 consolidates the drvdata clear into idpf_decfg_device(), the
declared inverse of idpf_cfg_device() which sets it.
Patch 2 adds the devlink instance. It is registered once the virtchnl
handshake has completed rather than from idpf_probe(), so the instance
is not exposed to userspace while the adapter is still coming up.
Patch 3 implements .info_get and reports:
- serial_number: PCI Device Serial Number, for NIPA CI identification
- fw.mgmt.api (running): driver-device communication protocol version
This follows a phased approach and reports stable, readily-available
information. Firmware version support will be added in future patches as
it becomes available through virtchnl.
Patch 4 adds a hardware selftest that logs devlink info in the format
NIPA CI consumes.
v1 -> v2:
- Patch 1:
- Reworked: instead of adding a second, redundant pci_set_drvdata(NULL)
at idpf_probe()'s err_free label, move the clear into
idpf_decfg_device() so it pairs with the set in idpf_cfg_device(),
and drop the now-redundant explicit clear in idpf_remove().
- Patch 2 (new, split out of the old patch 2):
- Register the devlink instance from idpf_init_hard_reset() once
idpf_vc_core_init() has succeeded, instead of from idpf_probe().
Registration is guarded by IDPF_DEVLINK_REGISTERED since
idpf_init_hard_reset() also runs on every function and PCI reset.
- Unregister only after the init/reset worker is quiesced, and only if
registration actually happened.
- Patch 3:
- Select NET_DEVLINK in Kconfig.
- Omit serial_number when the device reports no PCI DSN, instead of
reporting an all-zero serial number.
- Pass the buffer size to the DSN helper rather than hardcoding it.
- The version guard is no longer needed now that the instance is only
registered after the virtchnl handshake has completed.
- Patch 4:
- Read NETIF from drivers/net/net.config as documented in
drivers/net/README.rst, in addition to the environment.
- Skip, rather than fail, devices that report no versions and no serial
number; implementing devlink info is optional and devlink reports a
driver name even when info_get is absent.
- Count and log board.serial_number.
- Treat a devlink/ethtool driver name difference as informational; it
is legitimate for e.g. mlx4 and DSA user ports.
- Do not require ethtool; it is only used for an optional fallback
handle lookup and the driver name comparison.
- Query devlink dev info once and validate a single snapshot.
- Log the reported versions.
Paul Greenwalt (4):
idpf: clear drvdata in idpf_decfg_device()
idpf: add devlink support
idpf: add devlink info support
selftests: net: hw: add devlink info test
Documentation/networking/devlink/idpf.rst | 30 ++++
Documentation/networking/devlink/index.rst | 1 +
drivers/net/ethernet/intel/idpf/Kconfig | 1 +
drivers/net/ethernet/intel/idpf/Makefile | 1 +
drivers/net/ethernet/intel/idpf/idpf.h | 4 +-
.../net/ethernet/intel/idpf/idpf_devlink.c | 94 ++++++++++
.../net/ethernet/intel/idpf/idpf_devlink.h | 45 +++++
drivers/net/ethernet/intel/idpf/idpf_lib.c | 8 +
drivers/net/ethernet/intel/idpf/idpf_main.c | 19 ++-
.../testing/selftests/drivers/net/hw/Makefile | 1 +
.../selftests/drivers/net/hw/devlink_info.sh | 160 ++++++++++++++++++
11 files changed, 359 insertions(+), 5 deletions(-)
create mode 100644 Documentation/networking/devlink/idpf.rst
create mode 100644 drivers/net/ethernet/intel/idpf/idpf_devlink.c
create mode 100644 drivers/net/ethernet/intel/idpf/idpf_devlink.h
create mode 100755 tools/testing/selftests/drivers/net/hw/devlink_info.sh
--
2.52.0
next reply other threads:[~2026-09-03 16:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 8:27 Paul Greenwalt [this message]
2026-09-03 8:27 ` [PATCH iwl-next v2 1/4] idpf: clear drvdata in idpf_decfg_device() Paul Greenwalt
2026-09-03 8:27 ` [PATCH iwl-next v2 2/4] idpf: add devlink support Paul Greenwalt
2026-09-03 8:27 ` [PATCH iwl-next v2 3/4] idpf: add devlink info support Paul Greenwalt
2026-09-03 8:27 ` [PATCH iwl-next v2 4/4] selftests: net: hw: add devlink info test Paul Greenwalt
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=20260903082742.43837-1-paul.greenwalt@intel.com \
--to=paul.greenwalt@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
/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