summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelvin Xavier <selvin.xavier@broadcom.com>2023-12-19 15:11:40 +0300
committerLeon Romanovsky <leon@kernel.org>2023-12-20 10:45:45 +0300
commit9248f363d0791a548a9c7711365b8be4c70bd375 (patch)
tree4a350552c06eb3137c9222fa0e8d963436a7ee55
parente275919d96693c5ca964b20d73a33d52a7e57f04 (diff)
downloadlinux-9248f363d0791a548a9c7711365b8be4c70bd375.tar.xz
RDMA/bnxt_re: Fix the offset for GenP7 adapters for user applications
User Doorbell page indexes start at an offset for GenP7 adapters. Fix the offset that will be used for user doorbell page indexes. Fixes: a62d68581441 ("RDMA/bnxt_re: Update the BAR offsets") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Link: https://lore.kernel.org/r/1702987900-5363-1-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r--drivers/infiniband/hw/bnxt_re/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
index eb03ebad2e5a..f022c922fae5 100644
--- a/drivers/infiniband/hw/bnxt_re/main.c
+++ b/drivers/infiniband/hw/bnxt_re/main.c
@@ -108,12 +108,14 @@ static void bnxt_re_set_db_offset(struct bnxt_re_dev *rdev)
dev_info(rdev_to_dev(rdev),
"Couldn't get DB bar size, Low latency framework is disabled\n");
/* set register offsets for both UC and WC */
- if (bnxt_qplib_is_chip_gen_p7(cctx))
+ if (bnxt_qplib_is_chip_gen_p7(cctx)) {
res->dpi_tbl.ucreg.offset = offset;
- else
+ res->dpi_tbl.wcreg.offset = en_dev->l2_db_size;
+ } else {
res->dpi_tbl.ucreg.offset = res->is_vf ? BNXT_QPLIB_DBR_VF_DB_OFFSET :
BNXT_QPLIB_DBR_PF_DB_OFFSET;
- res->dpi_tbl.wcreg.offset = res->dpi_tbl.ucreg.offset;
+ res->dpi_tbl.wcreg.offset = res->dpi_tbl.ucreg.offset;
+ }
/* If WC mapping is disabled by L2 driver then en_dev->l2_db_size
* is equal to the DB-Bar actual size. This indicates that L2