Re: [PATCH net-next v5 12/22] ethtool: provide string sets with GET_STRSET request

Jakub Kicinski
2019-03-28T18:53:03Z

On Thu, 28 Mar 2019 18:35:24 +0100, Jiri Pirko wrote:
> Thu, Mar 28, 2019 at 03:04:28PM CET, mkubecek@suse.cz wrote:
> >On Thu, Mar 28, 2019 at 02:43:13PM +0100, Jiri Pirko wrote:
> >>
> >> I don't like this. This should not be bitfield/set. This should be
> >> simply nested array of enum values:
> >>
> >> enum ethtool_link_mode {
> >> ETHTOOL_LINK_MODE_10baseT_Half,
> >> ETHTOOL_LINK_MODE_10baseT_Full,
> >> ETHTOOL_LINK_MODE_100baseT_Half,
> >> ETHTOOL_LINK_MODE_100baseT_Full,
> >> ETHTOOL_LINK_MODE_1000baseT_Full,
> >> };
> >
> >We already have such enum. The problem with your "no string" approach is
> >that it requires all userspace applications to (1) keep this enum in
>
> That is how it is usually done. UAPI defines ATTRS and values, userspace
> assigns appropriate strings.

+1 FWIW, I'm with Jiri on the string situation.