Merge remote-tracking branch 'net-next/master'
[linux] / drivers / net / ethernet / qlogic / qed / qed_spq.c
index ba64ff9..79b311b 100644 (file)
@@ -795,6 +795,17 @@ int qed_spq_pend_post(struct qed_hwfn *p_hwfn)
                                 SPQ_HIGH_PRI_RESERVE_DEFAULT);
 }
 
+static void qed_spq_recov_set_ret_code(struct qed_spq_entry *p_ent,
+                                      u8 *fw_return_code)
+{
+       if (!fw_return_code)
+               return;
+
+       if (p_ent->elem.hdr.protocol_id == PROTOCOLID_ROCE ||
+           p_ent->elem.hdr.protocol_id == PROTOCOLID_IWARP)
+               *fw_return_code = RDMA_RETURN_OK;
+}
+
 /* Avoid overriding of SPQ entries when getting out-of-order completions, by
  * marking the completions in a bitmap and increasing the chain consumer only
  * for the first successive completed entries.
@@ -830,6 +841,17 @@ int qed_spq_post(struct qed_hwfn *p_hwfn,
                return -EINVAL;
        }
 
+       if (p_hwfn->cdev->recov_in_prog) {
+               DP_VERBOSE(p_hwfn,
+                          QED_MSG_SPQ,
+                          "Recovery is in progress. Skip spq post [cmd %02x protocol %02x]\n",
+                          p_ent->elem.hdr.cmd_id, p_ent->elem.hdr.protocol_id);
+
+               /* Let the flow complete w/o any error handling */
+               qed_spq_recov_set_ret_code(p_ent, fw_return_code);
+               return 0;
+       }
+
        /* Complete the entry */
        rc = qed_spq_fill_entry(p_hwfn, p_ent);