net/qede/base: move code bits
[dpdk.git] / drivers / net / qede / base / ecore_cxt.c
index b73a6ac..aeeabf1 100644 (file)
@@ -276,14 +276,24 @@ struct ecore_tm_iids {
 static OSAL_INLINE void ecore_cxt_tm_iids(struct ecore_cxt_mngr *p_mngr,
                                          struct ecore_tm_iids *iids)
 {
+       bool tm_vf_required = false;
+       bool tm_required = false;
        u32 i, j;
 
        for (i = 0; i < MAX_CONN_TYPES; i++) {
                struct ecore_conn_type_cfg *p_cfg = &p_mngr->conn_cfg[i];
 
-               if (tm_cid_proto(i)) {
+               if (tm_cid_proto(i) || tm_required) {
+                       if (p_cfg->cid_count)
+                               tm_required = true;
+
                        iids->pf_cids += p_cfg->cid_count;
-                       iids->per_vf_cids += p_cfg->cids_per_vf;
+               }
+
+               if (tm_cid_proto(i) || tm_vf_required) {
+                       if (p_cfg->cids_per_vf)
+                               tm_vf_required = true;
+
                }
 
                if (tm_tid_proto(i)) {
@@ -718,12 +728,11 @@ enum _ecore_status_t ecore_cxt_cfg_ilt_compute(struct ecore_hwfn *p_hwfn)
                ecore_ilt_cli_adv_line(p_hwfn, p_cli, p_blk, &curr_line,
                                       ILT_CLI_TM);
 
+               p_cli->vf_total_lines = curr_line - p_blk->start_line;
                for (i = 1; i < p_mngr->vf_count; i++) {
                        ecore_ilt_cli_adv_line(p_hwfn, p_cli, p_blk, &curr_line,
                                               ILT_CLI_TM);
                }
-
-               p_cli->vf_total_lines = curr_line - p_blk->start_line;
        }
 
        /* TSDM (SRQ CONTEXT) */
@@ -1363,18 +1372,10 @@ void ecore_qm_init_pf(struct ecore_hwfn *p_hwfn)
 }
 
 /* CM PF */
-static enum _ecore_status_t ecore_cm_init_pf(struct ecore_hwfn *p_hwfn)
+void ecore_cm_init_pf(struct ecore_hwfn *p_hwfn)
 {
-       union ecore_qm_pq_params pq_params;
-       u16 pq;
-
-       /* XCM pure-LB queue */
-       OSAL_MEMSET(&pq_params, 0, sizeof(pq_params));
-       pq_params.core.tc = LB_TC;
-       pq = ecore_get_qm_pq(p_hwfn, PROTOCOLID_CORE, &pq_params);
-       STORE_RT_REG(p_hwfn, XCM_REG_CON_PHY_Q3_RT_OFFSET, pq);
-
-       return ECORE_SUCCESS;
+       STORE_RT_REG(p_hwfn, XCM_REG_CON_PHY_Q3_RT_OFFSET,
+                    ecore_get_cm_pq_idx(p_hwfn, PQ_FLAGS_LB));
 }
 
 /* DQ PF */