From: Carolina Jubran <cjubran@nvidia.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Gal Pressman <gal@nvidia.com>, Tariq Toukan <tariqt@nvidia.com>,
Bar Shapira <bshapira@nvidia.com>,
Maciek Machnikowski <maciejm@nvidia.com>,
Wojtek Wasko <wwasko@nvidia.com>,
Vinicius Costa Gomes <vinicius.gomes@intel.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Mahesh Bandewar <maheshb@google.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] ptp: extend offset ioctls to expose raw free-running cycles
Date: Thu, 12 Jun 2025 12:15:35 +0300 [thread overview]
Message-ID: <60e0e9f8-36e6-4605-a5a6-a8e6fb2e8cfb@nvidia.com> (raw)
In-Reply-To: <aEj4Fp05_lTdMgu3@hoboy.vegasvil.org>
On 11/06/2025 6:29, Richard Cochran wrote:
> On Tue, Jun 10, 2025 at 08:19:05PM +0300, Carolina Jubran wrote:
>
>> @@ -398,8 +423,14 @@ long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
>> break;
>> }
>> sts.clockid = extoff->clockid;
>> + cycles = !!(extoff->rsv[0] & PTP_OFFSET_CYCLES);
>> for (i = 0; i < extoff->n_samples; i++) {
>> - err = ptp->info->gettimex64(ptp->info, &ts, &sts);
>> + if (cycles)
>> + err = ptp->info->getcyclesx64(ptp->info, &ts,
>> + &sts);
>> + else
>> + err = ptp->info->gettimex64(ptp->info, &ts,
>> + &sts);
>
> ugh...
>
>> @@ -86,9 +111,15 @@
>> *
>> */
>> struct ptp_clock_time {
>> - __s64 sec; /* seconds */
>> - __u32 nsec; /* nanoseconds */
>> - __u32 reserved;
>> + union {
>> + struct {
>> + __s64 sec; /* seconds */
>> + __u32 nsec; /* nanoseconds */
>> + __u32 reserved;
>> + };
>> + __u64 cycles;
>> + };
>> +
>> };
>
> This overloading of an ioctl with even more flags goes too far.
> Why not just add a new ioctl in a clean way?
>
> Thanks,
> Richard
Hi Richard,
Thanks for the feedback. I will add new ioctls and resend.
Carolina
prev parent reply other threads:[~2025-06-12 9:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 17:19 Carolina Jubran
2025-06-11 3:29 ` Richard Cochran
2025-06-12 9:15 ` Carolina Jubran [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=60e0e9f8-36e6-4605-a5a6-a8e6fb2e8cfb@nvidia.com \
--to=cjubran@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=bshapira@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciejm@nvidia.com \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=tariqt@nvidia.com \
--cc=vadim.fedorenko@linux.dev \
--cc=vinicius.gomes@intel.com \
--cc=wwasko@nvidia.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
all inboxes | Powered by JetHome®