All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: Jiri Pirko <jiri@nvidia.com>,
	netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org,
	Boris Brezillon <bbrezillon@kernel.org>,
	Arnaud Ebalard <arno@natisbad.org>,
	Srujana Challa <schalla@marvell.com>,
	Kurt Kanzenbach <kurt@linutronix.de>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	Michael Chan <michael.chan@broadcom.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Dimitris Michailidis <dmichail@fungible.com>,
	Yisen Zhuang <yisen.zhuang@huawei.com>,
	Salil Mehta <salil.mehta@huawei.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Sunil Goutham <sgoutham@marvell.com>,
	Linu Cherian <lcherian@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>, hariprasad <hkelam@marvell.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	Taras Chornyi <tchornyi@marvell.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	Petr Machata <petrm@nvidia.com>,
	Simon Horman <simon.horman@corigine.com>,
	Shannon Nelson <snelson@pensando.io>,
	drivers@pensando.io, Ariel Elior <aelior@marvell.com>,
	Manish Chopra <manishc@marvell.com>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	Vadim Fedorenko <vadfed@fb.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Vadim Pasternak <vadimp@mellanox.com>,
	Shalom Toledo <shalomt@mellanox.com>,
	linux-crypto@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
	linux-rdma@vger.kernel.org, oss-drivers@corigine.com,
	Jiri Pirko <jiri@mellanox.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Hao Chen <chenhao288@hisilicon.com>,
	Guangbin Huang <huangguangbin2@huawei.com>,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Shijith Thotton <sthotton@marvell.com>,
	Ido Schimmel <idosch@mellanox.com>
Subject: Re: [PATCH net-next v3 1/5] mlxsw: minimal: fix mlxsw_m_module_get_drvinfo() to correctly report driver name
Date: Sun, 27 Nov 2022 18:14:50 +0200	[thread overview]
Message-ID: <Y4OM+q5yqCE4/aGs@shredder> (raw)
In-Reply-To: <20221127130919.638324-2-mailhol.vincent@wanadoo.fr>

On Sun, Nov 27, 2022 at 10:09:15PM +0900, Vincent Mailhol wrote:
> Currently, mlxsw_m_module_get_drvinfo() reports the device_kind. The
> device_kind is not necessarily the same as the device_name. For
> example, the mlxsw_i2c implementation sets up the device_kind as
> ic2_client::name in [1] which indicates the type of the device
> (e.g. chip name), not the actual driver name.
> 
> Fix it so that it correctly reports the driver name.
> 
> [1] mlxsw_i2c_probe() from drivers/net/ethernet/mellanox/mlxsw/i2c.c
> Link: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/i2c.c#L714

Before the series:

# ethtool -i eth2 | grep driver
driver: mlxsw_minimal

After the series:

# ethtool -i eth2 | grep driver
driver: mlxsw_minimal

See:
https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/minimal.c#L721

The current code is consistent with the PCI driver:
https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c#L17

Which also correctly reports the driver name.

So I prefer to keep the code as-is.

Thanks

> 
> Fixes: 9bbd7efbc055 ("mlxsw: i2c: Extend initialization with querying firmware info")
> CC: Shalom Toledo <shalomt@mellanox.com>
> CC: Ido Schimmel <idosch@mellanox.com>
> CC: Vadim Pasternak <vadimp@mellanox.com>
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/minimal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c
> index 6b56eadd736e..9b37ddbe0cba 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c
> @@ -92,7 +92,7 @@ static void mlxsw_m_module_get_drvinfo(struct net_device *dev,
>  	struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev);
>  	struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m;
>  
> -	strscpy(drvinfo->driver, mlxsw_m->bus_info->device_kind,
> +	strscpy(drvinfo->driver, dev_driver_string(dev->dev.parent),
>  		sizeof(drvinfo->driver));
>  	snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
>  		 "%d.%d.%d",
> -- 
> 2.37.4
> 

WARNING: multiple messages have this Message-ID (diff)
From: Ido Schimmel <idosch@nvidia.com>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Shijith Thotton <sthotton@marvell.com>,
	Simon Horman <simon.horman@corigine.com>,
	Kurt Kanzenbach <kurt@linutronix.de>,
	Eric Dumazet <edumazet@google.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	drivers@pensando.io, Linu Cherian <lcherian@marvell.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Leon Romanovsky <leon@kernel.org>,
	linux-rdma@vger.kernel.org, Shalom Toledo <shalomt@mellanox.com>,
	Srujana Challa <schalla@marvell.com>,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Hao Chen <chenhao288@hisilicon.com>,
	Guangbin Huang <huangguangbin2@huawei.com>,
	Shannon Nelson <snelson@pensando.io>,
	intel-wired-lan@lists.osuosl.org,
	Jakub Kicinski <kuba@kernel.org>, Vadim Fedorenko <vadfed@fb.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Yisen Zhuang <yisen.zhuang@huawei.com>,
	Sunil Goutham <sgoutham@marvell.com>,
	Ariel Elior <aelior@marvell.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Arnaud Ebalard <arno@natisbad.org>,
	Ido Schimmel <idosch@mellanox.com>,
	Jiri Pirko <jiri@mellanox.com>, Jiri Pirko <jiri@nvidia.com>,
	Michael Chan <michael.chan@broadcom.com>,
	Petr Machata <petrm@nvidia.com>,
	Salil Mehta <salil.mehta@huawei.com>,
	Dimitris Michailidis <dmichail@fungible.com>,
	Manish Chopra <manishc@marvell.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	netdev@vger.kernel.org, oss-drivers@corigine.com,
	Vadim Pasternak <vadimp@mellanox.com>,
	linux-kernel@vger.kernel.org,
	Geetha sowjanya <gakula@marvell.com>,
	Taras Chornyi <tchornyi@marvell.com>,
	hariprasad <hkelam@marvell.com>,
	linux-crypto@vger.kernel.org,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH net-next v3 1/5] mlxsw: minimal: fix mlxsw_m_module_get_drvinfo() to correctly report driver name
