]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/intel/i40e/i40e_main.c
i40e: reset all VFs in parallel when rebuilding PF
[karo-tx-linux.git] / drivers / net / ethernet / intel / i40e / i40e_main.c
index 2bf5bb1b46272ce697423bcb967c1bf07c687ddd..2fe1fbdaafae732cd666d0957058e0fb829b3621 100644 (file)
@@ -4158,6 +4158,29 @@ void i40e_vsi_stop_rings(struct i40e_vsi *vsi)
        i40e_vsi_control_rx(vsi, false);
 }
 
+/**
+ * i40e_vsi_stop_rings_no_wait - Stop a VSI's rings and do not delay
+ * @vsi: the VSI being shutdown
+ *
+ * This function stops all the rings for a VSI but does not delay to verify
+ * that rings have been disabled. It is expected that the caller is shutting
+ * down multiple VSIs at once and will delay together for all the VSIs after
+ * initiating the shutdown. This is particularly useful for shutting down lots
+ * of VFs together. Otherwise, a large delay can be incurred while configuring
+ * each VSI in serial.
+ **/
+void i40e_vsi_stop_rings_no_wait(struct i40e_vsi *vsi)
+{
+       struct i40e_pf *pf = vsi->back;
+       int i, pf_q;
+
+       pf_q = vsi->base_queue;
+       for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
+               i40e_control_tx_q(pf, pf_q, false);
+               i40e_control_rx_q(pf, pf_q, false);
+       }
+}
+
 /**
  * i40e_vsi_free_irq - Free the irq association with the OS
  * @vsi: the VSI being configured
@@ -4488,14 +4511,13 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf)
        }
 }
 
-#ifdef CONFIG_I40E_DCB
 /**
  * i40e_vsi_wait_queues_disabled - Wait for VSI's queues to be disabled
  * @vsi: the VSI being configured
  *
  * Wait until all queues on a given VSI have been disabled.
  **/
-static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
+int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
 {
        struct i40e_pf *pf = vsi->back;
        int i, pf_q, ret;
@@ -4523,6 +4545,7 @@ static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
        return 0;
 }
 
+#ifdef CONFIG_I40E_DCB
 /**
  * i40e_pf_wait_queues_disabled - Wait for all queues of PF VSIs to be disabled
  * @pf: the PF
@@ -7151,10 +7174,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
        if (!lock_acquired)
                rtnl_unlock();
 
-       if (pf->num_alloc_vfs) {
-               for (v = 0; v < pf->num_alloc_vfs; v++)
-                       i40e_reset_vf(&pf->vf[v], true);
-       }
+       i40e_reset_all_vfs(pf, true);
 
        /* tell the firmware that we're starting */
        i40e_send_version(pf);