On Mon, Jan 09, 2023 at 04:09:29PM +0000, Vincent Cheng wrote:
> 
> 
> -----Original Message-----
> From: Rahul Rameshbabu via Linuxptp-devel 
> <linuxptp-devel@lists.sourceforge.net> 
> Sent: Tuesday, December 20, 2022 4:37 PM
> To: linuxptp-devel@lists.sourceforge.net
> Cc: Gal Pressman <g...@nvidia.com>; Saeed Mahameed <sae...@nvidia.com>; Tariq 
> Toukan <tar...@nvidia.com>
> Subject: [Linuxptp-devel] [PATCH 1/2] Improve efficiency of nullf servo 
> synchronization
> 
> The nullf servo can now enter the SERVO_LOCKED_STABLE state by transitioning 
> first to the SERVO_LOCKED state when the offset is less than the set value 
> for offset_threshold. If offset_threshold is not set, the SERVO_LOCKED state 
> can be entered when the offset is less than or equal to the set value for 
> step_threshold.
> 
> Signed-off-by: Rahul Rameshbabu <rrameshb...@nvidia.com>

Acked-by: Vincent Cheng <vsch...@gmail.com>

> ---
>  nullf.c   |  9 ++++++---
>  phc2sys.8 | 12 ++++++------
>  ptp4l.8   | 14 +++++++-------
>  ts2phc.8  |  8 ++++----
>  4 files changed, 23 insertions(+), 20 deletions(-)
> 
> diff --git a/nullf.c b/nullf.c
> index 9a40d07..8228636 100644
> --- a/nullf.c
> +++ b/nullf.c
> @@ -38,14 +38,17 @@ static double nullf_sample(struct servo *servo, int64_t 
> offset,
>                          uint64_t local_ts, double weight,
>                          enum servo_state *state)
>  {
> -     if (!offset) {
> +     long long int abs_offset = llabs(offset);
> +
> +     if ((servo->offset_threshold && abs_offset < servo->offset_threshold) ||
> +         (servo->step_threshold && servo->step_threshold >= abs_offset)) {
>               *state = SERVO_LOCKED;
>               return 0.0;
>       }
>  
>       if ((servo->first_update && servo->first_step_threshold &&
> -          servo->first_step_threshold < llabs(offset)) ||
> -         (servo->step_threshold && servo->step_threshold < llabs(offset))) {
> +          servo->first_step_threshold < abs_offset) ||
> +         (servo->step_threshold && servo->step_threshold < abs_offset)) {
>               *state = SERVO_JUMP;
>       } else {
>               *state = SERVO_UNLOCKED;

Thanks,
Vincent


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

Reply via email to