]> git.baikalelectronics.ru Git - kernel.git/commitdiff
i40e: Fix for VF MAC address 0
authorSylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Mon, 31 Oct 2022 12:00:28 +0000 (13:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Dec 2022 10:30:46 +0000 (11:30 +0100)
[ Upstream commit 08501970472077ed5de346ad89943a37d1692e9b ]

After spawning max VFs on a PF, some VFs were not getting resources and
their MAC addresses were 0. This was caused by PF sleeping before flushing
HW registers which caused VIRTCHNL_VFR_VFACTIVE to not be set in time for
VF.

Fix by adding a sleep after hw flush.

Fixes: 88d48b20c639 ("i40e: reset all VFs in parallel when rebuilding PF")
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

index fb060e3253d9cfec92f18539bdba348ff1c2a69d..be07148a7b29455c049a42b5d58079f0f744e106 100644 (file)
@@ -1394,6 +1394,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
        i40e_cleanup_reset_vf(vf);
 
        i40e_flush(hw);
+       usleep_range(20000, 40000);
        clear_bit(I40E_VF_STATE_RESETTING, &vf->vf_states);
 
        return true;
@@ -1517,6 +1518,7 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
        }
 
        i40e_flush(hw);
+       usleep_range(20000, 40000);
        clear_bit(__I40E_VF_DISABLE, pf->state);
 
        return true;