u32 map_idx, u32 xid)
 {
        if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
-               if (BNXT_PF(bp))
-                       db->doorbell = bp->bar1 + DB_PF_OFFSET_P5;
-               else
-                       db->doorbell = bp->bar1 + DB_VF_OFFSET_P5;
                switch (ring_type) {
                case HWRM_RING_ALLOC_TX:
                        db->db_key64 = DBR_PATH_L2 | DBR_TYPE_SQ;
 
                if (bp->flags & BNXT_FLAG_CHIP_P7)
                        db->db_key64 |= DBR_VALID;
+
+               db->doorbell = bp->bar1 + bp->db_offset;
        } else {
                db->doorbell = bp->bar1 + map_idx * 0x80;
                switch (ring_type) {
 {
        struct hwrm_func_qcfg_output *resp;
        struct hwrm_func_qcfg_input *req;
-       u32 min_db_offset = 0;
        u16 flags;
        int rc;
 
        if (bp->db_size)
                goto func_qcfg_exit;
 
-       if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
+       bp->db_offset = le16_to_cpu(resp->legacy_l2_db_size_kb) * 1024;
+       if (BNXT_CHIP_P5(bp)) {
                if (BNXT_PF(bp))
-                       min_db_offset = DB_PF_OFFSET_P5;
+                       bp->db_offset = DB_PF_OFFSET_P5;
                else
-                       min_db_offset = DB_VF_OFFSET_P5;
+                       bp->db_offset = DB_VF_OFFSET_P5;
        }
        bp->db_size = PAGE_ALIGN(le16_to_cpu(resp->l2_doorbell_bar_size_kb) *
                                 1024);
        if (!bp->db_size || bp->db_size > pci_resource_len(bp->pdev, 2) ||
-           bp->db_size <= min_db_offset)
+           bp->db_size <= bp->db_offset)
                bp->db_size = pci_resource_len(bp->pdev, 2);
 
 func_qcfg_exit:
 
        for (i = 0; i < num_msix; i++) {
                ent[i].vector = bp->irq_tbl[idx + i].vector;
                ent[i].ring_idx = idx + i;
-               if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
-                       ent[i].db_offset = DB_PF_OFFSET_P5;
-                       if (BNXT_VF(bp))
-                               ent[i].db_offset = DB_VF_OFFSET_P5;
-               } else {
+               if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
+                       ent[i].db_offset = bp->db_offset;
+               else
                        ent[i].db_offset = (idx + i) * 0x80;
-               }
        }
 }
 
        edev->pdev = bp->pdev;
        edev->l2_db_size = bp->db_size;
        edev->l2_db_size_nc = bp->db_size;
+       edev->l2_db_offset = bp->db_offset;
 
        if (bp->flags & BNXT_FLAG_ROCEV1_CAP)
                edev->flags |= BNXT_EN_FLAG_ROCEV1_CAP;