* Re: ptp [not found] <d1b2b740-8cc6-bf4a-722b-7b323fb0c7c0@cisco.com> @ 2016-09-07 20:48 ` Richard Cochran 2016-09-07 20:55 ` ptp Daniel Walker 0 siblings, 1 reply; 3+ messages in thread From: Richard Cochran @ 2016-09-07 20:48 UTC (permalink / raw) To: Daniel Walker Cc: netdev@vger.kernel.org, xe-kernel@external.cisco.com, Shabeena Shabeena -X (sshabeen - ARICENT TECHNOLOGIES MAURIITIUS LIMITED at Cisco) 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ptp 2016-09-07 20:48 ` ptp Richard Cochran @ 2016-09-07 20:55 ` Daniel Walker 2016-09-07 21:12 ` ptp Richard Cochran 0 siblings, 1 reply; 3+ messages in thread From: Daniel Walker @ 2016-09-07 20:55 UTC (permalink / raw) To: Richard Cochran Cc: netdev@vger.kernel.org, xe-kernel@external.cisco.com, Shabeena Shabeena -X (sshabeen - ARICENT TECHNOLOGIES MAURIITIUS LIMITED at Cisco) On 09/07/2016 01:48 PM, Richard Cochran wrote: > 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 So the code only allows second granularity negative updates, or the seconds component is the only part which needs to actually be negative ? Daniel ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ptp 2016-09-07 20:55 ` ptp Daniel Walker @ 2016-09-07 21:12 ` Richard Cochran 0 siblings, 0 replies; 3+ messages in thread From: Richard Cochran @ 2016-09-07 21:12 UTC (permalink / raw) To: Daniel Walker Cc: netdev@vger.kernel.org, xe-kernel@external.cisco.com, Shabeena Shabeena -X (sshabeen - ARICENT TECHNOLOGIES MAURIITIUS LIMITED at Cisco) 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-07 21:12 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <d1b2b740-8cc6-bf4a-722b-7b323fb0c7c0@cisco.com> 2016-09-07 20:48 ` ptp Richard Cochran 2016-09-07 20:55 ` ptp Daniel Walker 2016-09-07 21:12 ` ptp Richard Cochran
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).