> -----Original Message----- > From: Paul Greenwalt <[email protected]> > Sent: Friday, September 4, 2026 3:37 AM > To: [email protected] > Cc: Greenwalt, Paul <[email protected]> > Subject: [PATCH iwl-next v3 3/3] selftests: net: hw: add devlink info test > > Add a selftest that logs the device information a driver reports through the > devlink info interface: the driver name, serial numbers and every reported > version, in the format NIPA CI consumes for device regression tracking. This > helps maintainers identify pass/fail status changes caused by FW updates. > > Every devlink info field is optional, so the test reports what a device > provides rather than requiring any particular field. devlink reports the > driver name for every registered instance, even when the driver does not > implement info_get, so a device that reports no versions and no serial number > is skipped, as are devices with no devlink instance. Whether the driver name > itself appears in the JSON depends on the installed iproute2, so it is logged > when present but not required. > > The devlink 'driver' attribute names the driver bound to the parent device, > which may legitimately differ from the netdev's ethtool driver - > mlx4 reports mlx4_core and mlx4_en, and DSA user ports report dsa - so a > difference is logged rather than failed. ethtool is only used for an optional > fallback handle lookup and that comparison, so it is not required to run the > test. > > NETIF is read from the environment or from drivers/net/net.config as > described in drivers/net/README.rst. net.config is sourced before net/lib.sh > so that it cannot clobber the framework's globals. The test needs only a > single local interface, so it sources net/lib.sh rather than the forwarding > library, which requires NUM_NETIFS and a configured remote host. > > Example usage: > > NETIF=eth0 ./tools/testing/selftests/drivers/net/hw/devlink_info.sh > > INFO: driver: idpf > INFO: serial_number: 00-a0-c9-ff-ff-23-45-67 > INFO: fw.mgmt.api (running): 2.0 > TEST: devlink info [ OK ] > > Link: > https://github.com/linux-netdev/nipa/wiki/Netdev-CI-system#device-information > Signed-off-by: Paul Greenwalt <[email protected]> > Assisted-by: Claude:claude-opus-5 > --- > .../testing/selftests/drivers/net/hw/Makefile | 1 + > .../selftests/drivers/net/hw/devlink_info.sh | 158 ++++++++++++++++++ > 2 files changed, 159 insertions(+) > create mode 100755 tools/testing/selftests/drivers/net/hw/devlink_info.sh
Tested-by: Alexander Nowlin <[email protected]>
