On 5/14/2025 7:57 AM, Robert Malz wrote:

When a VFLR interrupt is received during a VF reset initiated from a
different source, the VFLR may be not fully handled. This can
leave the VF in an undefined state.
To address this, set the I40E_VFLR_EVENT_PENDING bit again during VFLR
handling if the reset is not yet complete. This ensures the driver
will properly complete the VF reset in such scenarios.

Fixes: 52424f974bc5 ("i40e: Fix VF hang when reset is triggered on another VF")
Signed-off-by: Robert Malz <[email protected]>
---
  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c 
b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index abd72ab36af7..6b13ac85016f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1546,8 +1546,8 @@ static void i40e_cleanup_reset_vf(struct i40e_vf *vf)
   * @vf: pointer to the VF structure
   * @flr: VFLR was issued or not
   *
- * Returns true if resets are disabled or was performed successfully,
- * false if reset is already in progress.
+ * Returns true if reset was performed successfully or if resets are
+ * disabled. False if reset is already in progress.

You also changed this wording in patch 1/2. Let's keep the i40e_reset_vf() description changes in the other patch where that function is changed.

sln

   **/
  bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
  {
@@ -4328,7 +4328,10 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)
                 reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx));
                 if (reg & BIT(bit_idx))
                         /* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT 
*/
-                       i40e_reset_vf(vf, true);
+                       if (!i40e_reset_vf(vf, true)) {
+                               /* At least one VF did not finish resetting, 
retry next time */
+                               set_bit(__I40E_VFLR_EVENT_PENDING, pf->state);
+                       }
         }

         return 0;
--
2.34.1



Reply via email to