Re: [PATCH net-next v20 10/13] rtase: Implement ethtool function

From: Andrew Lunn
Date: Mon Jun 17 2024 - 10:59:54 EST


> > > + 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