mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
IB/rdmavt: Validate remote_addr during loopback atomic tests
commit4028bccb00upstream. The rdma-core test suite sends an unaligned remote address and expects a failure. ERROR: test_atomic_non_aligned_addr (tests.test_atomic.AtomicTest) The qib/hfi1 rc handling validates properly, but the test has the client and server on the same system. The loopback of these operations is a distinct code path. Fix by syntaxing the proposed remote address in the loopback code path. Fixes:1570346153("IB/{hfi1, qib, rdmavt}: Move ruc_loopback to rdmavt") Link: https://lore.kernel.org/r/1642584489-141005-1-git-send-email-mike.marciniszyn@cornelisnetworks.com Reviewed-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
75c610212b
commit
c7db20f5be
|
|
@ -3124,6 +3124,8 @@ void rvt_ruc_loopback(struct rvt_qp *sqp)
|
||||||
case IB_WR_ATOMIC_FETCH_AND_ADD:
|
case IB_WR_ATOMIC_FETCH_AND_ADD:
|
||||||
if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
|
if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
|
||||||
goto inv_err;
|
goto inv_err;
|
||||||
|
if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1)))
|
||||||
|
goto inv_err;
|
||||||
if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
|
if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
|
||||||
wqe->atomic_wr.remote_addr,
|
wqe->atomic_wr.remote_addr,
|
||||||
wqe->atomic_wr.rkey,
|
wqe->atomic_wr.rkey,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user