On Thu, Dec 08, 2022 at 03:05:46PM -0600, Bob Pearson wrote: > diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c > index ec3c8e6e8318..c6aa86d28b89 100644 > --- a/drivers/infiniband/sw/rxe/rxe_mr.c > +++ b/drivers/infiniband/sw/rxe/rxe_mr.c > @@ -495,7 +495,7 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode, > /* needs to match rxe_resp.c */ > if (mr->state != RXE_MR_STATE_VALID || !vaddr) > return -EFAULT; > - if (vaddr & 7) > + if ((uintptr_t)vaddr & 7) > return -EINVAL; ?? > @@ -668,22 +668,15 @@ static enum resp_states atomic_write_reply(struct rxe_qp *qp, > > if (!res->replay) { > #ifdef CONFIG_64BIT > - if (mr->state != RXE_MR_STATE_VALID) > - return RESPST_ERR_RKEY_VIOLATION; > - > - memcpy(&src, payload_addr(pkt), payload); > + u64 iova = qp->resp.va + qp->resp.offset; > > - dst = iova_to_vaddr(mr, qp->resp.va + qp->resp.offset, payload); > - /* check vaddr is 8 bytes aligned. */ > - if (!dst || (uintptr_t)dst & 7) > + err = rxe_mr_do_atomic_write(mr, iova, addr); > + if (err == -1) > return RESPST_ERR_MISALIGNED_ATOMIC; > + else > + return RESPST_ERR_RKEY_VIOLATION; This doesn't look right?? Return on both else branches? Jason