net/qede/base: support periodic Doorbell Recovery
[dpdk.git] / drivers / net / qede / base / ecore_int_api.h
index 49d0fac..5b9c31d 100644 (file)
@@ -1,9 +1,7 @@
-/*
- * Copyright (c) 2016 QLogic Corporation.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016 - 2018 Cavium Inc.
  * All rights reserved.
- * www.qlogic.com
- *
- * See LICENSE.qede_pmd for copyright and licensing details.
+ * www.cavium.com
  */
 
 #ifndef __ECORE_INT_API_H__
@@ -26,7 +24,7 @@ enum ecore_int_mode {
 #endif
 
 struct ecore_sb_info {
-       struct status_block *sb_virt;
+       struct status_block_e4 *sb_virt;
        dma_addr_t sb_phys;
        u32 sb_ack;             /* Last given ack */
        u16 igu_sb_id;
@@ -44,7 +42,7 @@ struct ecore_sb_info {
 struct ecore_sb_info_dbg {
        u32 igu_prod;
        u32 igu_cons;
-       u16 pi[PIS_PER_SB];
+       u16 pi[PIS_PER_SB_E4];
 };
 
 struct ecore_sb_cnt_info {
@@ -67,7 +65,7 @@ static OSAL_INLINE u16 ecore_sb_update_sb_idx(struct ecore_sb_info *sb_info)
        /* barrier(); status block is written to by the chip */
        /* FIXME: need some sort of barrier. */
        prod = OSAL_LE32_TO_CPU(sb_info->sb_virt->prod_index) &
-           STATUS_BLOCK_PROD_INDEX_MASK;
+           STATUS_BLOCK_E4_PROD_INDEX_MASK;
        if (sb_info->sb_ack != prod) {
                sb_info->sb_ack = prod;
                rc |= ECORE_SB_IDX;
@@ -345,4 +343,15 @@ enum _ecore_status_t ecore_int_get_sb_dbg(struct ecore_hwfn *p_hwfn,
 enum _ecore_status_t
 ecore_int_igu_relocate_sb(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
                          u16 sb_id, bool b_to_vf);
+
+/**
+ * @brief - Doorbell Recovery handler.
+ *          Run DB_REAL_DEAL doorbell recovery in case of PF overflow
+ *          (and flush DORQ if needed), otherwise run DB_REC_ONCE.
+ *
+ * @param p_hwfn
+ * @param p_ptt
+ */
+enum _ecore_status_t ecore_db_rec_handler(struct ecore_hwfn *p_hwfn,
+                                         struct ecore_ptt *p_ptt);
 #endif