Patch "i40e: always propagate error value in i40e_set_vsi_promisc()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    i40e: always propagate error value in i40e_set_vsi_promisc()

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i40e-always-propagate-error-value-in-i40e_set_vsi_pr.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit eac84bb0e8dd32af4256c8d1281c418f6a8ec2c9
Author: Stefan Assmann <sassmann@xxxxxxxxx>
Date:   Thu Aug 20 13:53:12 2020 +0200

    i40e: always propagate error value in i40e_set_vsi_promisc()
    
    [ Upstream commit b6f23d3817b965bcd6d72aab1f438ff6d16a0691 ]
    
    The for loop in i40e_set_vsi_promisc() reports errors via dev_err() but
    does not propagate the error up the call chain. Instead it continues the
    loop and potentially overwrites the reported error value.
    This results in the error being recorded in the log buffer, but the
    caller might never know anything went the wrong way.
    
    To avoid this situation i40e_set_vsi_promisc() needs to temporarily store
    the error after reporting it. This is still not optimal as multiple
    different errors may occur, so store the first error and hope that's
    the main issue.
    
    Fixes: 37d318d7805f (i40e: Remove scheduling while atomic possibility)
    Reported-by: Michal Schmidt <mschmidt@xxxxxxxxxx>
    Signed-off-by: Stefan Assmann <sassmann@xxxxxxxxx>
    Tested-by: Aaron Brown <aaron.f.brown@xxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 291ee55b125f8..30abaf939a76f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1198,9 +1198,9 @@ static i40e_status
 i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
 		     bool unicast_enable, s16 *vl, int num_vlans)
 {
+	i40e_status aq_ret, aq_tmp = 0;
 	struct i40e_pf *pf = vf->pf;
 	struct i40e_hw *hw = &pf->hw;
-	i40e_status aq_ret;
 	int i;
 
 	/* No VLAN to set promisc on, set on VSI */
@@ -1249,6 +1249,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
 				vf->vf_id,
 				i40e_stat_str(&pf->hw, aq_ret),
 				i40e_aq_str(&pf->hw, aq_err));
+
+			if (!aq_tmp)
+				aq_tmp = aq_ret;
 		}
 
 		aq_ret = i40e_aq_set_vsi_uc_promisc_on_vlan(hw, seid,
@@ -1262,8 +1265,15 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
 				vf->vf_id,
 				i40e_stat_str(&pf->hw, aq_ret),
 				i40e_aq_str(&pf->hw, aq_err));
+
+			if (!aq_tmp)
+				aq_tmp = aq_ret;
 		}
 	}
+
+	if (aq_tmp)
+		aq_ret = aq_tmp;
+
 	return aq_ret;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux