summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igc/igc.h
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@intel.com>2020-08-20 16:02:17 -0700
committerTony Nguyen <anthony.l.nguyen@intel.com>2020-09-28 14:42:46 -0700
commitb03c49cde61f9e5a68cb0b1f3540fcb20b27b6fa (patch)
tree3147c15f3e2c0d268e5bf9db65ee46e960ff1bc0 /drivers/net/ethernet/intel/igc/igc.h
parente5f020ad610b11827914245048ec55a7bb030944 (diff)
igc: Save PTP time before a reset
Many TSN features depend on the internal PTP clock, so the internal PTP jumping when the adapter is reset can cause problems, usually in the form of "TX Hangs" warnings in the driver. The solution is to save the PTP time before a reset and restore it after the reset is done. The value of the PTP time is saved before a reset and we use the difference from CLOCK_MONOTONIC from reset time to now, to correct what's going to be the new PTP time. This is heavily inspired by commit bf4bf09bdd91 ("i40e: save PTP time before a device reset"). Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc.h')
-rw-r--r--drivers/net/ethernet/intel/igc/igc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 2d566f3c827b..2e5720d34a16 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -215,6 +215,8 @@ struct igc_adapter {
spinlock_t tmreg_lock;
struct cyclecounter cc;
struct timecounter tc;
+ struct timespec64 prev_ptp_time; /* Pre-reset PTP clock */
+ ktime_t ptp_reset_start; /* Reset time in clock mono */
};
void igc_up(struct igc_adapter *adapter);