Re: [PATCH net-next v1 1/2] ethtool: provide UAPI for PHY Signal Quality Index (SQI)

From: Michal Kubecek
Date: Tue May 19 2020 - 07:18:47 EST


On Tue, May 19, 2020 at 12:58:55PM +0200, Oleksij Rempel wrote:
> On Tue, May 19, 2020 at 10:55:20AM +0200, Michal Kubecek wrote:
> > I'm also a bit worried about hardcoding the 0-7 value range. While I
> > understand that it's defined by standard for 100base-T1, we my want to
> > provide such information for other devices in the future. I tried to
> > search if there is something like that for 1000base-T1 and found this:
> >
> > http://www.sigent.cn/wp-content/uploads/2019/12/TE-1400_User-Manual_1000BASE-T1-EMC-Converter_v3.3.pdf
> >
> > The screenshot on page 10 shows "SQI Value: 00015".
>
> Nice, screenshot based reverse engineering :)
>
> > It's probably not
> > standardized (yet?) but it seems to indicate we may expect other devices
> > providing SQI information with different value range.
>
> what maximal range do we wont to export? u8, u16 or u32?

As the userspace API is "cast in stone" and there no actual space saved
by using u8 or u16 due to padding (attributes are always padded to
a multiple of 32 bits), I would suggest to go with u32 in uapi.
Internally, we can use a smaller type for now if it is more convenient.

Michal