From: Jacob Keller <jacob.e.keller@intel.com>
To: Karol Kolacinski <karol.kolacinski@intel.com>,
<intel-wired-lan@lists.osuosl.org>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>,
anthony.l.nguyen@intel.com, jesse.brandeburg@intel.com
Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ice: remove unnecessary discarding of timestamps
Date: Fri, 27 Oct 2023 13:58:12 -0700 [thread overview]
Message-ID: <335ef88e-3678-480c-846c-4287cb030d76@intel.com> (raw)
In-Reply-To: <20231026105955.282546-1-karol.kolacinski@intel.com>
On 10/26/2023 3:59 AM, Karol Kolacinski wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>
>
> The ice driver currently discards any outstanding timestamps that are
> happening very near to a .adjtime or .settime callback. This was
> originally added by commit b1a582e64bf2 ("ice: introduce
> ice_ptp_reset_cached_phctime function") and later extended by commit
> d40fd6009332 ("ice: handle flushing stale Tx timestamps in
> ice_ptp_tx_tstamp").
>
> The original motivation for discarding timestamps was that extending an
> old timestamp using the new cached value of PHC was a problem, as it
> could produce incorrect results. The change did not describe what such
> "incorrect results" were.
>
> There are no such incorrect results. Extending the 32 bit timestamp with
> the new time value just means that the timestamp is reported in terms of
> the newly updated and adjusted system clock. This won't produce
> incorrect results or problematic timestamps to applications. Either the
> timestamp will be extended with the value of the PHC just prior to the
> time adjustment (if the timestamp completes prior to the adjust
> callback), or it will be extended using the new PHC value after the
> adjustment. In either case, the resulting extended timestamp value makes
> sense.
>
> The timestamp extension logic is very similar to the logic found in
> timecounter_cyc2time, the primary difference being that the ice hardware
> maintains the full 64 bits of nanoseconds in the MAC rather than being
> maintained purely by software as in the timecounter case.
>
> Indeed, I couldn't find an example of a driver using
> timecounter_cyc2time which does discard timestamps that occur nearby
> a time adjustment. The ice driver behavior of discarding such timestamps
> just results in failure to deliver a Tx timestamp to userspace,
> resulting in applications such as ptp4l to timeout and enter a fault
> state. Reporting the extended timestamp based on the updated PHC value
> isn't producing "garbage" results, and doesn't lead to incorrect
> behavior.
>
> Remove the unnecessary stale timestamp logic.
>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
Karol,
I have some other work related to this that I'd like to send together,
so I am planning to re-spin this so that it passes compilation and
include it in a series I'm working on now.
Thanks,
Jake
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-10-27 20:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 10:59 [Intel-wired-lan] [PATCH iwl-next] ice: remove unnecessary discarding of timestamps Karol Kolacinski
2023-10-27 18:19 ` Jacob Keller
2023-10-27 18:20 ` Jacob Keller
2023-10-27 20:58 ` Jacob Keller [this message]
2023-10-30 16:23 ` kernel test robot
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=335ef88e-3678-480c-846c-4287cb030d76@intel.com \
--to=jacob.e.keller@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=karol.kolacinski@intel.com \
--cc=przemyslaw.kitszel@intel.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