From: Wang Xiao W Date: Thu, 10 Sep 2015 04:38:22 +0000 (+0800) Subject: fm10k/base: fix ieee1588 adjustment direction X-Git-Tag: spdx-start~8398 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b56d0781aae1e7246561b258beb4276b47cd36fc;p=dpdk.git fm10k/base: fix ieee1588 adjustment direction The SYSTIME_CFG.Adjust field has a Direction bit to indicate whether the adjustment is positive or negative. However, we incorrectly read the documentation and the direction bit should be set 1 when positive, not when negative. Signed-off-by: Wang Xiao W --- diff --git a/drivers/net/fm10k/base/fm10k_pf.c b/drivers/net/fm10k/base/fm10k_pf.c index 704ab16dc0..6e6d71ed91 100644 --- a/drivers/net/fm10k/base/fm10k_pf.c +++ b/drivers/net/fm10k/base/fm10k_pf.c @@ -1969,8 +1969,8 @@ STATIC s32 fm10k_adjust_systime_pf(struct fm10k_hw *hw, s32 ppb) if (systime_adjust > FM10K_SW_SYSTIME_ADJUST_MASK) return FM10K_ERR_PARAM; - if (ppb < 0) - systime_adjust |= FM10K_SW_SYSTIME_ADJUST_DIR_NEGATIVE; + if (ppb > 0) + systime_adjust |= FM10K_SW_SYSTIME_ADJUST_DIR_POSITIVE; FM10K_WRITE_SW_REG(hw, FM10K_SW_SYSTIME_ADJUST, (u32)systime_adjust); diff --git a/drivers/net/fm10k/base/fm10k_type.h b/drivers/net/fm10k/base/fm10k_type.h index fed8cbe177..39e4d15f4b 100644 --- a/drivers/net/fm10k/base/fm10k_type.h +++ b/drivers/net/fm10k/base/fm10k_type.h @@ -486,7 +486,7 @@ struct fm10k_hw; #define FM10K_SW_SYSTIME_CFG_ADJUST_MASK 0xFF000000 #define FM10K_SW_SYSTIME_ADJUST 0x0224D #define FM10K_SW_SYSTIME_ADJUST_MASK 0x3FFFFFFF -#define FM10K_SW_SYSTIME_ADJUST_DIR_NEGATIVE 0x80000000 +#define FM10K_SW_SYSTIME_ADJUST_DIR_POSITIVE 0x80000000 #define FM10K_SW_SYSTIME_PULSE(_n) ((_n) + 0x02252) #ifndef ETH_ALEN