[v1,06/24] net/igc/base: fix LTR for i225

Message ID 6b671dbcfb6eb8aa802926d494c6808351ae1cae.1738858026.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted
Delegated to: Bruce Richardson
Headers
Series Fixes for igc and e1000 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Burakov, Anatoly Feb. 6, 2025, 4:08 p.m. UTC
From: Sasha Neftin <sasha.neftin@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: stable@dpdk.org

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

Patch

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);