]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/bnxt_re: Fix the qp table indexing
authorSelvin Xavier <selvin.xavier@broadcom.com>
Mon, 24 Aug 2020 18:14:33 +0000 (11:14 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 27 Aug 2020 12:30:43 +0000 (09:30 -0300)
commit127fd0fcb05173bfc7978b5f267293bc9c57f3da
tree5952f9ba5857a96c60311908a493dacc9b2b5893
parentc09fa02d5e9075a1c44b23082b569e6746247087
RDMA/bnxt_re: Fix the qp table indexing

qp->id can be a value outside the max number of qp. Indexing the qp table
with the id can cause out of bounds crash. So changing the qp table
indexing by (qp->id % max_qp -1).

Allocating one extra entry for QP1. Some adapters create one more than the
max_qp requested to accommodate QP1.  If the qp->id is 1, store the
inforamtion in the last entry of the qp table.

Fixes: 791dd769617e ("RDMA/bnxt_re: Allow posting when QPs are in error")
Link: https://lore.kernel.org/r/1598292876-26529-4-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/qplib_fp.c
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h