Date: Sun, 27 Nov 2022 18:14:50 +0200	[thread overview]
Message-ID: <Y4OM+q5yqCE4/aGs@shredder> (raw)
In-Reply-To: <20221127130919.638324-2-mailhol.vincent@wanadoo.fr>

On Sun, Nov 27, 2022 at 10:09:15PM +0900, Vincent Mailhol wrote:
> Currently, mlxsw_m_module_get_drvinfo() reports the device_kind. The
> device_kind is not necessarily the same as the device_name. For
> example, the mlxsw_i2c implementation sets up the device_kind as
> ic2_client::name in [1] which indicates the type of the device
> (e.g. chip name), not the actual driver name.
> 
> Fix it so that it correctly reports the driver name.
> 
> [1] mlxsw_i2c_probe() from drivers/net/ethernet/mellanox/mlxsw/i2c.c
> Link: https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/i2c.c#L714

Before the series:

# ethtool -i eth2 | grep driver
driver: mlxsw_minimal

After the series:

# ethtool -i eth2 | grep driver
driver: mlxsw_minimal

See:
https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/minimal.c#L721

The current code is consistent with the PCI driver:
https://elixir.bootlin.com/linux/v6.1-rc1/source/drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c#L17

Which also correctly reports the driver name.

So I prefer to keep the code as-is.

Thanks

