All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
Cc: Jakub Kicinski <kuba@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 14:00:17 +0200	[thread overview]
Message-ID: <Y2zn0YVlMaHNEOLR@unreal> (raw)
In-Reply-To: <CAMZ6RqJ8P=WUCQQSZ=A_g0brdwDazqCDMUhU+_NN5NWajLFZng@mail.gmail.com>

On Thu, Nov 10, 2022 at 08:43:25PM +0900, Vincent MAILHOL wrote:
> On Thu. 10 Nov. 2022 at 18:11, Leon Romanovsky <leon@kernel.org> wrote:
> > On Thu, Nov 10, 2022 at 05:34:55PM +0900, Vincent MAILHOL wrote:
> > > On Thu. 10 nov. 2022 at 05:26, Jakub Kicinski <kuba@kernel.org> wrote:
> > > > On Wed, 9 Nov 2022 19:52:13 +0200 Leon Romanovsky wrote:
> > > > > On Tue, Nov 08, 2022 at 12:57:54PM +0900, Vincent Mailhol wrote:
> > > > > > If ethtool_ops::get_drvinfo() callback isn't set,
> > > > > > ethtool_get_drvinfo() will fill the ethtool_drvinfo::name and
> > > > > > ethtool_drvinfo::bus_info fields.
> > > > > >
> > > > > > However, if the driver provides the callback function, those two
> > > > > > fields are not touched. This means that the driver has to fill these
> > > > > > itself.
> > > > >
> > > > > Can you please point to such drivers?
> > > >
> > > > What you mean by "such drivers" is not clear from the quoted context,
> > > > at least to me.
> > >
> > > An example:
> > > https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/broadcom/bnx2.c#L7041
> > >
> > > This driver wants to set fw_version but needs to also fill the driver
> > > name and bus_info. My patch will enable *such drivers* to only fill
> > > the fw_version and delegate the rest to the core.
> >
> > Sorry for being misleading, It looks like I typed only part of the sentence
> > which I had in my mind. I wanted to see if any driver exists which prints
> > drv_name and bus_info different from default.
> >
> > >
> > > > > One can argue that they don't need to touch these fields in a first
> > > > > place and ethtool_drvinfo should always overwrite them.
> > > >
> > > > Quite likely most driver prints to .driver and .bus_info can be dropped
> > > > with this patch in place. Then again, I'm suspecting it's a bit of a
> > > > chicken and an egg problem with people adding new drivers not having
> > > > an incentive to add the print in the core and people who want to add
> > > > the print in the core not having any driver that would benefit.
> > > > Therefore I'd lean towards accepting Vincent's patch as is even if
> > > > the submission can likely be more thorough and strict.
> > >
> > > If we can agree that no drivers should ever print .driver and
> > > .bus_info, then I am fine to send a clean-up patch to remove all this
> > > after this one gets accepted. However, I am not willing to invest time
> > > for nothing. So would one of you be ready to sign-off such a  clean-up
> > > patch?
> >
> > I will be happy to see such patch and will review it, but can't add sign-off
> > as I'm not netdev maintainer.
> 
> Well, if you want to review, just have a look at:
>   $ git grep -W "get_drvinfo(struct"

BTW, in some of the callbacks, if driver doesn't exists, they print "N/A",
while in your patch it will be empty string.

Thanks

  reply	other threads:[~2022-11-10 12:00 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 [this message]
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
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=Y2zn0YVlMaHNEOLR@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=huangguangbin2@huawei.com \
    --cc=kuba@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.