]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bnx2x: Do not handle requests from VFs after parity
authorManish Chopra <manishc@marvell.com>
Wed, 11 Dec 2019 17:59:55 +0000 (09:59 -0800)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 14 Dec 2019 20:59:16 +0000 (12:59 -0800)
Parity error from the hardware will cause PF to lose the state
of their VFs due to PF's internal reload and hardware reset following
the parity error. Restrict any configuration request from the VFs after
the parity as it could cause unexpected hardware behavior, only way
for VFs to recover would be to trigger FLR on VFs and reload them.

Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c

index 192ff8d5da3247c5f9f3b2fa0d7382adbdd83fb6..cff64e43bdd80552e160d4d4935f2f55b37272e1 100644 (file)
@@ -9976,10 +9976,18 @@ static void bnx2x_recovery_failed(struct bnx2x *bp)
  */
 static void bnx2x_parity_recover(struct bnx2x *bp)
 {
-       bool global = false;
        u32 error_recovered, error_unrecovered;
-       bool is_parity;
+       bool is_parity, global = false;
+#ifdef CONFIG_BNX2X_SRIOV
+       int vf_idx;
+
+       for (vf_idx = 0; vf_idx < bp->requested_nr_virtfn; vf_idx++) {
+               struct bnx2x_virtf *vf = BP_VF(bp, vf_idx);
 
+               if (vf)
+                       vf->state = VF_LOST;
+       }
+#endif
        DP(NETIF_MSG_HW, "Handling parity\n");
        while (1) {
                switch (bp->recovery_state) {
index b6ebd92ec565f14317b369c1bc6bc980f88d04f6..3a716c0154159135eaf78910e3c6240b4d176a80 100644 (file)
@@ -139,6 +139,7 @@ struct bnx2x_virtf {
 #define VF_ACQUIRED    1       /* VF acquired, but not initialized */
 #define VF_ENABLED     2       /* VF Enabled */
 #define VF_RESET       3       /* VF FLR'd, pending cleanup */
+#define VF_LOST                4       /* Recovery while VFs are loaded */
 
        bool flr_clnup_stage;   /* true during flr cleanup */
        bool malicious;         /* true if FW indicated so, until FLR */
index 0752b7fa4d9c005db32f7b537c43ffcd9df51f31..ea0e9394f898683d9b9564812c296a343859c94e 100644 (file)
@@ -2107,6 +2107,18 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
 {
        int i;
 
+       if (vf->state == VF_LOST) {
+               /* Just ack the FW and return if VFs are lost
+                * in case of parity error. VFs are supposed to be timedout
+                * on waiting for PF response.
+                */
+               DP(BNX2X_MSG_IOV,
+                  "VF 0x%x lost, not handling the request\n", vf->abs_vfid);
+
+               storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
+               return;
+       }
+
        /* check if tlv type is known */
        if (bnx2x_tlv_supported(mbx->first_tlv.tl.type)) {
                /* Lock the per vf op mutex and note the locker's identity.