diff mbox series

[net-next] iavf: use iavf_schedule_aq_request() helper

Message ID 20231027095102.499914-1-poros@redhat.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net-next] iavf: use iavf_schedule_aq_request() helper | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1363 this patch: 1363
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1388 this patch: 1388
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1388 this patch: 1388
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 92 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Petr Oros Oct. 27, 2023, 9:51 a.m. UTC
Use the iavf_schedule_aq_request() helper when we need to
schedule a watchdog task immediately. No functional change.

Signed-off-by: Petr Oros <poros@redhat.com>
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 10 +++-------
 drivers/net/ethernet/intel/iavf/iavf_main.c    | 15 +++++----------
 2 files changed, 8 insertions(+), 17 deletions(-)

Comments

Wojciech Drewek Oct. 27, 2023, 1:08 p.m. UTC | #1
On 27.10.2023 11:51, Petr Oros wrote:
> Use the iavf_schedule_aq_request() helper when we need to
> schedule a watchdog task immediately. No functional change.
> 
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

>  drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 10 +++-------
>  drivers/net/ethernet/intel/iavf/iavf_main.c    | 15 +++++----------
>  2 files changed, 8 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
> index 90397293525f71..fc8d75a30602cd 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
> @@ -1447,10 +1447,9 @@ static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
>  	iavf_fdir_list_add_fltr(adapter, fltr);
>  	adapter->fdir_active_fltr++;
>  	fltr->state = IAVF_FDIR_FLTR_ADD_REQUEST;
> -	adapter->aq_required |= IAVF_FLAG_AQ_ADD_FDIR_FILTER;
>  	spin_unlock_bh(&adapter->fdir_fltr_lock);
>  
> -	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
> +	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_FDIR_FILTER);
>  
>  ret:
>  	if (err && fltr)
> @@ -1481,7 +1480,6 @@ static int iavf_del_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
>  	if (fltr) {
>  		if (fltr->state == IAVF_FDIR_FLTR_ACTIVE) {
>  			fltr->state = IAVF_FDIR_FLTR_DEL_REQUEST;
> -			adapter->aq_required |= IAVF_FLAG_AQ_DEL_FDIR_FILTER;
>  		} else {
>  			err = -EBUSY;
>  		}
> @@ -1491,7 +1489,7 @@ static int iavf_del_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
>  	spin_unlock_bh(&adapter->fdir_fltr_lock);
>  
>  	if (fltr && fltr->state == IAVF_FDIR_FLTR_DEL_REQUEST)
> -		mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
> +		iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DEL_FDIR_FILTER);
>  
>  	return err;
>  }
> @@ -1660,7 +1658,6 @@ iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
>  			rss_old->hash_flds = hash_flds;
>  			memcpy(&rss_old->cfg_msg, &rss_new->cfg_msg,
>  			       sizeof(rss_new->cfg_msg));
> -			adapter->aq_required |= IAVF_FLAG_AQ_ADD_ADV_RSS_CFG;
>  		} else {
>  			err = -EEXIST;
>  		}
> @@ -1670,12 +1667,11 @@ iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
>  		rss_new->packet_hdrs = hdrs;
>  		rss_new->hash_flds = hash_flds;
>  		list_add_tail(&rss_new->list, &adapter->adv_rss_list_head);
> -		adapter->aq_required |= IAVF_FLAG_AQ_ADD_ADV_RSS_CFG;
>  	}
>  	spin_unlock_bh(&adapter->adv_rss_lock);
>  
>  	if (!err)
> -		mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
> +		iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_ADV_RSS_CFG);
>  
>  	mutex_unlock(&adapter->crit_lock);
>  
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index b3434dbc90d6fe..7217ba018f6bbf 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -1060,13 +1060,12 @@ static int iavf_replace_primary_mac(struct iavf_adapter *adapter,
>  	 */
>  	new_f->is_primary = true;
>  	new_f->add = true;
> -	adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
>  	ether_addr_copy(hw->mac.addr, new_mac);
>  
>  	spin_unlock_bh(&adapter->mac_vlan_list_lock);
>  
>  	/* schedule the watchdog task to immediately process the request */
> -	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
> +	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_MAC_FILTER);
>  	return 0;
>  }
>  
> @@ -1284,10 +1283,9 @@ static void iavf_up_complete(struct iavf_adapter *adapter)
>  
>  	iavf_napi_enable_all(adapter);
>  
> -	adapter->aq_required |= IAVF_FLAG_AQ_ENABLE_QUEUES;
>  	if (CLIENT_ENABLED(adapter))
>  		adapter->flags |= IAVF_FLAG_CLIENT_NEEDS_OPEN;
> -	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
> +	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ENABLE_QUEUES);
>  }
>  
>  /**
> @@ -1439,8 +1437,7 @@ void iavf_down(struct iavf_adapter *adapter)
>  			adapter->aq_required |= IAVF_FLAG_AQ_DEL_ADV_RSS_CFG;
>  	}
>  
> -	adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES;
> -	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
> +	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DISABLE_QUEUES);
>  }
>  
>  /**
> @@ -2340,10 +2337,8 @@ iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
>  		}
>  	}
>  
> -	if (aq_required) {
> -		adapter->aq_required |= aq_required;
> -		mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
> -	}
> +	if (aq_required)
> +		iavf_schedule_aq_request(adapter, aq_required);
>  }
>  
>  /**
Jacob Keller Oct. 27, 2023, 8:39 p.m. UTC | #2
On 10/27/2023 2:51 AM, Petr Oros wrote:
> Use the iavf_schedule_aq_request() helper when we need to
> schedule a watchdog task immediately. No functional change.
> 
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---

This does not apply as-is to Intel Wired LAN dev-queue. I have no
objection to netdev taking this directly, but if you want this to go
through our IWL dev-queue testing, please rebase it and sent it tagged
as iwl-next.

Thanks,
Jake
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
index 90397293525f71..fc8d75a30602cd 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
@@ -1447,10 +1447,9 @@  static int iavf_add_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
 	iavf_fdir_list_add_fltr(adapter, fltr);
 	adapter->fdir_active_fltr++;
 	fltr->state = IAVF_FDIR_FLTR_ADD_REQUEST;
-	adapter->aq_required |= IAVF_FLAG_AQ_ADD_FDIR_FILTER;
 	spin_unlock_bh(&adapter->fdir_fltr_lock);
 
-	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
+	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_FDIR_FILTER);
 
 ret:
 	if (err && fltr)
@@ -1481,7 +1480,6 @@  static int iavf_del_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
 	if (fltr) {
 		if (fltr->state == IAVF_FDIR_FLTR_ACTIVE) {
 			fltr->state = IAVF_FDIR_FLTR_DEL_REQUEST;
-			adapter->aq_required |= IAVF_FLAG_AQ_DEL_FDIR_FILTER;
 		} else {
 			err = -EBUSY;
 		}
@@ -1491,7 +1489,7 @@  static int iavf_del_fdir_ethtool(struct iavf_adapter *adapter, struct ethtool_rx
 	spin_unlock_bh(&adapter->fdir_fltr_lock);
 
 	if (fltr && fltr->state == IAVF_FDIR_FLTR_DEL_REQUEST)
-		mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
+		iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DEL_FDIR_FILTER);
 
 	return err;
 }
@@ -1660,7 +1658,6 @@  iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
 			rss_old->hash_flds = hash_flds;
 			memcpy(&rss_old->cfg_msg, &rss_new->cfg_msg,
 			       sizeof(rss_new->cfg_msg));
-			adapter->aq_required |= IAVF_FLAG_AQ_ADD_ADV_RSS_CFG;
 		} else {
 			err = -EEXIST;
 		}
@@ -1670,12 +1667,11 @@  iavf_set_adv_rss_hash_opt(struct iavf_adapter *adapter,
 		rss_new->packet_hdrs = hdrs;
 		rss_new->hash_flds = hash_flds;
 		list_add_tail(&rss_new->list, &adapter->adv_rss_list_head);
-		adapter->aq_required |= IAVF_FLAG_AQ_ADD_ADV_RSS_CFG;
 	}
 	spin_unlock_bh(&adapter->adv_rss_lock);
 
 	if (!err)
-		mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
+		iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_ADV_RSS_CFG);
 
 	mutex_unlock(&adapter->crit_lock);
 
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index b3434dbc90d6fe..7217ba018f6bbf 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -1060,13 +1060,12 @@  static int iavf_replace_primary_mac(struct iavf_adapter *adapter,
 	 */
 	new_f->is_primary = true;
 	new_f->add = true;
