lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60e0e9f8-36e6-4605-a5a6-a8e6fb2e8cfb@nvidia.com>
Date: Thu, 12 Jun 2025 12:15:35 +0300
From: Carolina Jubran <cjubran@...dia.com>
To: Richard Cochran <richardcochran@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Gal Pressman <gal@...dia.com>, Tariq Toukan <tariqt@...dia.com>,
 Bar Shapira <bshapira@...dia.com>, Maciek Machnikowski <maciejm@...dia.com>,
 Wojtek Wasko <wwasko@...dia.com>,
 Vinicius Costa Gomes <vinicius.gomes@...el.com>,
 Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
 Mahesh Bandewar <maheshb@...gle.com>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] ptp: extend offset ioctls to expose raw free-running
 cycles



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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