diff mbox series

[iwl-net,v1,3/4] igc: Remove unused qbv_count

Message ID 20240702040926.3327530-4-faizal.abdul.rahim@linux.intel.com
State Changes Requested
Headers show
Series igc bug fixes related to qbv_count usage | expand

Commit Message

Abdul Rahim, Faizal July 2, 2024, 4:09 a.m. UTC
Removing qbv_count which is now obsolete after these 2 patches:
"igc: Fix reset adapter logics when tx mode change"
"igc: Fix qbv_config_change_errors logics"

The variable qbv_count serves to indicate whether Taprio is active or if
the tx mode is in TSN (IGC_TQAVCTRL_TRANSMIT_MODE_TSN). This is due to its
unconditional increment within igc_tsn_enable_offload(), which both runs
Taprio and sets the tx mode to TSN.

Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h      | 1 -
 drivers/net/ethernet/intel/igc/igc_main.c | 1 -
 drivers/net/ethernet/intel/igc/igc_tsn.c  | 2 --
 3 files changed, 4 deletions(-)

Comments

Simon Horman July 3, 2024, 3:10 p.m. UTC | #1
On Tue, Jul 02, 2024 at 12:09:25AM -0400, Faizal Rahim wrote:
> Removing qbv_count which is now obsolete after these 2 patches:
> "igc: Fix reset adapter logics when tx mode change"
> "igc: Fix qbv_config_change_errors logics"
> 
> The variable qbv_count serves to indicate whether Taprio is active or if
> the tx mode is in TSN (IGC_TQAVCTRL_TRANSMIT_MODE_TSN). This is due to its
> unconditional increment within igc_tsn_enable_offload(), which both runs
> Taprio and sets the tx mode to TSN.
> 
> Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>

Hi Faizal,

This change looks good to me.
However, it seems more appropriate as a clean-up for iwl-next
once the previous to patches make it there via iwl-net.

That notwithstanding,

Reviewed-by: Simon Horman <horms@kernel.org>

...
Abdul Rahim, Faizal July 5, 2024, 4:47 p.m. UTC | #2
On 3/7/2024 11:10 pm, Simon Horman wrote:
> On Tue, Jul 02, 2024 at 12:09:25AM -0400, Faizal Rahim wrote:
>> Removing qbv_count which is now obsolete after these 2 patches:
>> "igc: Fix reset adapter logics when tx mode change"
>> "igc: Fix qbv_config_change_errors logics"
>>
>> The variable qbv_count serves to indicate whether Taprio is active or if
>> the tx mode is in TSN (IGC_TQAVCTRL_TRANSMIT_MODE_TSN). This is due to its
>> unconditional increment within igc_tsn_enable_offload(), which both runs
>> Taprio and sets the tx mode to TSN.
>>
>> Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
> 
> Hi Faizal,
> 
> This change looks good to me.
> However, it seems more appropriate as a clean-up for iwl-next
> once the previous to patches make it there via iwl-net.
> 
> That notwithstanding,
> 
> Reviewed-by: Simon Horman <horms@kernel.org>
> 
> ...

Got it, will do that.
Thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 8b14c029eda1..5fd0d85f83ac 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -254,7 +254,6 @@  struct igc_adapter {
 	bool taprio_offload_enable;
 	u32 qbv_config_change_errors;
 	bool qbv_transition;
-	unsigned int qbv_count;
 	/* Access to oper_gate_closed, admin_gate_closed and qbv_transition
 	 * are protected by the qbv_tx_lock.
 	 */
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 0f8a5ad940ec..e7664bd81505 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6246,7 +6246,6 @@  static int igc_qbv_clear_schedule(struct igc_adapter *adapter)
 	adapter->cycle_time = NSEC_PER_SEC;
 	adapter->taprio_offload_enable = false;
 	adapter->qbv_config_change_errors = 0;
-	adapter->qbv_count = 0;
 
 	for (i = 0; i < adapter->num_tx_queues; i++) {
 		struct igc_ring *ring = adapter->tx_ring[i];
diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
index 61f047ebf34d..26dbe3442ad1 100644
--- a/drivers/net/ethernet/intel/igc/igc_tsn.c
+++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
@@ -267,8 +267,6 @@  static int igc_tsn_enable_offload(struct igc_adapter *adapter)
 
 	tqavctrl |= IGC_TQAVCTRL_TRANSMIT_MODE_TSN | IGC_TQAVCTRL_ENHANCED_QAV;
 
-	adapter->qbv_count++;
-
 	cycle = adapter->cycle_time;
 	base_time = adapter->base_time;