Skip to content

Commit 4028bcc

Browse files
Mike Marciniszynjgunthorpe
authored andcommitted
IB/rdmavt: Validate remote_addr during loopback atomic tests
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: 1570346 ("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>
1 parent b856101 commit 4028bcc

File tree

1 file changed

+2
-0
lines changed
  • drivers/infiniband/sw/rdmavt

1 file changed

+2
-0
lines changed

drivers/infiniband/sw/rdmavt/qp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,6 +3073,8 @@ void rvt_ruc_loopback(struct rvt_qp *sqp)
30733073
case IB_WR_ATOMIC_FETCH_AND_ADD:
30743074
if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
30753075
goto inv_err;
3076+
if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1)))
3077+
goto inv_err;
30763078
if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
30773079
wqe->atomic_wr.remote_addr,
30783080
wqe->atomic_wr.rkey,

0 commit comments

Comments
 (0)