Commit 024b05f4 authored by Jacob Keller's avatar Jacob Keller Committed by Jeff Kirsher

i40e: don't hold RTNL lock while waiting for VF reset to finish

We made some effort to reduce the RTNL lock scope when resetting and
rebuilding the PF. Unfortunately we still held the RTNL lock during the
VF reset operation, which meant that multiple PFs could not reset in
parallel due to the global lock. For now, further reduce the scope by
not holding the RTNL lock while resetting VFs. This allows multiple PFs
to reset in a timely manner.

Change-ID: I2fbf823a0063f24dff67676cad09f0bbf83ee4ce
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 1d5c960c
...@@ -7108,6 +7108,10 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -7108,6 +7108,10 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
/* restart the VSIs that were rebuilt and running before the reset */ /* restart the VSIs that were rebuilt and running before the reset */
i40e_pf_unquiesce_all_vsi(pf); i40e_pf_unquiesce_all_vsi(pf);
/* Release the RTNL lock before we start resetting VFs */
if (!lock_acquired)
rtnl_unlock();
if (pf->num_alloc_vfs) { if (pf->num_alloc_vfs) {
for (v = 0; v < pf->num_alloc_vfs; v++) for (v = 0; v < pf->num_alloc_vfs; v++)
i40e_reset_vf(&pf->vf[v], true); i40e_reset_vf(&pf->vf[v], true);
...@@ -7116,8 +7120,11 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -7116,8 +7120,11 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
/* tell the firmware that we're starting */ /* tell the firmware that we're starting */
i40e_send_version(pf); i40e_send_version(pf);
/* We've already released the lock, so don't do it again */
goto end_core_reset;
end_unlock: end_unlock:
if (!lock_acquired) if (!lock_acquired)
rtnl_unlock(); rtnl_unlock();
end_core_reset: end_core_reset:
clear_bit(__I40E_RESET_FAILED, &pf->state); clear_bit(__I40E_RESET_FAILED, &pf->state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment