Re: [Linuxptp-devel] [PATCHv2 1/6] Convert and correct time stamps early.

2015-03-25 Thread Richard Cochran
On Tue, Mar 17, 2015 at 11:28:20AM +0100, Miroslav Lichvar wrote: @@ -1623,6 +1627,7 @@ static void process_delay_resp(struct port *p, struct ptp_message *m) struct delay_req_msg *req; struct delay_resp_msg *rsp = m-delay_resp; struct PortIdentity master; + tmv_t c3,

Re: [Linuxptp-devel] [PATCHv2 2/6] Refactor time stamp processing.

2015-03-25 Thread Richard Cochran
Few gripes, and a question... On Tue, Mar 17, 2015 at 11:28:21AM +0100, Miroslav Lichvar wrote: +struct tsproc { + /* Current ratio between remote and local clock frequency */ + double clock_rate_ratio; + + /* Latest down measurement */ + tmv_t t1, t2; + /* Latest up

Re: [Linuxptp-devel] [PATCHv2 1/6] Convert and correct time stamps early.

2015-03-25 Thread Richard Cochran
On Wed, Mar 25, 2015 at 09:23:26AM +0100, Richard Cochran wrote: Gripe: t4c doesn't deserve to be a separate own variable. Just having t4 = tmv_sub(t4, c3) is clear enough. Same goes for 't1c' in port_synchronize(). Thanks, Richard

Re: [Linuxptp-devel] [PATCHv2 2/6] Refactor time stamp processing.

2015-03-25 Thread Richard Cochran
On Wed, Mar 25, 2015 at 09:55:49AM +0100, Richard Cochran wrote: +int tsproc_update_delay(struct tsproc *tsp, tmv_t *delay) +{ + tmv_t raw_delay; + + if (!tsp-t1 || !tsp-t2 || !tsp-t3 || !tsp-t4) + return -1; Use tmv_zero() here ... Rather, tmv_is_zero(). Thanks,

Re: [Linuxptp-devel] [PATCHv2 1/6] Convert and correct time stamps early.

2015-03-25 Thread Richard Cochran
On Wed, Mar 25, 2015 at 12:44:44PM +0100, Miroslav Lichvar wrote: I thought separate variables for corrected timestamps would be less confusing for someone reading the PTP spec where the corrections are applied later in the delay calculation. On second thought, there is one such usage (in

Re: [Linuxptp-devel] [PATCHv2 1/6] Convert and correct time stamps early.

2015-03-25 Thread Miroslav Lichvar
On Wed, Mar 25, 2015 at 09:27:24AM +0100, Richard Cochran wrote: On Wed, Mar 25, 2015 at 09:23:26AM +0100, Richard Cochran wrote: Gripe: t4c doesn't deserve to be a separate own variable. Just having t4 = tmv_sub(t4, c3) is clear enough. Same goes for 't1c' in port_synchronize(). Ok.