diff options
| -rw-r--r-- | drivers/net/ethernet/intel/iavf/iavf.h | 5 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/iavf/iavf_main.c | 21 | 
2 files changed, 26 insertions, 0 deletions
| diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h index c241fbc30f93..a988c08e906f 100644 --- a/drivers/net/ethernet/intel/iavf/iavf.h +++ b/drivers/net/ethernet/intel/iavf/iavf.h @@ -431,6 +431,11 @@ struct iavf_adapter {  	/* lock to protect access to the cloud filter list */  	spinlock_t cloud_filter_list_lock;  	u16 num_cloud_filters; +	/* snapshot of "num_active_queues" before setup_tc for qdisc add +	 * is invoked. This information is useful during qdisc del flow, +	 * to restore correct number of queues +	 */ +	int orig_num_active_queues;  #define IAVF_MAX_FDIR_FILTERS 128	/* max allowed Flow Director filters */  	u16 fdir_active_fltr; diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 51ae10eb348c..3dbfaead2ac7 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -3429,6 +3429,7 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)  			netif_tx_disable(netdev);  			iavf_del_all_cloud_filters(adapter);  			adapter->aq_required = IAVF_FLAG_AQ_DISABLE_CHANNELS; +			total_qps = adapter->orig_num_active_queues;  			goto exit;  		} else {  			return -EINVAL; @@ -3472,7 +3473,21 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)  				adapter->ch_config.ch_info[i].offset = 0;  			}  		} + +		/* Take snapshot of original config such as "num_active_queues" +		 * It is used later when delete ADQ flow is exercised, so that +		 * once delete ADQ flow completes, VF shall go back to its +		 * original queue configuration +		 */ + +		adapter->orig_num_active_queues = adapter->num_active_queues; + +		/* Store queue info based on TC so that VF gets configured +		 * with correct number of queues when VF completes ADQ config +		 * flow +		 */  		adapter->ch_config.total_qps = total_qps; +  		netif_tx_stop_all_queues(netdev);  		netif_tx_disable(netdev);  		adapter->aq_required |= IAVF_FLAG_AQ_ENABLE_CHANNELS; @@ -3489,6 +3504,12 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)  		}  	}  exit: +	if (test_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section)) +		return 0; + +	netif_set_real_num_rx_queues(netdev, total_qps); +	netif_set_real_num_tx_queues(netdev, total_qps); +  	return ret;  } | 
