Re: [PATCH net-next V3 4/5] net/mlx5: nodnic: Add ethtool driver info
From: netdev-bot+sashiko
Date: Fri Nov 27 2026 - 14:03:49 EST
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c,
mlx5_nodnic_get_drvinfo() copies KBUILD_MODNAME into drvinfo->driver…
--
net/mlx5: nodnic: Add ethtool driver info
This adds a get_drvinfo ethtool callback to the nodnic driver. It reports
the driver name, the firmware version read from the initialization
segment, and the PCI bus information.
> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c
> index 9ab996a6ebaf0..bdbe76b8dbcba 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c
[ ... ]
> +static void mlx5_nodnic_get_drvinfo(struct net_device *netdev,
> + struct ethtool_drvinfo *drvinfo)
> +{
> + struct mlx5_nodnic_priv *priv = netdev_priv(netdev);
> + struct mlx5_nodnic_core_dev *mdev = priv->core_dev;
> +
> + strscpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver));
> + snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
> + "%d.%d.%04d", mlx5_nodnic_fw_rev_maj(mdev),
> + mlx5_nodnic_fw_rev_min(mdev), mlx5_nodnic_fw_rev_sub(mdev));
> + strscpy(drvinfo->bus_info, dev_name(mdev->device),
> + sizeof(drvinfo->bus_info));
> +}
[Severity: Low]
This isn't a bug, but are the two strscpy() calls in
mlx5_nodnic_get_drvinfo() needed?
ethtool_get_drvinfo() in net/ethtool/ioctl.c already fills in these
fields from the parent device:
net/ethtool/ioctl.c:ethtool_get_drvinfo() {
...
if (ops->get_drvinfo) {
ops->get_drvinfo(dev, &rsp->info);
if (!rsp->info.bus_info[0] && parent)
strscpy(rsp->info.bus_info, dev_name(parent), ...);
if (!rsp->info.driver[0] && parent && parent->driver)
strscpy(rsp->info.driver, parent->driver->name, ...);
} else if (parent && parent->driver) {
strscpy(rsp->info.bus_info, dev_name(parent), ...);
strscpy(rsp->info.driver, parent->driver->name, ...);
}
...
}
For this driver, mlx5_nodnic_build_netdev() calls
SET_NETDEV_DEV(netdev, core_dev->device), and core_dev->device is
&pdev->dev. parent->driver->name comes from mlx5_nodnic_core_driver,
whose .name is KBUILD_MODNAME in the same mlx5_nodnic module. The core
therefore produces the same driver and bus_info strings this callback
writes.
Could the callback fill only fw_version and leave driver and bus_info
to the core?
On the same point, the commit message says:
Implement the get_drvinfo ethtool operation to report the driver name,
firmware version, and PCI bus information.
Before this patch, "ethtool -i" already showed the mlx5_nodnic driver
name and the PCI bus info. Would it be more accurate for the commit
message to say that only the firmware version is new?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126182448.707782-1-tariqt%40nvidia.com