diff options
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_tsn.c')
| -rw-r--r-- | drivers/net/ethernet/intel/igc/igc_tsn.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c index a386c8d61dbf..94a2b0dfb54d 100644 --- a/drivers/net/ethernet/intel/igc/igc_tsn.c +++ b/drivers/net/ethernet/intel/igc/igc_tsn.c @@ -114,6 +114,7 @@ static int igc_tsn_disable_offload(struct igc_adapter *adapter)  static int igc_tsn_enable_offload(struct igc_adapter *adapter)  {  	struct igc_hw *hw = &adapter->hw; +	bool tsn_mode_reconfig = false;  	u32 tqavctrl, baset_l, baset_h;  	u32 sec, nsec, cycle;  	ktime_t base_time, systim; @@ -226,6 +227,10 @@ skip_cbs:  	}  	tqavctrl = rd32(IGC_TQAVCTRL) & ~IGC_TQAVCTRL_FUTSCDDIS; + +	if (tqavctrl & IGC_TQAVCTRL_TRANSMIT_MODE_TSN) +		tsn_mode_reconfig = true; +  	tqavctrl |= IGC_TQAVCTRL_TRANSMIT_MODE_TSN | IGC_TQAVCTRL_ENHANCED_QAV;  	cycle = adapter->cycle_time; @@ -239,6 +244,13 @@ skip_cbs:  		s64 n = div64_s64(ktime_sub_ns(systim, base_time), cycle);  		base_time = ktime_add_ns(base_time, (n + 1) * cycle); + +		/* Increase the counter if scheduling into the past while +		 * Gate Control List (GCL) is running. +		 */ +		if ((rd32(IGC_BASET_H) || rd32(IGC_BASET_L)) && +		    tsn_mode_reconfig) +			adapter->qbv_config_change_errors++;  	} else {  		/* According to datasheet section 7.5.2.9.3.3, FutScdDis bit  		 * has to be configured before the cycle time and base time.  |