IB/hfi1: Update RMT size calculation
authorDean Luick <dean.luick@cornelisnetworks.com>
Mon, 9 Jan 2023 19:04:29 +0000 (14:04 -0500)
committerLeon Romanovsky <leon@kernel.org>
Tue, 10 Jan 2023 17:09:49 +0000 (19:09 +0200)
commit892ede5a77f337831609fb9c248ac60948061894
tree5251876acdafa33b03e8e4584cd94d1c6c2bd500
parentef90f0a1913e8b60101c374010847615172a77d1
IB/hfi1: Update RMT size calculation

Fix possible RMT overflow:  Use the correct netdev size.
Don't allow adjusted user contexts to go negative.

Fix QOS calculation: Send kernel context count as an argument since
dd->n_krcv_queues is not yet set up in earliest call.  Do not include
the control context in the QOS calculation.  Use the same sized
variable to find the max of krcvq[] entries.

Update the RMT count explanation to make more sense.

Signed-off-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Link: https://lore.kernel.org/r/167329106946.1472990.18385495251650939054.stgit@awfm-02.cornelisnetworks.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hfi1/chip.c