From 1bb8ebbdc5e8a9ee24e956ae86209fa3189f144d Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Fri, 31 Aug 2012 14:58:24 +0200 Subject: [PATCH] Invert the frequency ratio estimation. In 802.1AS-2011 the ratio is defined as master/local, so we should follow suit. Signed-off-by: Richard Cochran --- clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 7cb3693..fc8e472 100644 --- a/clock.c +++ b/clock.c @@ -198,8 +198,8 @@ static enum servo_state clock_no_adjust(struct clock *c) */ origin2 = tmv_add(c->t1, tmv_add(c->c1, c->c2)); if (f->ingress1) { - ratio = tmv_dbl(tmv_sub(c->t2, f->ingress1)) / - tmv_dbl(tmv_sub(origin2, f->origin1)); + ratio = tmv_dbl(tmv_sub(origin2, f->origin1)) / + tmv_dbl(tmv_sub(c->t2, f->ingress1)); pr_info("master offset %10lld s%d ratio %.9f path delay %10lld", c->master_offset, state, ratio, c->path_delay); }