Re: [RFC PATCH net-next v2 09/17] ethtool: implement GET_DRVINFO message

From: Michal Kubecek
Date: Mon Jul 30 2018 - 10:46:49 EST


On Mon, Jul 30, 2018 at 04:28:25PM +0200, Andrew Lunn wrote:
> On Mon, Jul 30, 2018 at 02:53:27PM +0200, Michal Kubecek wrote:
>
> > + ETHA_DRVINFO_FWVERSION (string) firmware version
> > + ETHA_DRVINFO_BUSINFO (string) device bus address
> > + ETHA_DRVINFO_EROM_VER (string) expansion ROM version
> > + ETHA_DRVINFO_N_PRIV_FLAGS (u32) number of private flags
> > + ETHA_DRVINFO_N_STATS (u32) number of device stats
>
> I know there is at least one driver that has somewhat dynamic number
> of statistics. It would be better to have the strings and the values
> in the same message, so there is no need to first get the number of
> strings, allocate the memory, get the strings, then get the values.
>
> > + ETHA_DRVINFO_TESTINFO_LEN (u32) number of test results
>
> In theory, this also does not need to be fixed.

This is interesting. It would mean current (ioctl) ethtool approach with
string set may not work correctly either. On the other hand, this should
not be a problem for netlink interface. Statistics are unlikely to
appear in notifications and daemons collecting them periodically will
have to learn with it. Adding test name to notification "test started"
or "test finished" seems quite natural.

> > + ETHA_DRVINFO_EEDUMP_LEN (u32) EEPROM dump size
> > + ETHA_DRVINFO_REGDUMP_LEN (u32) register dump size
>
> I would suggest removing all these _LEN properties, and let netlink
> return what it needs to return.

Agreed.

Michal Kubecek