Skip to content

Commit 8be3e5b

Browse files
selvintxavierjgunthorpe
authored andcommitted
RDMA/bnxt_re: Avoid CPU lockups due fifo occupancy check loop
Driver waits indefinitely for the fifo occupancy to go below a threshold as soon as the pacing interrupt is received. This can cause soft lockup on one of the processors, if the rate of DB is very high. Add a loop count for FPGA and exit the __wait_for_fifo_occupancy_below_th if the loop is taking more time. Pacing will be continuing until the occupancy is below the threshold. This is ensured by the checks in bnxt_re_pacing_timer_exp and further scheduling the work for pacing based on the fifo occupancy. Fixes: 2ad4e63 ("RDMA/bnxt_re: Implement doorbell pacing algorithm") Link: https://patch.msgid.link/r/[email protected] Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Chandramohan Akula <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 0ba9294 commit 8be3e5b

File tree

1 file changed

+9
-0
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+9
-0
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ static bool is_dbr_fifo_full(struct bnxt_re_dev *rdev)
534534
static void __wait_for_fifo_occupancy_below_th(struct bnxt_re_dev *rdev)
535535
{
536536
struct bnxt_qplib_db_pacing_data *pacing_data = rdev->qplib_res.pacing_data;
537+
u32 retry_fifo_check = 1000;
537538
u32 fifo_occup;
538539

539540
/* loop shouldn't run infintely as the occupancy usually goes
@@ -547,6 +548,14 @@ static void __wait_for_fifo_occupancy_below_th(struct bnxt_re_dev *rdev)
547548

548549
if (fifo_occup < pacing_data->pacing_th)
549550
break;
551+
if (!retry_fifo_check--) {
552+
dev_info_once(rdev_to_dev(rdev),
553+
"%s: fifo_occup = 0x%xfifo_max_depth = 0x%x pacing_th = 0x%x\n",
554+
__func__, fifo_occup, pacing_data->fifo_max_depth,
555+
pacing_data->pacing_th);
556+
break;
557+
}
558+
550559
}
551560
}
552561

0 commit comments

Comments
 (0)