-	adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
 	ether_addr_copy(hw->mac.addr, new_mac);
 
 	spin_unlock_bh(&adapter->mac_vlan_list_lock);
 
 	/* schedule the watchdog task to immediately process the request */
-	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
+	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_MAC_FILTER);
 	return 0;
 }
 
@@ -1284,10 +1283,9 @@  static void iavf_up_complete(struct iavf_adapter *adapter)
 
 	iavf_napi_enable_all(adapter);
 
-	adapter->aq_required |= IAVF_FLAG_AQ_ENABLE_QUEUES;
 	if (CLIENT_ENABLED(adapter))
 		adapter->flags |= IAVF_FLAG_CLIENT_NEEDS_OPEN;
-	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
+	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ENABLE_QUEUES);
 }
 
 /**
@@ -1439,8 +1437,7 @@  void iavf_down(struct iavf_adapter *adapter)
 			adapter->aq_required |= IAVF_FLAG_AQ_DEL_ADV_RSS_CFG;
 	}
 
-	adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES;
-	mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
+	iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DISABLE_QUEUES);
 }
 
 /**
@@ -2340,10 +2337,8 @@  iavf_set_vlan_offload_features(struct iavf_adapter *adapter,
 		}
 	}
 
-	if (aq_required) {
-		adapter->aq_required |= aq_required;
-		mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0);
-	}
+	if (aq_required)
+		iavf_schedule_aq_request(adapter, aq_required);
 }
 
 /**