[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <15b93453c79467ce3b46085019afe2a83d09f247.camel@redhat.com>
Date: Fri, 26 Apr 2024 11:21:10 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Mahesh Bandewar <maheshb@...gle.com>, Netdev <netdev@...r.kernel.org>,
Linux <linux-kernel@...r.kernel.org>, David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>, Richard Cochran
<richardcochran@...il.com>, Arnd Bergmann <arnd@...db.de>, Sagi Maimon
<maimon.sagi@...il.com>
Cc: Jonathan Corbet <corbet@....net>, John Stultz <jstultz@...gle.com>,
Mahesh Bandewar <mahesh@...dewar.net>
Subject: Re: [PATCHv3 next] ptp/ioctl: support MONOTONIC_RAW timestamps for
PTP_SYS_OFFSET_EXTENDED
On Mon, 2024-04-22 at 15:07 -0700, Mahesh Bandewar wrote:
> diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
> index 053b40d642de..02684d7e00e6 100644
> --- a/include/uapi/linux/ptp_clock.h
> +++ b/include/uapi/linux/ptp_clock.h
> @@ -155,13 +155,27 @@ struct ptp_sys_offset {
> struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
> };
>
> +/*
> + * 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
> + * backword compatible since v1 expects @rsv[3] to be 0 while the
Minor nit ^^^ 'backward'
> + * clockid for CLOCK_REALTIME is '0'.
> + */
> struct ptp_sys_offset_extended {
> - unsigned int n_samples; /* Desired number of measurements. */
> - unsigned int rsv[3]; /* Reserved for future use. */
> - /*
> - * Array of [system, phc, system] time stamps. The kernel will provide
> - * 3*n_samples time stamps.
> - */
> + unsigned int n_samples;
> + __kernel_clockid_t clockid;
> + unsigned int rsv[2];
AFAICS, here you are using the 'old' rsv[0] as 'clockid'
Please either always use rsv[0] instead of rsv[2] or re-order the
fields.
Thanks,
Paolo
Powered by blists - more mailing lists