From 3abdab61fc00a38f197e719f5405150d58827044 Mon Sep 17 00:00:00 2001 From: Selvin Xavier Date: Tue, 25 Jun 2024 11:48:53 -0700 Subject: [PATCH] bnxt_re/lib: Fix doorbell fifo register read [ Upstream commit 370f01e21a2bdd6df6a8ed5301aefd8269808df5 ] Doorbell FIFO information register is a 32 bit register. Reading it as a 64bit from the BAR area may give wrong values. So change the variable pointer to 32 bit. Fixes: ef9d1cd30a27 ("bnxt_re/lib: Implement doorbell pacing algorithm") Signed-off-by: Selvin Xavier Signed-off-by: Nicolas Morey --- providers/bnxt_re/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/bnxt_re/db.c b/providers/bnxt_re/db.c index 4f50d8de7..41cdce70a 100644 --- a/providers/bnxt_re/db.c +++ b/providers/bnxt_re/db.c @@ -54,7 +54,7 @@ static int calculate_fifo_occupancy(struct bnxt_re_context *cntx) struct bnxt_re_dev *rdev = cntx->rdev; uint32_t read_val, fifo_occup; uint64_t fifo_reg_off; - uint64_t *dbr_map; + uint32_t *dbr_map; fifo_reg_off = pacing_data->grc_reg_offset & ~(BNXT_RE_PAGE_MASK(rdev->pg_size)); dbr_map = cntx->bar_map + fifo_reg_off;