Re: [PATCH net-next v7 15/16] net: ethtool: ts: Let the active time stamping layer be selectable

From: Jakub Kicinski
Date: Tue Nov 21 2023 - 12:44:02 EST


On Tue, 21 Nov 2023 18:31:14 +0100 Köry Maincent wrote:
> - Expand struct hwtstamp_config with a phc_index member for the SIOCG/SHWTSTAMP
> commands.
> To keep backward compatibility if phc_index is not set in the hwtstamp_config
> data from userspace use the default hwtstamp (the default being selected as
> done in my patch series).
> Is this possible, would it breaks things?

I'd skip this bit, and focus on the ETHTOOL_TSINFO. Keep the ioctl as
"legacy" and do all the extensions in ethtool. TSINFO_GET can serve
as GET, to avoid adding 3rd command for the same thing. TSINFO_SET
would be new (as you indicate below).

> - In netlink part, send one netlink tsinfo skb for each phc_index.

phc_index and netdev combination. A DO command can only generate one
answer (or rather, it should generate only one answer, there are few
hard rules in netlink). So we need to move that functionality to DUMP.
We can filter the DUMP based on user-provided ifindex and/or phc_index.

> Could be done in a later patch series:
> - Expand netlink TSINFO with ETHTOOL_A_TSINFO_HWSTAMP_PROVIDER_QUALIFIER.
> Describing this struct:
> enum ethtool_hwstamp_provider_qualifier {
> ETHTOOL_HWSTAMP_PROVIDER_QUALIFIER_PRECISE,
> ETHTOOL_HWSTAMP_PROVIDER_QUALIFIER_APPROX,
> };
>
> Set the desired qualifier through TSINFO_SET or through SIOCSHWTSTAMP by
> expanding again the struct hwtstamp_config.
>
> Do you think this is feasible?