Re: [chrony-dev] [PATCH] enable stratum setting for refclocks

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Thu, Oct 05, 2017 at 02:12:49PM +0200, Andreas Steinmetz wrote:
> The attached patch allows the setting of the stratum for refclocks.
> This is missing as e.g. a PHC refclock may not be stratum 0 (actual
> timesource -> qemu host -> guest with chronyd using PHC).
> 
> Example configuration with patch applied:
> 
> refclock PHC /dev/ptp0 poll 3 dpoll -2 offset 0 stratum 2

Ok, this sounds good.

> @@ -756,6 +757,10 @@
>      } else if (!strcasecmp(cmd, "maxlockage")) {
>        if (sscanf(line, "%d%n", &max_lock_age, &n) != 1)
>          break;
> +    } else if (!strcasecmp(cmd, "stratum")) {
> +      if (sscanf(line, "%d%n", &stratum, &n) != 1 ||
> +          stratum >= NTP_MAX_STRATUM || stratum < 0)
> +        break;

Please keep the options in alphabetical order if possible.

> --- chrony-3.2.orig/sources.h	2017-09-15 08:32:09.000000000 +0200
> +++ chrony-3.2/sources.h	2017-09-20 18:40:56.873225170 +0200
> @@ -60,7 +60,7 @@
>     the individual source-type instance creation routines. */
>  
>  extern SRC_Instance SRC_CreateNewInstance(uint32_t ref_id, SRC_Type type, int sel_options,
> -                                          IPAddr *addr, int min_samples, int max_samples,
> +                                          IPAddr *addr, int min_samples, int max_samples, int stratum,
>                                            double min_delay, double asymmetry);

Does this really need a new SRC parameter? I'd prefer if this was an
option specific to refclocks and it just changed the stratum that is
passed with the refclock sample.

Also, please document the option in the chrony.conf man page.

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/