On Thu, Feb 20, 2014 at 05:58:33PM +0100, [email protected] wrote:
> From: Delio Brignoli <[email protected]>
> 
> When peer delay is < min_neighbor_prop_delay the port is flagged
> as non 802.1AS capable. min_neighbor_prop_delay defaults to INT_MIN.
> 
> Signed-off-by: Delio Brignoli <[email protected]>
> ---
>  config.c |    6 ++++++
>  ds.h     |    1 +
>  port.c   |   11 +++++++++++
>  ptp4l.8  |    4 ++++
>  ptp4l.c  |    2 ++
>  5 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/config.c b/config.c
> index cfe36b8..1ff3afe 100644
> --- a/config.c
> +++ b/config.c
> @@ -125,6 +125,12 @@ static enum parser_result parse_pod_setting(const char 
> *option,
>                       return r;
>               pod->neighborPropDelayThresh = uval;
>  
> +     } else if (!strcmp(option, "min_neighbor_prop_delay")) {
> +             r = get_ranged_int(value, &val, INT32_MIN, INT32_MAX);

We need to ensure that

        min_neighbor_prop_delay < neighborPropDelayThresh

Maybe the range of min_neighbor_prop_delay should be limited to
(INT32_MIN, 0) or (INT32_MIN, -1).

> +             if (r != PARSED_OK)
> +                     return r;
> +             pod->min_neighbor_prop_delay = val;
> +
>       } else if (!strcmp(option, "fault_badpeernet_interval")) {
>               pod->flt_interval_pertype[FT_BAD_PEER_NETWORK].type = 
> FTMO_LINEAR_SECONDS;
>               if (!strcasecmp("ASAP", value)) {
> diff --git a/ds.h b/ds.h
> index 2ecda8d..9c12b41 100644
> --- a/ds.h
> +++ b/ds.h
> @@ -136,6 +136,7 @@ struct port_defaults {
>       int freq_est_interval; /*log seconds*/
>       struct fault_interval flt_interval_pertype[FT_CNT];
>       UInteger32 neighborPropDelayThresh; /*nanoseconds*/
> +     Integer32 min_neighbor_prop_delay; /*nanoseconds*/

I would prefer plain old 'int' here.

Thanks,
Richard

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to