[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f0376e1dbc846a799d62a56bc6c9ff2@realtek.com>
Date: Tue, 18 Jun 2024 09:56:40 +0000
From: Justin Lai <justinlai0215@...ltek.com>
To: Andrew Lunn <andrew@...n.ch>
CC: Jakub Kicinski <kuba@...nel.org>,
"davem@...emloft.net"
<davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org"
<netdev@...r.kernel.org>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"horms@...nel.org" <horms@...nel.org>,
"rkannoth@...vell.com"
<rkannoth@...vell.com>,
Ping-Ke Shih <pkshih@...ltek.com>,
Larry Chiu
<larry.chiu@...ltek.com>
Subject: RE: [PATCH net-next v20 10/13] rtase: Implement ethtool function
>
> > > > + strscpy(drvinfo->bus_info, pci_name(tp->pdev), 32);
> > >
> > > Can you double check that overwriting these fields is actually needed?
> > > I think core will fill this in for you in ethtool_get_drvinfo()
> >
> > I have removed this line of code for testing. Before removing the
> > code, I could obtain bus info by entering "ethtool -i". However, after
> > removing the code, entering "ethtool -i" no longer retrieves the bus info.
>
> https://elixir.bootlin.com/linux/latest/source/net/ethtool/ioctl.c#L710
>
> 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),
> sizeof(rsp->info.bus_info));
>
> This suggests you have not set the parent device.
>
> Andrew
Hi Andrew,
I understand your explanation. However, when we input ethtool -i,
shouldn't we aim to get the bus info of the actual device rather than
the parent device? That's why I think we need to add this line.
Powered by blists - more mailing lists