mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
RDMA/rxe: Compute PSN windows correctly
[ Upstream commitbb3ab2979f
] 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:8700e3e7c4
("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>
This commit is contained in:
parent
35f1856161
commit
0fd78ab5ef
1 changed files with 2 additions and 1 deletions
|
@ -664,7 +664,8 @@ int rxe_requester(void *arg)
|
|||
}
|
||||
|
||||
if (unlikely(qp_type(qp) == IB_QPT_RC &&
|
||||
qp->req.psn > (qp->comp.psn + RXE_MAX_UNACKED_PSNS))) {
|
||||
psn_compare(qp->req.psn, (qp->comp.psn +
|
||||
RXE_MAX_UNACKED_PSNS)) > 0)) {
|
||||
qp->req.wait_psn = 1;
|
||||
goto exit;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue