net/qede/base: interchangeably use SB between PF and VF
[dpdk.git] / drivers / net / qede / base / ecore_vf.c
index e4e2517..0a26141 100644 (file)
@@ -652,8 +652,8 @@ ecore_vf_pf_rxq_start(struct ecore_hwfn *p_hwfn,
        req->cqe_pbl_addr = cqe_pbl_addr;
        req->cqe_pbl_size = cqe_pbl_size;
        req->rxq_addr = bd_chain_phys_addr;
-       req->hw_sb = p_cid->rel.sb;
-       req->sb_index = p_cid->rel.sb_idx;
+       req->hw_sb = p_cid->sb_igu_id;
+       req->sb_index = p_cid->sb_idx;
        req->bd_max_bytes = bd_max_bytes;
        req->stat_id = -1; /* Keep initialized, for future compatibility */
 
@@ -774,8 +774,8 @@ ecore_vf_pf_txq_start(struct ecore_hwfn *p_hwfn,
        /* Tx */
        req->pbl_addr = pbl_addr;
        req->pbl_size = pbl_size;
-       req->hw_sb = p_cid->rel.sb;
-       req->sb_index = p_cid->rel.sb_idx;
+       req->hw_sb = p_cid->sb_igu_id;
+       req->sb_index = p_cid->sb_idx;
 
        ecore_vf_pf_add_qid(p_hwfn, p_cid);
 
@@ -930,9 +930,12 @@ ecore_vf_pf_vport_start(struct ecore_hwfn *p_hwfn, u8 vport_id,
        req->only_untagged = only_untagged;
 
        /* status blocks */
-       for (i = 0; i < p_hwfn->vf_iov_info->acquire_resp.resc.num_sbs; i++)
-               if (p_hwfn->sbs_info[i])
-                       req->sb_addr[i] = p_hwfn->sbs_info[i]->sb_phys;
+       for (i = 0; i < p_hwfn->vf_iov_info->acquire_resp.resc.num_sbs; i++) {
+               struct ecore_sb_info *p_sb = p_hwfn->vf_iov_info->sbs_info[i];
+
+               if (p_sb)
+                       req->sb_addr[i] = p_sb->sb_phys;
+       }
 
        /* add list termination tlv */
        ecore_add_tlv(p_hwfn, &p_iov->offset,
@@ -1501,6 +1504,24 @@ u16 ecore_vf_get_igu_sb_id(struct ecore_hwfn *p_hwfn,
        return p_iov->acquire_resp.resc.hw_sbs[sb_id].hw_sb_id;
 }
 
+void ecore_vf_set_sb_info(struct ecore_hwfn *p_hwfn,
+                         u16 sb_id, struct ecore_sb_info *p_sb)
+{
+       struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
+
+       if (!p_iov) {
+               DP_NOTICE(p_hwfn, true, "vf_sriov_info isn't initialized\n");
+               return;
+       }
+
+       if (sb_id >= PFVF_MAX_SBS_PER_VF) {
+               DP_NOTICE(p_hwfn, true, "Can't configure SB %04x\n", sb_id);
+               return;
+       }
+
+       p_iov->sbs_info[sb_id] = p_sb;
+}
+
 enum _ecore_status_t ecore_vf_read_bulletin(struct ecore_hwfn *p_hwfn,
                                            u8 *p_change)
 {