From: Sasha Neftin <sasha.nef...@intel.com>

i225 specification recommends minus 1 microsecond from a value
calculated for a LTR. Fix the calculation to match spec.

Fixes: 8cb7c57d9b3c ("net/igc: support device initialization")
Cc: sta...@dpdk.org

Signed-off-by: Sasha Neftin <sasha.nef...@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
---
 drivers/net/intel/igc/base/igc_i225.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/intel/igc/base/igc_i225.c 
b/drivers/net/intel/igc/base/igc_i225.c
index 003c060215..e701d00f80 100644
--- a/drivers/net/intel/igc/base/igc_i225.c
+++ b/drivers/net/intel/igc/base/igc_i225.c
@@ -1071,7 +1071,9 @@ static s32 igc_set_ltr_i225(struct igc_hw *hw, bool link)
                scale_max = (ltr_max / 1024) < 1024 ? IGC_LTRMAXV_SCALE_1024 :
                            IGC_LTRMAXV_SCALE_32768;
                ltr_min /= scale_min == IGC_LTRMINV_SCALE_1024 ? 1024 : 32768;
+               ltr_min -= 1;
                ltr_max /= scale_max == IGC_LTRMAXV_SCALE_1024 ? 1024 : 32768;
+               ltr_max -= 1;
 
                /* Only write the LTR thresholds if they differ from before. */
                ltrv = IGC_READ_REG(hw, IGC_LTRMINV);
-- 
2.43.5

Reply via email to