The freq_est_interval value is documented as the time interval over which
to estimate the ratio between the local and peer clock frequencies when
operating in free_running mode.

It is documented as a power of two in seconds, similar to the
summary_interval and the various intervals between packets.

The configuration forces this value to be positive, meaning that fractional
estimation intervals are not supported.A This appears to have been the case
since commit 0513c3b15b8a ("config: Apply more strict input validation to
almost all config file options").

Because of this, when operating in free_running mode it is not possible to
get an output of the estimated ratio faster than once a second, even if
your configuration has a sync rate that is higher.

The commit which enforced this positive boundary did not provide any
justification for why the freq_est_interval cannot be negative. Fix the
specification in the configuration table to correctly allow such intervals.

Fixes: 0513c3b15b8a ("config: Apply more strict input validation to almost all 
config file options")
Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com>
---
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config.c b/config.c
index e454c91ff0a1..67bf6a40d5c9 100644
--- a/config.c
+++ b/config.c
@@ -254,7 +254,7 @@ struct config_item config_tab[] = {
        GLOB_ITEM_DBL("first_step_threshold", 0.00002, 0.0, DBL_MAX),
        PORT_ITEM_INT("follow_up_info", 0, 0, 1),
        GLOB_ITEM_INT("free_running", 0, 0, 1),
-       PORT_ITEM_INT("freq_est_interval", 1, 0, INT_MAX),
+       PORT_ITEM_INT("freq_est_interval", 1, INT_MIN, INT_MAX),
        GLOB_ITEM_INT("G.8275.defaultDS.localPriority", 128, 1, UINT8_MAX),
        PORT_ITEM_INT("G.8275.portDS.localPriority", 128, 1, UINT8_MAX),
        GLOB_ITEM_INT("gmCapable", 1, 0, 1),
-- 
2.38.0.83.gd420dda05763



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to