All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: jgg@nvidia.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org,
	Bob Pearson <rpearson@hpe.com>
Subject: Re: [PATCH for-next] RDMA/rxe fixed bug in rxe_requester
Date: Thu, 29 Oct 2020 11:27:54 +0200	[thread overview]
Message-ID: <20201029092754.GE114054@unreal> (raw)
In-Reply-To: <20201013170741.3590-1-rpearson@hpe.com>

On Tue, Oct 13, 2020 at 12:07:42PM -0500, Bob Pearson wrote:
> The code which limited the number of unacknowledged PSNs was incorrect.
> The PSNs are limited to 24 bits and wrap back to zero from 0x00ffffff.
> The test was computing a 32 bit value which wraps at 32 bits so that
> qp->req.psn can appear smaller than the limit when it is actually larger.
>
> Replace '>' test with psn_compare which is used for other PSN comparisons
> and correctly handles the 24 bit size.
>
> Fixes: 8700e3e7c485 ("Soft RoCE (RXE) - The software RoCE driver")
> Signed-off-by: Bob Pearson <rpearson@hpe.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_req.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
> index af3923bf0a36..d4917646641a 100644
> --- a/drivers/infiniband/sw/rxe/rxe_req.c
> +++ b/drivers/infiniband/sw/rxe/rxe_req.c
> @@ -634,7 +634,8 @@ int rxe_requester(void *arg)
>  	}
>
>  	if (unlikely(qp_type(qp) == IB_QPT_RC &&
> -		     qp->req.psn > (qp->comp.psn + RXE_MAX_UNACKED_PSNS))) {
> +		psn_compare(qp->req.psn, (qp->comp.psn +
> +				RXE_MAX_UNACKED_PSNS)) > 0)) {

qp->comp.psn is u32, so you are checking that
qp->comp.psn + RXE_MAX_UNACKED_PSNS != 0, am I right?

>  		qp->req.wait_psn = 1;
>  		goto exit;
>  	}
> --
> 2.25.1
>

  parent reply	other threads:[~2020-10-29  9:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 17:07 [PATCH for-next] RDMA/rxe fixed bug in rxe_requester Bob Pearson
2020-10-28 13:36 ` Jason Gunthorpe
2020-10-29  9:27 ` Leon Romanovsky [this message]
2020-10-29 17:09   ` Bob Pearson
2020-11-01  6:17     ` Leon Romanovsky

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=20201029092754.GE114054@unreal \
    --to=leon@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearson@hpe.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.