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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230119210842.5faf1e44@kernel.org>
Date:   Thu, 19 Jan 2023 21:08:42 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Rahul Rameshbabu <rrameshbabu@...dia.com>
Cc:     Jacob Keller <jacob.e.keller@...el.com>,
        Saeed Mahameed <saeed@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Saeed Mahameed <saeedm@...dia.com>, <netdev@...r.kernel.org>,
        Tariq Toukan <tariqt@...dia.com>,
        Gal Pressman <gal@...dia.com>,
        Richard Cochran <richardcochran@...il.com>,
        Vincent Cheng <vincent.cheng.xh@...esas.com>
Subject: Re: [net-next 03/15] net/mlx5: Add adjphase function to support
 hardware-only offset control

On Thu, 19 Jan 2023 20:26:04 -0800 Rahul Rameshbabu wrote:
> One of my concerns with doing this is breaking userspace expectations.
> In linuxptp, there is a configuration setting "write_phase_mode" and an
> expectation that when adjphase is called, there will not be a fallback
> to adjtime. This because adjphase is used in situations where small fine
> tuning is explicitly needed, so the errors would indicate a logical or
> situational error.

I don't mean fallback - just do what you do in mlx5 directly in 
the core. The driver already does:

if delta < MAX
	use precise method
else
	use coarse method

> Quoting Vincent Cheng, the author of the adjphase functionality in the
> ptp core stack.
> 
> -----BEGIN QUOTE-----
>   adjtime modifies HW counter with a value to move the 1 PPS abruptly to new location.
>   adjphase modifies the frequency to quickly nudge the 1 PPS to new location and also includes a HW filter to smooth out the adjustments and fine tune frequency.
> 
>   Continuous small offset adjustments using adjtime, likley see sudden shifts of the 1 PPS.  The 1 PPS probably disappears and re-appears.
>   Continuous small offset adjustments using adjphase, should see continuous 1 PPS.
> 
>   adjtime is good for large offset corrections
>   adjphase is good for small offset corrections to allow HW filter to control the frequency instead of relying on SW filter.

Hm, so are you saying that:

adjtime(delta):
	clock += delta

but:

adjfreq(delta):
	on clock tick & while delta > 0:
		clock += small_value
		delta -= small_value

because from looking at mlx5 driver code its unclear whether the
implementation does a precise but one shot adjustment or gradual
adjustments.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