2023-11-19 02:24:37

by Jakub Kicinski

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

On Tue, 14 Nov 2023 12:28:36 +0100 Kory Maincent wrote:
> + ops->get_ts_info(dev, &ts_info);
> + if (ts_info.so_timestamping &
> + SOF_TIMESTAMPING_HARDWARE_MASK)
> + data->ts_layer = MAC_TIMESTAMPING;
> +
> + if (ts_info.so_timestamping &
> + SOF_TIMESTAMPING_SOFTWARE_MASK)
> + data->ts_layer = SOFTWARE_TIMESTAMPING;

How does this work? so_timestamping is capabilities, not what's
enabled now. So if driver supports SW stamping we always return
SOFTWARE?


2023-11-20 09:20:08

by Kory Maincent

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

On Sat, 18 Nov 2023 18:24:24 -0800
Jakub Kicinski <[email protected]> wrote:

> On Tue, 14 Nov 2023 12:28:36 +0100 Kory Maincent wrote:
> > + ops->get_ts_info(dev, &ts_info);
> > + if (ts_info.so_timestamping &
> > + SOF_TIMESTAMPING_HARDWARE_MASK)
> > + data->ts_layer = MAC_TIMESTAMPING;
> > +
> > + if (ts_info.so_timestamping &
> > + SOF_TIMESTAMPING_SOFTWARE_MASK)
> > + data->ts_layer = SOFTWARE_TIMESTAMPING;
>
> How does this work? so_timestamping is capabilities, not what's
> enabled now. So if driver supports SW stamping we always return
> SOFTWARE?

Yes, the software timestamping comes from the MAC capabilities.
I decided to separate software and MAC timestamping. If we select PHY
timestamping we can't use software timestamping and for an user, selecting the
MAC as timestamping seems not logical to use software timestamping.

Indeed there is a mistake here I should have used "else if" condition.
Mmh in fact, maybe not, because it would breaks the access to software
timestamping until patch 13.
I will remove the SOFTWARE/MAC timestamping distinction from this patch.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

2023-11-20 10:41:51

by Kory Maincent

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

On Mon, 20 Nov 2023 10:17:57 +0100
Köry Maincent <[email protected]> wrote:

> On Sat, 18 Nov 2023 18:24:24 -0800
> Jakub Kicinski <[email protected]> wrote:
>
> > On Tue, 14 Nov 2023 12:28:36 +0100 Kory Maincent wrote:
> > > + ops->get_ts_info(dev, &ts_info);
> > > + if (ts_info.so_timestamping &
> > > + SOF_TIMESTAMPING_HARDWARE_MASK)
> > > + data->ts_layer = MAC_TIMESTAMPING;
> > > +
> > > + if (ts_info.so_timestamping &
> > > + SOF_TIMESTAMPING_SOFTWARE_MASK)
> > > + data->ts_layer = SOFTWARE_TIMESTAMPING;
> >
> > How does this work? so_timestamping is capabilities, not what's
> > enabled now. So if driver supports SW stamping we always return
> > SOFTWARE?
>
> Yes, the software timestamping comes from the MAC capabilities.
> I decided to separate software and MAC timestamping. If we select PHY
> timestamping we can't use software timestamping and for an user, selecting the
> MAC as timestamping seems not logical to use software timestamping.
>
> Indeed there is a mistake here I should have used "else if" condition.
> Mmh in fact, maybe not, because it would breaks the access to software
> timestamping until patch 13.
> I will remove the SOFTWARE/MAC timestamping distinction from this patch.

After thinking again, the "else if" condition works and won't break anything as
we could still access software timestamping within the MAC_TIMESTAMPING layer.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com