net/qede/base: check for EDPM enabled in DB recovery
authorRasesh Mody <rasesh.mody@cavium.com>
Sat, 29 Sep 2018 08:14:28 +0000 (08:14 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:48 +0000 (18:53 +0200)
Add a check for EDPM enabled before flushing doorbell recovery queue.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore.h
drivers/net/qede/base/ecore_dev.c
drivers/net/qede/base/ecore_int.c

index 8982214..4607a80 100644 (file)
@@ -962,6 +962,8 @@ void ecore_db_recovery_dp(struct ecore_hwfn *p_hwfn);
 void ecore_db_recovery_execute(struct ecore_hwfn *p_hwfn,
                               enum ecore_db_rec_exec);
 
+bool ecore_edpm_enabled(struct ecore_hwfn *p_hwfn);
+
 /* amount of resources used in qm init */
 u8 ecore_init_qm_get_num_tcs(struct ecore_hwfn *p_hwfn);
 u16 ecore_init_qm_get_num_vfs(struct ecore_hwfn *p_hwfn);
index b83f003..f09f771 100644 (file)
@@ -1974,6 +1974,14 @@ enum ECORE_ROCE_EDPM_MODE {
        ECORE_ROCE_EDPM_MODE_DISABLE = 2,
 };
 
+bool ecore_edpm_enabled(struct ecore_hwfn *p_hwfn)
+{
+       if (p_hwfn->dcbx_no_edpm || p_hwfn->db_bar_no_edpm)
+               return false;
+
+       return true;
+}
+
 static enum _ecore_status_t
 ecore_hw_init_pf_doorbell_bar(struct ecore_hwfn *p_hwfn,
                              struct ecore_ptt *p_ptt)
@@ -2061,7 +2069,7 @@ ecore_hw_init_pf_doorbell_bar(struct ecore_hwfn *p_hwfn,
        DP_INFO(p_hwfn,
                " dpi_size=%d, dpi_count=%d, roce_edpm=%s\n",
                p_hwfn->dpi_size, p_hwfn->dpi_count,
-               ((p_hwfn->dcbx_no_edpm) || (p_hwfn->db_bar_no_edpm)) ?
+               (!ecore_edpm_enabled(p_hwfn)) ?
                "disabled" : "enabled");
 
        /* Check return codes from above calls */
index d41107d..c9acc72 100644 (file)
@@ -431,9 +431,8 @@ ecore_general_attention_35(struct ecore_hwfn *p_hwfn)
 #define ECORE_DB_REC_COUNT                     10
 #define ECORE_DB_REC_INTERVAL                  100
 
-/* assumes sticky overflow indication was set for this PF */
-static enum _ecore_status_t ecore_db_rec_attn(struct ecore_hwfn *p_hwfn,
-                                             struct ecore_ptt *p_ptt)
+static enum _ecore_status_t ecore_db_rec_flush_queue(struct ecore_hwfn *p_hwfn,
+                                                    struct ecore_ptt *p_ptt)
 {
        u8 count = ECORE_DB_REC_COUNT;
        u32 usage = 1;
@@ -461,6 +460,21 @@ static enum _ecore_status_t ecore_db_rec_attn(struct ecore_hwfn *p_hwfn,
                return ECORE_TIMEOUT;
        }
 
+       return ECORE_SUCCESS;
+}
+
+/* assumes sticky overflow indication was set for this PF */
+static enum _ecore_status_t ecore_db_rec_attn(struct ecore_hwfn *p_hwfn,
+                                             struct ecore_ptt *p_ptt)
+{
+       enum _ecore_status_t rc;
+
+       if (ecore_edpm_enabled(p_hwfn)) {
+               rc = ecore_db_rec_flush_queue(p_hwfn, p_ptt);
+               if (rc != ECORE_SUCCESS)
+                       return rc;
+       }
+
        /* flush any pedning (e)dpm as they may never arrive */
        ecore_wr(p_hwfn, p_ptt, DORQ_REG_DPM_FORCE_ABORT, 0x1);