[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO1PR11MB5089BE76404AA25EE5974468D6452@CO1PR11MB5089.namprd11.prod.outlook.com>
Date: Tue, 15 Oct 2024 19:24:53 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, "Polchlopek, Mateusz"
<mateusz.polchlopek@...el.com>, "intel-wired-lan@...ts.osuosl.org"
<intel-wired-lan@...ts.osuosl.org>, "Lobakin, Aleksander"
<aleksander.lobakin@...el.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "Drewek, Wojciech"
<wojciech.drewek@...el.com>, Rahul Rameshbabu <rrameshbabu@...dia.com>, Simon
Horman <horms@...nel.org>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v11 07/14] iavf: add support
for indirect access to PHC time
> -----Original Message-----
> From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
> Sent: Tuesday, October 15, 2024 6:56 AM
> To: Polchlopek, Mateusz <mateusz.polchlopek@...el.com>; intel-wired-
> lan@...ts.osuosl.org; Lobakin, Aleksander <aleksander.lobakin@...el.com>
> Cc: netdev@...r.kernel.org; Keller, Jacob E <jacob.e.keller@...el.com>; Drewek,
> Wojciech <wojciech.drewek@...el.com>; Rahul Rameshbabu
> <rrameshbabu@...dia.com>; Simon Horman <horms@...nel.org>
> Subject: Re: [Intel-wired-lan] [PATCH iwl-next v11 07/14] iavf: add support for
> indirect access to PHC time
>
> On 13/10/2024 16:44, Mateusz Polchlopek wrote:
> > From: Jacob Keller <jacob.e.keller@...el.com>
> > +static int iavf_read_phc_indirect(struct iavf_adapter *adapter,
> > + struct timespec64 *ts,
> > + struct ptp_system_timestamp *sts)
> > +{
> > + long ret;
> > + int err;
> > +
> > + adapter->ptp.phc_time_ready = false;
> > + ptp_read_system_prets(sts);
> > +
> > + err = iavf_send_phc_read(adapter);
> > + if (err)
> > + return err;
> > +
> > + ret = wait_event_interruptible_timeout(adapter-
> >ptp.phc_time_waitqueue,
> > + adapter->ptp.phc_time_ready,
> > + HZ);
> > + if (ret < 0)
> > + return ret;
> > + else if (!ret)
> > + return -EBUSY;
> > +
> > + *ts = ns_to_timespec64(adapter->ptp.cached_phc_time);
> > +
> > + ptp_read_system_postts(sts);
>
> Usually prets()/postts() pair covers actual transaction time. That means
> the last error check and ns_to_timespec64() are usually no covered.
>
> Not sure though how precise it can be because of several queues used in
> the process..
>
In the case where we only have indirect access to the registers, this is never going to be precise. We could strictly move this to just after the wait interruptible, but in practice I'm not sure that will matter much.
On newer hardware, the VF has direct access to the timer and can read it without needing to contact the PF.
The intent of the indirect access is to enable timestamp extension to convert 40bit timestamps to their 64bit width. For that purpose, the less precise indirect reading is not a hard requirement as the time value captured only has to be within ~2 seconds of the timestamp being extended.
Thanks,
Jake
Powered by blists - more mailing lists