All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
Cc: Leon Romanovsky <leon@kernel.org>,
	netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Guangbin Huang <huangguangbin2@huawei.com>,
	Sean Anderson <sean.anderson@seco.com>, Tom Rix <trix@redhat.com>,
	Tonghao Zhang <xiangxia.m.yue@gmail.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Marco Bonelli <marco@mebeim.net>
Subject: Re: [PATCH net-next v1] ethtool: ethtool_get_drvinfo: populate drvinfo fields even if callback exits
Date: Thu, 10 Nov 2022 08:59:07 -0800	[thread overview]
Message-ID: <20221110085907.764e18cd@kernel.org> (raw)
In-Reply-To: <CAMZ6Rq+K6oD9auaNzt1kJAW0nz9Hs=ODDvOiEaiKi2_1KVNA8g@mail.gmail.com>

On Thu, 10 Nov 2022 17:34:55 +0900 Vincent MAILHOL wrote:
> > While I'm typing - I've used dev_driver_string() to get the driver
> > name in the past. Perhaps something to consider?  
> 
> I am not sure of that one. If dev->dev.parent->driver is not set, it
> defaults to dev_bus_name() which is .bus_info, isn't it?
> https://elixir.bootlin.com/linux/latest/source/drivers/base/core.c#L2181

I don't think so?  We put dev_name() into bus_info, which is usually
the address of the device on the bus (e.g. (D)BDF for PCI, like
0000:00:14.3). The name of the bus is pci. dev_driver_string() will
also fall back to printing class name.

>  For the end user, it might be better to display an empty driver name
> in 'ethtool -i' rather than reporting the bus_info twice?
> 
> I mean, if you ask me for my opinion, then my answer is "I am not
> sure". If you have confidence that dev_driver_string() is better, then
> I will send a v2 right away.

Well, it doesn't matter. I asked because handful of popular drivers 
use dev_driver_string(). But.. these are drivers so parent->driver 
will be set and it ends up not making any difference.

  parent reply	other threads:[~2022-11-10 16:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08  3:57 [PATCH net-next v1] ethtool: ethtool_get_drvinfo: populate drvinfo fields even if callback exits Vincent Mailhol
2022-11-09 17:52 ` Leon Romanovsky
2022-11-09 20:26   ` Jakub Kicinski
2022-11-10  8:34     ` Vincent MAILHOL
2022-11-10  9:11       ` Leon Romanovsky
2022-11-10 11:43         ` Vincent MAILHOL
2022-11-10 12:00           ` Leon Romanovsky
2022-11-10 15:53             ` Vincent MAILHOL
2022-11-10 17:22               ` Leon Romanovsky
2022-11-10 13:41         ` Andrew Lunn
2022-11-10 17:01         ` Jakub Kicinski
2022-11-10 17:20           ` Leon Romanovsky
2022-11-11  6:43           ` Vincent MAILHOL
2022-11-11 16:13             ` Leon Romanovsky
2022-11-10 16:59       ` Jakub Kicinski [this message]
2022-11-10 17:40 ` patchwork-bot+netdevbpf

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=20221110085907.764e18cd@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=huangguangbin2@huawei.com \
    --cc=leon@kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=marco@mebeim.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.anderson@seco.com \
    --cc=trix@redhat.com \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=xiangxia.m.yue@gmail.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.