Subject: Re: [PATCH net-next v2 1/8] net-timestamp: explicit SO_TIMESTAMPING ancillary data struct

From: Chad Reese <[email-masked]>
Date: Mon, 07 Jul 2014 14:03:38 -0700

On 07/07/2014 01:11 PM, Richard Cochran wrote:
> On Mon, Jul 07, 2014 at 12:44:44PM -0700, Chad Reese wrote:
>>
>> A hardware timer used for ethernet timestamps is completely
>> independent from the kernel's software view of time. Since the
>> hardware timestamps are only exposed in the driver, how can they be
>> correlated with system time? If the driver doesn't do it, then
>> nobody else knows how.
>
> Um, implement a PTP Hardware Clock device?

Octeon does support using the 1588 clock as the kernel's clock source. 
Unfortunately most people don't seem to want to use it. I have no idea why.

> Don't reimplement clock servos in your driver. Instead, leave that to
> the PTP stack (like using linuxptp's phc2sys).

I obviously did it wrong. The one line comment in 
Documentation/networking/timestamping.txt was not enough for me to 
figure out the proper usage of syststamp.

>> For Octeon, you can optionally use the hardware timestamp as the
>> system clock reference. Most people don't, but it is the only way to
>> get the system time to be accurate. 1588 can synchronize two Octeon
>> boards to less than 1ns for the hardware timer. The Linux software
>> timers is always farther off.
>
> 1588 cannot synchronize boards unless you expose the clock to the
> userland PTP stack. Why don't you do that?

I was trying to stick with standard linux userspace APIs. People have no 
interest in the PTP clock at all. All they want is for the standard 
system time to be correct.

Chad

-- 

Chad Reese <[email-masked]>
Cavium Networks
Phone: 408 - 943 - 7183
Cell: 321 - 438 - 7753