Re: ptp

3 messages, 2 authors, 2016-09-07 · open the first message on its own page

Re: ptp

From: Richard Cochran <richardcochran@gmail.com>
Date: 2016-09-07 20:48:24

On Wed, Sep 07, 2016 at 01:40:59PM -0700, Daniel Walker wrote:
There is a test (below) , which prevents negative nanosecond updates. The
code below would force a negative update to always return more than
NSEC_PER_SEC. It should be using abs() instead which would return the value
desired.
No.  This:

	/*
	 * The value of a timeval is the sum of its fields, but the
	 * field tv_usec must always be non-negative.
	 */

HTH,
Richard

Re: ptp

From: Daniel Walker <hidden>
Date: 2016-09-07 21:04:46

On 09/07/2016 01:48 PM, Richard Cochran wrote:
On Wed, Sep 07, 2016 at 01:40:59PM -0700, Daniel Walker wrote:
quoted
There is a test (below) , which prevents negative nanosecond updates. The
code below would force a negative update to always return more than
NSEC_PER_SEC. It should be using abs() instead which would return the value
desired.
No.  This:

	/*
	 * The value of a timeval is the sum of its fields, but the
	 * field tv_usec must always be non-negative.
	 */

HTH,
Richard

So the code only allows second granularity negative updates, or the seconds component is the only part which needs to actually be negative ?


Daniel

Re: ptp

From: Richard Cochran <richardcochran@gmail.com>
Date: 2016-09-07 21:12:29

On Wed, Sep 07, 2016 at 01:55:19PM -0700, Daniel Walker wrote:
So the code only allows second granularity negative updates,
No.
or the seconds
component is the only part which needs to actually be negative ?
Yes.

See the function, clockadj_step, in linuxptp/clockadj.c for a working
user space example.

Thanks,
Richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help