Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Xiao Yang <yangx.jy@fujitsu.com>, linux-rdma@vger.kernel.org
Cc: leon@kernel.org, jgg@ziepe.ca, zyjzyj2000@gmail.com
Subject: Re: [PATCH] RDMA/rxe: Use correct ATOMIC Acknowledge opcode in BTH
Date: Thu, 14 Jul 2022 10:55:19 -0500	[thread overview]
Message-ID: <d9790ed0-266e-d2a1-9968-d83ca0a43f65@gmail.com> (raw)
In-Reply-To: <20220705155705.21094-1-yangx.jy@fujitsu.com>

On 7/5/22 10:57, Xiao Yang wrote:
> When responder processed an Atomic requeset and got a NAK,
> the opcode field in BTH should be ATOMIC Acknowledge instead
> of Acknowledge.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_resp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
> index 265e46fe050f..592d73c37d48 100644
> --- a/drivers/infiniband/sw/rxe/rxe_resp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_resp.c
> @@ -1080,10 +1080,10 @@ static enum resp_states acknowledge(struct rxe_qp *qp,
>  	if (qp_type(qp) != IB_QPT_RC)
>  		return RESPST_CLEANUP;
>  
> -	if (qp->resp.aeth_syndrome != AETH_ACK_UNLIMITED)
> +	if (pkt->mask & RXE_ATOMIC_MASK)
> +		send_atomic_ack(qp, qp->resp.aeth_syndrome, pkt->psn);
> +	else if (qp->resp.aeth_syndrome != AETH_ACK_UNLIMITED)
>  		send_ack(qp, qp->resp.aeth_syndrome, pkt->psn);
> -	else if (pkt->mask & RXE_ATOMIC_MASK)
> -		send_atomic_ack(qp, AETH_ACK_UNLIMITED, pkt->psn);
>  	else if (bth_ack(pkt))
>  		send_ack(qp, AETH_ACK_UNLIMITED, pkt->psn);
>  

Xaio,

Just saw this. The difference between the two opcodes tells if there is an 
AtomicAckETH present. If the operation fails there is no data to send back
so there is only an AETH in the reply packet and Acknowledge is the correct
opcode. When the packet is parsed if you use AtomicAcknowledge for a failed
atomic operation you will get the wrong offsets when you lookup the header
offsets in rxe_opcode[] which not surprisingly leads to problems.

Bob

      parent reply	other threads:[~2022-07-14 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 15:57 [PATCH] RDMA/rxe: Use correct ATOMIC Acknowledge opcode in BTH Xiao Yang
2022-07-06 11:48 ` yangx.jy
2022-07-14 15:55 ` Bob Pearson [this message]

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=d9790ed0-266e-d2a1-9968-d83ca0a43f65@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yangx.jy@fujitsu.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