Skip to content

Commit

Permalink
bnxt_re/lib: Fix doorbell fifo register read
Browse files Browse the repository at this point in the history
[ Upstream commit 370f01e ]

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: ef9d1cd ("bnxt_re/lib: Implement doorbell pacing algorithm")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
  • Loading branch information
selvintxavier authored and nmorey committed Jul 8, 2024
1 parent d628cea commit 3abdab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion providers/bnxt_re/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3abdab6

Please sign in to comment.