All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/rxe: Use correct ATOMIC Acknowledge opcode in BTH
@ 2022-07-05 15:57 Xiao Yang
  2022-07-06 11:48 ` yangx.jy
  2022-07-14 15:55 ` Bob Pearson
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Yang @ 2022-07-05 15:57 UTC (permalink / raw)
  To: linux-rdma; +Cc: leon, jgg, rpearsonhpe, zyjzyj2000, Xiao Yang

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);
 
-- 
2.34.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] RDMA/rxe: Use correct ATOMIC Acknowledge opcode in BTH
  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
  1 sibling, 0 replies; 3+ messages in thread
From: yangx.jy @ 2022-07-06 11:48 UTC (permalink / raw)
  To: linux-rdma; +Cc: leon, jgg, rpearsonhpe, zyjzyj2000

On 2022/7/5 23: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.

Hi,

Sorry, please ignore the wrong patch because it will lead to a kernel panic.

Best Regards,
Xiao Yang
> 
> 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);
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RDMA/rxe: Use correct ATOMIC Acknowledge opcode in BTH
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Bob Pearson @ 2022-07-14 15:55 UTC (permalink / raw)
  To: Xiao Yang, linux-rdma; +Cc: leon, jgg, zyjzyj2000

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-14 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.