> 
> Fixes: 9bbd7efbc055 ("mlxsw: i2c: Extend initialization with querying firmware info")
> CC: Shalom Toledo <shalomt@mellanox.com>
> CC: Ido Schimmel <idosch@mellanox.com>
> CC: Vadim Pasternak <vadimp@mellanox.com>
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> ---
>  drivers/net/ethernet/mellanox/mlxsw/minimal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c
> index 6b56eadd736e..9b37ddbe0cba 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c
> @@ -92,7 +92,7 @@ static void mlxsw_m_module_get_drvinfo(struct net_device *dev,
>  	struct mlxsw_m_port *mlxsw_m_port = netdev_priv(dev);
>  	struct mlxsw_m *mlxsw_m = mlxsw_m_port->mlxsw_m;
>  
> -	strscpy(drvinfo->driver, mlxsw_m->bus_info->device_kind,
> +	strscpy(drvinfo->driver, dev_driver_string(dev->dev.parent),
>  		sizeof(drvinfo->driver));
>  	snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
>  		 "%d.%d.%d",
> -- 
> 2.37.4
> 
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2022-11-27 16:15 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 15:49 [RFC PATCH] net: devlink: devlink_nl_info_fill: populate default information Vincent Mailhol
2022-11-23  4:12 ` Jakub Kicinski
2022-11-23  9:42   ` Vincent MAILHOL
2022-11-24  3:06     ` Jakub Kicinski
2022-11-24  5:33       ` Vincent MAILHOL
2022-11-24  8:53         ` Jiri Pirko
2022-11-28 18:43         ` Jakub Kicinski
2022-11-28 23:14           ` Vincent MAILHOL
2022-11-23  9:46 ` Jiri Pirko
2022-11-23 11:00   ` Vincent MAILHOL
2022-11-23 12:10     ` Jiri Pirko
2022-11-23 16:08       ` Vincent MAILHOL
2022-11-23 16:26         ` Jiri Pirko
2022-11-24 16:20       ` Vincent MAILHOL
2022-11-27  8:15 ` [PATCH net-next v2 0/5] net: devlink: return the driver name in devlink_nl_info_fill Vincent Mailhol
2022-11-27  8:15   ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 1/5] mlxsw: minimal: fix mlxsw_m_module_get_drvinfo() to correctly report driver name Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 2/5] mlxsw: core: fix mlxsw_devlink_info_get() " Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 3/5] net: devlink: let the core report the driver name instead of the drivers Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27  8:16   ` [PATCH net-next v2 4/5] net: devlink: remove devlink_info_driver_name_put() Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 12:01     ` kernel test robot
2022-11-27 12:11     ` kernel test robot
2022-11-27  8:16   ` [PATCH net-next v2 5/5] net: devlink: make the devlink_ops::info_get() callback optional Vincent Mailhol
2022-11-27  8:16     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09 ` [PATCH net-next v3 0/5] net: devlink: return the driver name in devlink_nl_info_fill Vincent Mailhol
2022-11-27 13:09   ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09   ` [PATCH net-next v3 1/5] mlxsw: minimal: fix mlxsw_m_module_get_drvinfo() to correctly report driver name Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 16:14     ` Ido Schimmel [this message]
2022-11-27 16:14       ` Ido Schimmel
2022-11-27 13:09   ` [PATCH net-next v3 2/5] mlxsw: core: fix mlxsw_devlink_info_get() " Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 16:17     ` Ido Schimmel
2022-11-27 16:17       ` [Intel-wired-lan] " Ido Schimmel
2022-11-28  1:42       ` Vincent MAILHOL
2022-11-28  1:42         ` [Intel-wired-lan] " Vincent MAILHOL
2022-11-27 13:09   ` [PATCH net-next v3 3/5] net: devlink: let the core report the driver name instead of the drivers Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09   ` [PATCH net-next v3 4/5] net: devlink: remove devlink_info_driver_name_put() Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-27 13:09   ` [PATCH net-next v3 5/5] net: devlink: make the devlink_ops::info_get() callback optional Vincent Mailhol
2022-11-27 13:09     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28  4:15 ` [PATCH net-next v4 0/3] net: devlink: return the driver name in devlink_nl_info_fill Vincent Mailhol
2022-11-28  4:15   ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28  4:15   ` [PATCH net-next v4 1/3] net: devlink: let the core report the driver name instead of the drivers Vincent Mailhol
2022-11-28  4:15     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28 11:49     ` Ido Schimmel
2022-11-28 11:49       ` [Intel-wired-lan] " Ido Schimmel
2022-11-28  4:15   ` [PATCH net-next v4 2/3] net: devlink: remove devlink_info_driver_name_put() Vincent Mailhol
2022-11-28  4:15     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28  4:15   ` [PATCH net-next v4 3/3] net: devlink: make the devlink_ops::info_get() callback optional Vincent Mailhol
2022-11-28  4:15     ` [Intel-wired-lan] " Vincent Mailhol
2022-11-28 18:42     ` Jakub Kicinski
2022-11-28 18:42       ` [Intel-wired-lan] " Jakub Kicinski

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=Y4OM+q5yqCE4/aGs@shredder \
    --to=idosch@nvidia.com \
    --cc=aelior@marvell.com \
    --cc=andrew@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=arno@natisbad.org \
    --cc=bbrezillon@kernel.org \
    --cc=chenhao288@hisilicon.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=davem@davemloft.net \
    --cc=dmichail@fungible.com \
    --cc=drivers@pensando.io \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=gakula@marvell.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hkelam@marvell.com \
    --cc=huangguangbin2@huawei.com \
    --cc=idosch@mellanox.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=jiri@mellanox.com \
    --cc=jiri@nvidia.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=lcherian@marvell.com \
    --cc=leon@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=manishc@marvell.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=oss-drivers@corigine.com \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=richardcochran@gmail.com \
    --cc=saeedm@nvidia.com \
    --cc=salil.mehta@huawei.com \
    --cc=sbhatta@marvell.com \
    --cc=schalla@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=shalomt@mellanox.com \
    --cc=simon.horman@corigine.com \
    --cc=snelson@pensando.io \
    --cc=sthotton@marvell.com \
    --cc=tchornyi@marvell.com \
    --cc=vadfed@fb.com \
    --cc=vadimp@mellanox.com \
    --cc=yisen.zhuang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.