net/qede/base: check for EDPM enabled in DB recovery
[dpdk.git] / drivers / net / qede / base / ecore.h
index c8e6311..4607a80 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_H
@@ -29,8 +27,8 @@
 #include "mcp_public.h"
 
 #define ECORE_MAJOR_VERSION            8
-#define ECORE_MINOR_VERSION            30
-#define ECORE_REVISION_VERSION         8
+#define ECORE_MINOR_VERSION            37
+#define ECORE_REVISION_VERSION         20
 #define ECORE_ENGINEERING_VERSION      0
 
 #define ECORE_VERSION                                                  \
@@ -41,6 +39,9 @@
        ((FW_MAJOR_VERSION << 24) | (FW_MINOR_VERSION << 16) |  \
         (FW_REVISION_VERSION << 8) | FW_ENGINEERING_VERSION)
 
+#define IS_ECORE_PACING(p_hwfn)        \
+       (!!(p_hwfn->b_en_pacing))
+
 #define MAX_HWFNS_PER_DEVICE   2
 #define NAME_SIZE 128 /* @DPDK */
 #define ECORE_WFQ_UNIT 100
@@ -659,6 +660,7 @@ struct ecore_hwfn {
 #endif
 
        struct dbg_tools_data           dbg_info;
+       void                            *dbg_user_info;
 
        struct z_stream_s               *stream;
 
@@ -680,6 +682,13 @@ struct ecore_hwfn {
        /* Mechanism for recovering from doorbell drop */
        struct ecore_db_recovery_info   db_recovery_info;
 
+       /* Enable/disable pacing, if request to enable then
+        * IOV and mcos configuration will be skipped.
+        * this actually reflects the value requested in
+        * struct ecore_hw_prepare_params by ecore client.
+        */
+       bool b_en_pacing;
+
        /* @DPDK */
        struct ecore_ptt                *p_arfs_ptt;
 };
@@ -862,6 +871,9 @@ struct ecore_dev {
        bool                            b_is_emul_full;
 #endif
 
+       /* Indicates whether this PF serves a storage target */
+       bool                            b_is_target;
+
 #ifdef CONFIG_ECORE_BINARY_FW /* @DPDK */
        void                            *firmware;
        u64                             fw_len;
@@ -932,12 +944,16 @@ void ecore_set_fw_mac_addr(__le16 *fw_msb, __le16 *fw_mid, __le16 *fw_lsb,
 #define PQ_FLAGS_ACK   (1 << 4)
 #define PQ_FLAGS_OFLD  (1 << 5)
 #define PQ_FLAGS_VFS   (1 << 6)
+#define PQ_FLAGS_LLT   (1 << 7)
 
 /* physical queue index for cm context intialization */
 u16 ecore_get_cm_pq_idx(struct ecore_hwfn *p_hwfn, u32 pq_flags);
 u16 ecore_get_cm_pq_idx_mcos(struct ecore_hwfn *p_hwfn, u8 tc);
 u16 ecore_get_cm_pq_idx_vf(struct ecore_hwfn *p_hwfn, u16 vf);
-u16 ecore_get_cm_pq_idx_rl(struct ecore_hwfn *p_hwfn, u8 qpid);
+u16 ecore_get_cm_pq_idx_rl(struct ecore_hwfn *p_hwfn, u16 rl);
+
+/* qm vport for rate limit configuration */
+u16 ecore_get_qm_vport_idx_rl(struct ecore_hwfn *p_hwfn, u16 rl);
 
 const char *ecore_hw_get_resc_name(enum ecore_resources res_id);
 
@@ -946,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);