From: Jason Gunthorpe <jgg@nvidia.com>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: leonro@nvidia.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next 4/6] RDMA-rxe: Isolate mr code from atomic_write_reply()
Date: Fri, 9 Dec 2022 19:49:32 -0400 [thread overview]
Message-ID: <Y5PJjI6yuy3Pm/pw@nvidia.com> (raw)
In-Reply-To: <20221208210547.28562-5-rpearsonhpe@gmail.com>
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
next prev parent reply other threads:[~2022-12-09 23:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 21:05 [PATCH for-next 0/6] RDMA/rxe: Replace mr page map with an xarray Bob Pearson
2022-12-08 21:05 ` [PATCH for-next 1/6] RDMA/rxe: Cleanup mr_check_range Bob Pearson
2022-12-08 21:05 ` [PATCH for-next 2/6] RDMA/rxe: Move rxe_map_mr_sg to rxe_mr.c Bob Pearson
2022-12-08 21:05 ` [PATCH for-next 3/6] RDMA-rxe: Isolate mr code from atomic_reply() Bob Pearson
2022-12-08 21:05 ` [PATCH for-next 4/6] RDMA-rxe: Isolate mr code from atomic_write_reply() Bob Pearson
2022-12-09 23:49 ` Jason Gunthorpe [this message]
2022-12-08 21:05 ` [PATCH for-next 5/6] RDMA/rxe: Cleanup page variables in rxe_mr.c Bob Pearson
2022-12-08 21:05 ` [PATCH for-next 6/6] RDMA/rxe: Replace rxe_map and rxe_phys_buf by xarray Bob Pearson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5PJjI6yuy3Pm/pw@nvidia.com \
--to=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=rpearsonhpe@gmail.com \
--cc=zyjzyj2000@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).