]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/rxe: Compute PSN windows correctly
authorBob Pearson <rpearsonhpe@gmail.com>
Tue, 13 Oct 2020 17:07:42 +0000 (12:07 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:46:51 +0000 (13:46 +0100)
commit1100b71de7e5ebe01a73b7a162666568839b10fa
treeddfe7788aba36021db6f605e5e923a3d396bf5d1
parentce7acf72db8c4dbf7e9e9aa942ab26342a60ab7c
RDMA/rxe: Compute PSN windows correctly

[ Upstream commit bb3ab2979fd69db23328691cb10067861df89037 ]

The code which limited the number of unacknowledged PSNs was incorrect.
The PSNs are limited to 24 bits and wrap back to zero from 0x00ffffff.
The test was computing a 32 bit value which wraps at 32 bits so that
qp->req.psn can appear smaller than the limit when it is actually larger.

Replace '>' test with psn_compare which is used for other PSN comparisons
and correctly handles the 24 bit size.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20201013170741.3590-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearson@hpe.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/sw/rxe/rxe_req.c