- 15 Sep, 2013 12 commits
-
-
Alessandro Rubini authored
This reports more information about the servo, to help me trace some misbehaviour. At level 2 it also reports T1..T4 and at level 3 it reports the correction fields (currently always 0 in my setup). The big hunk in this diff is just a reindentation to remove a goto introduced a few commits ago; it is now an else stanza. Try "git show -pw" if in doubt. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The code was using "mean path delay" before calculating it. Which means that is used wrong values (likely 0) the first time and the previous value at each successive iteration. This commit moves calculation of "mpd" before code that uses it. The calculation itself is not changed. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This moves the first check for "max_delay" into the calculation function. As a side effect we got rid of the field "t1_t2_valid" in the servo structure. While nothing is changed in the calculations (and I see the same (mis)behaviour in my network) we now have a sane servo.c, where pp_servo_got_sync only takes care of the correction factor for the sync/follow-up message and then everything is done in pp_servo_got_resp. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This simplifies slightly the code. and has no technical effects. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
When we only have t1/t2 we can't do all the corrections, as we miss t3/t4. This moves all the calculations from the first servo entry point (sync/follow-up) to the second one (delay-response). Diagnostic prints are moved at the end as well. Nothing else is changed by this commit: the code is just moved. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
"delay_ms" and "m_to_s_delay" were duplicates. This removes one of them (and the same for s_to_m) and a long-standing "TODO check". The original code was unclear about correction factor, that sometimes was removed and sometimes not. Since the value is an overhead figure added by any transparent clocks in the path, this commit counts it immediately, to forget about it as soon as possible. This also makes the code more symmetric (t1,t2 code is similar to t3,t4 code). Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This renames "ofst_first_updated" (wrongly a runtime option) into "t1_t2_valid" as a servo field. This makes thing more readable and is a fix in that it allows more than one servo to coexist in the future. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This commit is another step in simplifying the servo. It makes the following changes: - format_TimeInternal is just moved (no effect) - pp_update_offset() and __pp_update_clock() are squashed together. They were called in sequence anyways, as two halves of a single thing. This changes the error return paths, because the whole procedure is aborted in case of error. I've never seen such errors, but I think if something is "aborted" it should not proceed. One non-error return from the first half is turned into a goto, to avoid changing indentation (that appears in the commit diff). - the meaning of "ofst_first_updated" is slightly changed. If we get an error in the sync phase the bit is cleared so delay-resp won't use the tuple. The field is then renamed in the next commit. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The servo implementation we brought forward from ptpd was strange and difficult to understand. This commit is the first step in trying to make some order, but it doesn't actually change anything but names. The entry points for the servo are now called pp_servo_init(), pp_servo_got_sync() and pp_servo_got_resp(). A two-step protocol calls got_sync after getting the follow-up message. Also, the hook for response messages is called handle_resp with a name similar to the hooks for sync and follow-up. The servo itself is not changed, but I reordered the functions so the calculations appear in the real order in which they happen. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 11 Sep, 2013 6 commits
-
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Servo logs show strings like "0.-00071881". We already had an unused display_TimeInternal, which is correct. This turns it into an sprintf and uses it as a static function in servo.c (only printer of TimeInternals, it seems). Meanwhile, this also removes the last pp_Vprintf. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 09 Sep, 2013 4 commits
-
-
Aurelio Colosimo authored
In case a port is inactive, its fd is not valid, so do not handle it in select. Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
frgn_rec_best field of pp_instance structure was not correctly initialized. This patch also rewrites a the ports 'for loop' so that it is more readable. Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Check whether pp_instance port link is up or down. Force a new initialization in case link brings up. Do not call state machine for pp_instances whose link is down. This patch is inspired to how ptp-noposix (commit 2e46712e59) handles link status. Still missing (and thus declared with a FIXME) the reset of slave structures. On the single link, this lack does not cause issues. Anyway, must be fixed Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
- 04 Sep, 2013 4 commits
-
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
invalidate fd value for ethernet_mode and check it again in case unix_net_exit is called twice (though should not happen). Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
unix_net_init must be able to be called more than once, thus calls unix_net_exit internally. Since unix_net_exit sets NP(ppi)->ch[0].fd to -1, it must not be called once again when its value is negative. Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
- 31 Jul, 2013 1 commit
-
-
Alessandro Rubini authored
This changes all "Name Surname for CERN" to "Copyright CERN, author Name Surname". This is trivial and makes no change, with a few expections: - all trivial Makefiles that had "for CERN" lines have now no attributions, as they are trivial anyways. - a few unrepresented files have not the copyright notice (especially ptpdump, that I wrote in 2012). - a few "for CERN" remain in subprojects, where I didn't touch anyrhing Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
- 30 Jul, 2013 1 commit
-
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
- 26 Jul, 2013 11 commits
-
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
correction field is not printed as hex value, so do not prepend it with 0x. Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
The previous implementation of wrs_time_ops was a bare call of unix_time_ops, but this was not correct since wrs must handle time on fpga, not the system time. wrs_calc_timeout is still using unix_time_ops, since it just needs a monotonic timestamping, without requiring the best precision. Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
The select must be always called with the least required timeout. This patch fixes a bug which caused an undesired delay when a state machine, after receiving a packet, needed to be called soon (e.g. when it has just changed its status: its desired delay is 0). Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
Aurelio Colosimo authored
The coding for wr timestamping functions has been mostly copied from ptp-noposix project: file libptpnetif/ptpd_netif.c, commit 2e46712e. Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-
- 25 Jul, 2013 1 commit
-
-
Aurelio Colosimo authored
Signed-off-by: Aurelio Colosimo <aurelio@aureliocolosimo.it>
-