- 15 Sep, 2013 17 commits
-
-
Alessandro Rubini authored
The "Use the average between current value and previous one" in the "one way delay" calculation was actually a running-average of two samples. This happened before the real (and properly implemented) running average of the value. By removing the first one we better respect the configured width of the filter. As a side effect the default (64 samples) is now effective, while earlier it behaved like a 128-sample running average. It converges faster. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The "offset from master" filter was "a simple two-sample average" as documented in the header, and the result of such average is used only in the PI controller. Thus, by averaging we have no effect at all in the I component and only a spread over two samples of the P component for each sample. In practice, it has no effect at all. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This trivial change makes the code more readable, and more symmetric in the two filtering sections. Unrelated, it also moves a temporary variable to the only block where it is used. Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This rename is for consistency: the filter is called owd_fltr but the data it acts upon were called a meaningless "mean path delay". Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
-
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 7 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>
-