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]
Date:   Thu, 6 Jun 2019 20:37:59 +0000
From:   "Keller, Jacob E" <jacob.e.keller@...el.com>
To:     Richard Cochran <richardcochran@...il.com>,
        "Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "nhorman@...hat.com" <nhorman@...hat.com>,
        "sassmann@...hat.com" <sassmann@...hat.com>,
        "Bowers, AndrewX" <andrewx.bowers@...el.com>
Subject: RE: [net-next 06/15] ixgbe: fix PTP SDP pin setup on X540 hardware

> -----Original Message-----
> From: netdev-owner@...r.kernel.org [mailto:netdev-owner@...r.kernel.org] On
> Behalf Of Richard Cochran
> Sent: Wednesday, June 05, 2019 8:21 PM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@...el.com>
> Cc: davem@...emloft.net; Keller, Jacob E <jacob.e.keller@...el.com>;
> netdev@...r.kernel.org; nhorman@...hat.com; sassmann@...hat.com; Bowers,
> AndrewX <andrewx.bowers@...el.com>
> Subject: Re: [net-next 06/15] ixgbe: fix PTP SDP pin setup on X540 hardware
> 
> On Wed, Jun 05, 2019 at 01:23:49PM -0700, Jeff Kirsher wrote:
> > + * It calculates when the system time will be on an exact second, and then
> > + * aligns the start of the PPS signal to that value.
> > + *
> > + * This works by using the cycle counter shift and mult values in reverse, and
> > + * assumes that the values we're shifting will not overflow.
> 
> So I guess that this device can't adjust the frequency in hardware,
> and that is why the driver uses a timecounter.
> 

No. We use the timecounter to track the time offset, not the frequency. That is, our hardware can't represent 64bits of time, but it can adjust frequency. The time counter is used to track the adjustments from adjtime and set time, but not adjfreq.

The timecounter is used to provide two features: (a) storing a full 64bits of time for passing back to the PTP stack and (b) atomic adjustments in adjtime. When programming the SDP we need to reverse the calculations done so that they're in terms of the SYSTIME values. But the frequency changes are all done directly to the SYSTIME increment values, and should be reflected properly in the pin output.

> BUT your PPS will not be correct.  You use the 'mult' to calculate the
> future counter time of the PPS, but as soon as the PTP stack adjusts
> the frequency (and changes 'mult') the PPS will occur at the wrong
> time.

Every path which changes mult (which is only link speed changes as far as I remember offhand) re-programs the PPS. We also re-program the pin at adjtime and settime.

There should be no caller outside of our driver who adjusts the multiplier.

Thanks,
Jake

> 
> Sorry to say it,
> Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