@@ -2921,7 +2921,6 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
2921
2921
iavf_free_queues (adapter );
2922
2922
memset (adapter -> vf_res , 0 , IAVF_VIRTCHNL_VF_RESOURCE_SIZE );
2923
2923
iavf_shutdown_adminq (& adapter -> hw );
2924
- adapter -> netdev -> flags &= ~IFF_UP ;
2925
2924
adapter -> flags &= ~IAVF_FLAG_RESET_PENDING ;
2926
2925
iavf_change_state (adapter , __IAVF_DOWN );
2927
2926
wake_up (& adapter -> down_waitqueue );
@@ -3021,6 +3020,11 @@ static void iavf_reset_task(struct work_struct *work)
3021
3020
iavf_disable_vf (adapter );
3022
3021
mutex_unlock (& adapter -> client_lock );
3023
3022
mutex_unlock (& adapter -> crit_lock );
3023
+ if (netif_running (netdev )) {
3024
+ rtnl_lock ();
3025
+ dev_close (netdev );
3026
+ rtnl_unlock ();
3027
+ }
3024
3028
return ; /* Do not attempt to reinit. It's dead, Jim. */
3025
3029
}
3026
3030
@@ -3173,6 +3177,16 @@ static void iavf_reset_task(struct work_struct *work)
3173
3177
3174
3178
mutex_unlock (& adapter -> client_lock );
3175
3179
mutex_unlock (& adapter -> crit_lock );
3180
+
3181
+ if (netif_running (netdev )) {
3182
+ /* Close device to ensure that Tx queues will not be started
3183
+ * during netif_device_attach() at the end of the reset task.
3184
+ */
3185
+ rtnl_lock ();
3186
+ dev_close (netdev );
3187
+ rtnl_unlock ();
3188
+ }
3189
+
3176
3190
dev_err (& adapter -> pdev -> dev , "failed to allocate resources during reinit\n" );
3177
3191
reset_finish :
3178
3192
rtnl_lock ();
0 commit comments