linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: mike.marciniszyn@cornelisnetworks.com
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-rc] IB/rdmavt: Validate remote_addr during loopback atomic tests
Date: Sun, 23 Jan 2022 12:34:36 +0200	[thread overview]
Message-ID: <Ye0vPMAF6NdF0pMu@unreal> (raw)
In-Reply-To: <1642584489-141005-1-git-send-email-mike.marciniszyn@cornelisnetworks.com>

On Wed, Jan 19, 2022 at 04:28:09AM -0500, mike.marciniszyn@cornelisnetworks.com wrote:
> From: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
> 
> 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: 15703461533a ("IB/{hfi1, qib, rdmavt}: Move ruc_loopback to rdmavt")
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
> ---
>  drivers/infiniband/sw/rdmavt/qp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
> index 3305f27..ae50b56 100644
> --- a/drivers/infiniband/sw/rdmavt/qp.c
> +++ b/drivers/infiniband/sw/rdmavt/qp.c
> @@ -3073,6 +3073,8 @@ void rvt_ruc_loopback(struct rvt_qp *sqp)
>  	case IB_WR_ATOMIC_FETCH_AND_ADD:
>  		if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
>  			goto inv_err;
> +		if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1)))

Isn't this "!PAGE_ALIGNED(wqe->atomic_wr.remote_addr)" check?

Thanks

> +			goto inv_err;
>  		if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
>  					  wqe->atomic_wr.remote_addr,
>  					  wqe->atomic_wr.rkey,
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2022-01-23 10:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  9:28 [PATCH for-rc] IB/rdmavt: Validate remote_addr during loopback atomic tests mike.marciniszyn
2022-01-23 10:34 ` Leon Romanovsky [this message]
2022-01-24 12:25   ` Haakon Bugge
2022-01-24 12:33     ` Leon Romanovsky
2022-01-24 12:43       ` Haakon Bugge
2022-01-24 13:20         ` Marciniszyn, Mike
2022-01-25  7:34           ` Leon Romanovsky
2022-01-28 16:51 ` Jason Gunthorpe

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=Ye0vPMAF6NdF0pMu@unreal \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@cornelisnetworks.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).