mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Mahesh Bandewar <maheshb@google.com>,
	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>,
	Thomas Gleixner <tglx@linutronix.de>,
	Richard Cochran <richardcochran@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Sagi Maimon <maimon.sagi@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	John Stultz <jstultz@google.com>,
	 Mahesh Bandewar <mahesh@bandewar.net>
Subject: Re: [PATCHv3 next] ptp/ioctl: support MONOTONIC_RAW timestamps for PTP_SYS_OFFSET_EXTENDED
Date: Fri, 26 Apr 2024 11:21:10 +0200	[thread overview]
Message-ID: <15b93453c79467ce3b46085019afe2a83d09f247.camel@redhat.com> (raw)
In-Reply-To: <20240422220707.162146-1-maheshb@google.com>

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


      reply	other threads:[~2024-04-26  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 22:07 Mahesh Bandewar
2024-04-26  9:21 ` Paolo Abeni [this message]

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=15b93453c79467ce3b46085019afe2a83d09f247.camel@redhat.com \
    --to=pabeni@redhat.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=richardcochran@gmail.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®