From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: "Köry Maincent" <kory.maincent@bootlin.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
Radu Pirea <radu-nicolae.pirea@oss.nxp.com>,
Jay Vosburgh <j.vosburgh@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
Horatiu Vultur <horatiu.vultur@microchip.com>,
UNGLinuxDriver@microchip.com, Simon Horman <horms@kernel.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org,
Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [PATCH net-next v7 15/16] net: ethtool: ts: Let the active time stamping layer be selectable
Date: Wed, 22 Nov 2023 16:08:50 +0200 [thread overview]
Message-ID: <20231122140850.li2mvf6tpo3f2fhh@skbuf> (raw)
In-Reply-To: <20231122144453.5eb0382f@kmaincent-XPS-13-7390>
On Wed, Nov 22, 2023 at 02:44:53PM +0100, Köry Maincent wrote:
> On Tue, 21 Nov 2023 09:43:54 -0800
> Jakub Kicinski <kuba@kernel.org> wrote:
>
> > 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).
>
> You say this patch series should simply add TSINFO_SET command to set the
> current phc_index?
>
> It won't solve your requirement of having simultaneous hwtimestamp and
> enabling/disabling them through rx_filter and tx_types.
> You want to do this in another patch series alongside a new SIOCG/SHWTSTAMP_2
> ABI?
>
> > > - 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.
>
> Currently, the dumpit function is assigned to ethnl_default_dumpit. Wouldn't
> the behavior change of the dumpit callback break the ABI?
>
>
> > > 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.
>
> Just wondering to have a insight of future support, in the case of several
> provider qualifier and the SIOCG/SHWTSTAMP_2 layout containing the phc_index.
> Will we be able to talk to the two providers qualifiers simultaneously or is it
> not possible. To know if the SIOCG/SHWTSTAMP_2 layout would contain the
> description of the qualifier provider.
> If I understand well your mail in the thread it will be the case right?
>
> Regards,
> --
> Köry Maincent, Bootlin
> Embedded Linux and kernel engineering
> https://bootlin.com/
My understanding of Jakub's email was that he wants to see the functionality
offered by SIOCGHWTSTAMP and SIOCSHWTSTAMP converted to netlink. I don't
think that ethtool is the correct netlink family for that, given that
these aren't ethtool ioctls to begin with. Maybe the new netdev netlink
family. The conversion in its basic form would offer exactly the same
functionality. The extended netlink messages would have extra attributes
to identify the targeted hwtstamp provider. In the lack of those
attributes, the default hwtstamp provider is targeted. The definition of
the default hwtstamp provider should be as per your current patch set
(netdev, with a whitelist for current phylib PHYs).
The _listing_ of hwtstamp providers is what could be done through ethtool
netlink, similar but not identical to the way in which you are proposing
today (you are presenting blanket "layers" which correspond to netdev and
phylib, rather than individual providers).
The concept of an "active phc_index" would not explicitly exist in the
UAPI. Thus I'm not sure what's with this TSINFO_SET being floated around.
The only thing would exist is a configurable rx_filter and tx_type per
hwtstamp provider (aka "{phc_index, qualifier}"). User space will have
to learn to select the hwtstamp provider it wants to configure through
netlink, and use for its class of traffic.
This is why I mentioned by ndo_hwtstamp_set() conversion, because
suddenly it is a prerequisite for any further progress to be done.
You can't convert SIOCSHWTSTAMP to netlink if there are some driver
implementations which still use ndo_eth_ioctl(). They need to be
UAPI-agnostic.
I'm not sure what's with Richard's mention of the "_2" variants of the
ioctls. Probably a low-effort suggestion which was a bit out of context.
His main point, that you cannot extend struct hwtstamp_config as that
has a fixed binary format, is perfectly valid though. This is why
netlink is preferable, because if done correctly (meaning not with
NLA_BINARY attributes), then it is much more extensible because all
attributes are TLVs. Use NLA_BINARY, and you will run into the exact
extensibility issues that the ioctl interface has.
next prev parent reply other threads:[~2023-11-22 14:08 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 11:28 [PATCH net-next v7 00/16] net: Make timestamping selectable Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 01/16] net: Convert PHYs hwtstamp callback to use kernel_hwtstamp_config Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 02/16] net: phy: Remove the call to phy_mii_ioctl in phy_hwstamp_get/set Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 03/16] net: ethtool: Refactor identical get_ts_info implementations Köry Maincent
2023-11-14 11:28 ` [PATCH net-next v7 04/16] net: macb: Convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 05/16] net: Make dev_set_hwtstamp_phylib accessible Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 06/16] net: phy: micrel: fix ts_info value in case of no phc Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 07/16] net_tstamp: Add TIMESTAMPING SOFTWARE and HARDWARE mask Kory Maincent
2023-11-14 15:52 ` Willem de Bruijn
2023-11-19 2:22 ` Jakub Kicinski
2023-11-20 9:05 ` Köry Maincent
2023-11-20 16:48 ` Jakub Kicinski
2023-11-20 16:51 ` Willem de Bruijn
2023-11-14 11:28 ` [PATCH net-next v7 08/16] net: ethtool: Add a command to expose current time stamping layer Kory Maincent
2023-11-19 2:24 ` Jakub Kicinski
2023-11-20 9:17 ` Köry Maincent
2023-11-20 10:40 ` Köry Maincent
2023-11-14 11:28 ` [PATCH net-next v7 09/16] netlink: specs: Introduce new netlink command to get current timestamp Kory Maincent
2023-11-19 2:25 ` Jakub Kicinski
2023-11-14 11:28 ` [PATCH net-next v7 10/16] net: ethtool: Add a command to list available time stamping layers Kory Maincent
2023-11-19 2:26 ` Jakub Kicinski
2023-11-14 11:28 ` [PATCH net-next v7 11/16] netlink: specs: Introduce new netlink " Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 12/16] net: Replace hwtstamp_source by timestamping layer Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 13/16] net: Change the API of PHY default timestamp to MAC Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 14/16] net: ethtool: ts: Update GET_TS to reply the current selected timestamp Kory Maincent
2023-11-14 11:28 ` [PATCH net-next v7 15/16] net: ethtool: ts: Let the active time stamping layer be selectable Kory Maincent
2023-11-19 2:34 ` Jakub Kicinski
2023-11-20 9:44 ` Köry Maincent
2023-11-20 10:52 ` Vladimir Oltean
2023-11-20 11:14 ` Köry Maincent
2023-11-20 12:06 ` Vladimir Oltean
2023-11-20 13:49 ` Köry Maincent
2023-11-20 14:23 ` Vladimir Oltean
2023-11-20 14:53 ` Köry Maincent
2023-11-20 16:10 ` Vladimir Oltean
2023-11-20 17:17 ` Köry Maincent
2023-11-20 17:37 ` Jakub Kicinski
2023-11-20 18:39 ` Andrew Lunn
2023-11-20 18:51 ` Jakub Kicinski
2023-11-20 19:58 ` Vladimir Oltean
2023-11-20 21:45 ` Jakub Kicinski
2023-11-29 20:09 ` Köry Maincent
2023-11-29 20:37 ` Vladimir Oltean
2023-11-29 22:00 ` Köry Maincent
2023-11-29 23:56 ` Jakub Kicinski
2023-11-30 0:06 ` Rahul Rameshbabu
2023-11-20 19:09 ` Russell King (Oracle)
2023-11-20 19:00 ` Vladimir Oltean
2023-11-20 19:58 ` Jakub Kicinski
2023-11-20 21:17 ` Vladimir Oltean
2023-11-20 21:37 ` Jakub Kicinski
2023-11-20 22:05 ` Vladimir Oltean
2023-11-21 17:31 ` Köry Maincent
2023-11-21 17:43 ` Jakub Kicinski
2023-11-22 13:44 ` Köry Maincent
2023-11-22 14:08 ` Vladimir Oltean [this message]
2023-11-22 14:19 ` Vladimir Oltean
2023-11-22 14:36 ` Vladimir Oltean
2023-11-22 16:54 ` Jakub Kicinski
2023-11-22 16:59 ` Vladimir Oltean
2023-11-22 17:55 ` Jakub Kicinski
2023-11-22 18:11 ` Willem de Bruijn
2023-11-24 17:27 ` Vladimir Oltean
2023-11-24 19:45 ` Willem de Bruijn
2023-11-25 19:41 ` Richard Cochran
2023-11-22 14:57 ` Köry Maincent
2023-11-22 16:50 ` Jakub Kicinski
2023-11-22 16:55 ` Vladimir Oltean
2023-11-22 18:01 ` Jakub Kicinski
2023-11-23 15:00 ` Köry Maincent
2023-11-23 17:32 ` Jakub Kicinski
2023-11-24 15:43 ` Vladimir Oltean
2023-11-24 17:34 ` Köry Maincent
2023-11-24 19:57 ` Vladimir Oltean
2023-11-24 20:47 ` Willem de Bruijn
2023-11-21 23:40 ` Richard Cochran
2023-11-14 11:28 ` [PATCH net-next v7 16/16] netlink: specs: Introduce time stamping set command Kory Maincent
2023-11-18 15:10 ` [PATCH net-next v7 00/16] net: Make timestamping selectable patchwork-bot+netdevbpf
2023-11-19 2:35 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231122140850.li2mvf6tpo3f2fhh@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=andy@greyhouse.net \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=horatiu.vultur@microchip.com \
--cc=horms@kernel.org \
--cc=j.vosburgh@gmail.com \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=radu-nicolae.pirea@oss.nxp.com \
--cc=richardcochran@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox