Re: [PATCH net-next v5 08/16] net: ethtool: Add a command to expose current time stamping layer

From: Andrew Lunn
Date: Fri Oct 13 2023 - 12:15:02 EST


> > All these possibles timestamps go through exclusively the netdev API or the
> > phylib API. Even the software timestamping is done in the netdev driver,
> > therefore it goes through the netdev API and then should have the
> > NETDEV_TIMESTAMPING bit set.
>
> Netdev vs phylib is an implementation detail of Linux.
> I'm also surprised that you changed this.
>
> > > > + */
> > > > +enum {
> > > > + NO_TIMESTAMPING = 0,
> > > > + NETDEV_TIMESTAMPING = (1 << 0),
> > > > + PHYLIB_TIMESTAMPING = (1 << 1),
> > > > + SOFTWARE_TIMESTAMPING = (1 << 2) | (1 << 0),

Just emphasising Jakubs point here. phylib is an implementation
detail, in that the MAC driver might be using firmware to drive its
PHY, and that firmware can do a timestamp in the PHY. The API being
defined here should be independent of the implementation details. So
it probably should be MAC_TIMESTAMPING and PHY_TIMESTAMPING, and leave
it to the driver to decide if its PHYLIB doing the actual work, or
firmware.

Andrew