Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: tariqt@nvidia.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com,
	cjubran@nvidia.com, gal@nvidia.com, linux-kernel@vger.kernel.org,
	shshitrit@nvidia.com, horms@kernel.org
Subject: Re: [PATCH net-next V3 4/5] net/mlx5: nodnic: Add ethtool driver info
Date: Fri, 27 Nov 2026 19:03:43 +0000	[thread overview]
Message-ID: <179580622390.3135.423426456579450478@kernel.org> (raw)
In-Reply-To: <20261126182448.707782-5-tariqt@nvidia.com>

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

  reply	other threads:[~2026-11-27 19:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 18:24 [PATCH net-next V3 0/5] net/mlx5: Introduce mlx5_nodnic, a driver for DRAM-less NVIDIA Mellanox NIC functions Tariq Toukan
2026-11-26 18:24 ` [PATCH net-next V3 1/5] net/mlx5: nodnic: Introduce the mlx5_nodnic driver Tariq Toukan
2026-11-27  8:58   ` Paolo Abeni
2026-11-27 19:03   ` netdev-bot+sashiko
2026-11-26 18:24 ` [PATCH net-next V3 2/5] net/mlx5: nodnic: Implement data path Tariq Toukan
2026-11-27 19:03   ` netdev-bot+sashiko
2026-11-26 18:24 ` [PATCH net-next V3 3/5] net/mlx5: nodnic: Add TX/RX statistics Tariq Toukan
2026-11-27 19:03   ` netdev-bot+sashiko
2026-11-26 18:24 ` [PATCH net-next V3 4/5] net/mlx5: nodnic: Add ethtool driver info Tariq Toukan
2026-11-27 19:03   ` netdev-bot+sashiko [this message]
2026-11-26 18:24 ` [PATCH net-next V3 5/5] net/mlx5: nodnic: Add health monitoring Tariq Toukan
2026-11-27 19:03   ` netdev-bot+sashiko

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=179580622390.3135.423426456579450478@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=cjubran@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gal@nvidia.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shshitrit@nvidia.com \
    --cc=tariqt@nvidia.com \
    /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