[PATCH v4 037/103] net/ice/base: improve read retry value calculation
Anatoly Burakov
anatoly.burakov at intel.com
Wed Jun 26 13:41:25 CEST 2024
From: Bartosz Staszewski <bartoszx.staszewski at intel.com>
Previous implementation of PHY timestamp retry value was set to a static value
that had no meaning. Change it to calculate it based on a set of meaningfully
named macros, as well as adjust data type to avoid overflows.
Signed-off-by: Bartosz Staszewski <bartoszx.staszewski at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
drivers/net/ice/base/ice_ptp_hw.c | 2 +-
drivers/net/ice/base/ice_ptp_hw.h | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c
index 5037feee18..5609145b8d 100644
--- a/drivers/net/ice/base/ice_ptp_hw.c
+++ b/drivers/net/ice/base/ice_ptp_hw.c
@@ -4492,7 +4492,7 @@ static int ice_write_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 val)
static int
ice_read_phy_tstamp_ll_e810(struct ice_hw *hw, u8 idx, u8 *hi, u32 *lo)
{
- u8 i;
+ unsigned int i;
/* Write TS index to read to the PF register so the FW can read it */
wr32(hw, PF_SB_ATQBAL, TS_LL_READ_TS_IDX(idx));
diff --git a/drivers/net/ice/base/ice_ptp_hw.h b/drivers/net/ice/base/ice_ptp_hw.h
index 73d01a047e..7c0c5ae562 100644
--- a/drivers/net/ice/base/ice_ptp_hw.h
+++ b/drivers/net/ice/base/ice_ptp_hw.h
@@ -516,7 +516,11 @@ int ice_ptp_init_phy_cfg(struct ice_hw *hw);
#define BYTES_PER_IDX_ADDR_L 4
/* Tx timestamp low latency read definitions */
-#define TS_LL_READ_RETRIES 200
+#define TS_LL_MAX_TIME_READ_PER_PORT 80
+#define TS_LL_MAX_PORT 8
+#define TS_LL_DELTA_TIME 360
+#define TS_LL_READ_RETRIES (TS_LL_MAX_TIME_READ_PER_PORT * \
+ TS_LL_MAX_PORT) + TS_LL_DELTA_TIME
#define TS_LL_READ_TS_INTR BIT(30)
#define TS_LL_READ_TS BIT(31)
#define TS_LL_READ_TS_IDX_S 24
--
2.43.0
More information about the dev
mailing list