From: Richard Cochran <richardcochran@gmail.com>
To: Mahesh Bandewar <maheshb@google.com>
Cc: Netdev <netdev@vger.kernel.org>,
Linux <linux-kernel@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Arnd Bergmann <arnd@arndb.de>,
Sagi Maimon <maimon.sagi@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
John Stultz <jstultz@google.com>,
Mahesh Bandewar <mahesh@bandewar.net>
Subject: Re: [PATCHv4 net-next] ptp/ioctl: support MONOTONIC_RAW timestamps for PTP_SYS_OFFSET_EXTENDED
Date: Tue, 7 May 2024 21:44:23 -0700 [thread overview]
Message-ID: <ZjsDJ-adNCBQIbG1@hoboy.vegasvil.org> (raw)
In-Reply-To: <20240502211047.2240237-1-maheshb@google.com>
On Thu, May 02, 2024 at 02:10:47PM -0700, Mahesh Bandewar wrote:
> @@ -457,14 +459,34 @@ static inline ktime_t ptp_convert_timestamp(const ktime_t *hwtstamp,
>
> static inline void ptp_read_system_prets(struct ptp_system_timestamp *sts)
> {
> - if (sts)
> - ktime_get_real_ts64(&sts->pre_ts);
> + if (sts) {
> + switch (sts->clockid) {
> + case CLOCK_REALTIME:
> + ktime_get_real_ts64(&sts->pre_ts);
> + break;
> + case CLOCK_MONOTONIC_RAW:
> + ktime_get_raw_ts64(&sts->pre_ts);
> + break;
Why not add CLOCK_MONOTONIC as well?
That would be useful in many cases.
> +/*
> + * ptp_sys_offset_extended - data structure for IOCTL operation
> + * PTP_SYS_OFFSET_EXTENDED
> + *
> + * @n_samples: Desired number of measurements.
> + * @clockid: clockid of a clock-base used for pre/post timestamps.
> + * @rsv: Reserved for future use.
> + * @ts: Array of samples in the form [pre-TS, PHC, post-TS]. The
> + * kernel provides @n_samples.
> + *
> + * History:
> + * v1: Initial implementation.
> + *
> + * v2: Use the first word of the reserved-field for @clockid. That's
> + * backward compatible since v1 expects all three reserved words
> + * (@rsv[3]) to be 0 while the clockid (first word in v2) for
> + * CLOCK_REALTIME is '0'.
This is not really appropriate for a source code comment. The
un-merged patch series iterations are preserved at lore.kernel in case
someone needs that.
The "backward compatible" information really wants to be in the commit
message.
Thanks,
Richard
next prev parent reply other threads:[~2024-05-08 4:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-02 21:10 Mahesh Bandewar
2024-05-07 8:42 ` Paolo Abeni
2024-05-08 4:44 ` Richard Cochran [this message]
2024-05-08 7:38 ` Thomas Gleixner
2024-05-10 4:07 ` Richard Cochran
2024-05-10 7:50 ` Thomas Gleixner
2024-05-10 16:45 ` Mahesh Bandewar (महेश बंडेवार)
2024-05-11 9:59 ` Thomas Gleixner
2024-05-09 2:48 ` Mahesh Bandewar (महेश बंडेवार)
2024-05-08 7:35 ` Thomas Gleixner
2024-05-09 2:53 ` Mahesh Bandewar (महेश बंडेवार)
2024-05-10 21:27 ` Yuliang Li
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=ZjsDJ-adNCBQIbG1@hoboy.vegasvil.org \
--to=richardcochran@gmail.com \
--cc=arnd@arndb.de \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jstultz@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mahesh@bandewar.net \
--cc=maheshb@google.com \
--cc=maimon.sagi@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®