Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs
@ 2024-06-24  2:03 Honggang LI
  2024-06-24 13:33 ` Zhu Yanjun
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Honggang LI @ 2024-06-24  2:03 UTC (permalink / raw)
  To: zyjzyj2000, jgg, leon, linux-rdma
  Cc: dledford, kamalh, amirv, monis, haggaie, honggangli

BTH_ACK_MASK bit is used to indicate that an acknowledge
(for this packet) should be scheduled by the responder.
Both UC and UD QPs are unacknowledged, so don't set
BTH_ACK_MASK for UC or UD QPs.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Honggang LI <honggangli@163.com>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index cd14c4c2dff9..ffd7ed712a02 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -445,8 +445,12 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
 	qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn :
 					 qp->attr.dest_qp_num;
 
-	ack_req = ((pkt->mask & RXE_END_MASK) ||
-		(qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
+	if (qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_UC)
+		ack_req = 0;
+	else {
+		ack_req = ((pkt->mask & RXE_END_MASK) ||
+			(qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
+	}
 	if (ack_req)
 		qp->req.noack_pkts = 0;
 
-- 
2.45.2


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

* Re: [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs
  2024-06-24  2:03 [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs Honggang LI
@ 2024-06-24 13:33 ` Zhu Yanjun
  2024-06-24 14:18 ` Leon Romanovsky
  2024-06-24 14:18 ` Leon Romanovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Zhu Yanjun @ 2024-06-24 13:33 UTC (permalink / raw)
  To: Honggang LI, zyjzyj2000, jgg, leon, linux-rdma
  Cc: dledford, kamalh, amirv, monis, haggaie

在 2024/6/24 10:03, Honggang LI 写道:
> BTH_ACK_MASK bit is used to indicate that an acknowledge
> (for this packet) should be scheduled by the responder.
> Both UC and UD QPs are unacknowledged, so don't set
> BTH_ACK_MASK for UC or UD QPs.

 From IBTA
"
o9-30: If a TCA responder implements Reliable Connection service, or if
a CA responder implements Reliable Datagram or XRC service, the 
responder shall behave as follows. A responder shall acknowledge each 
request packet received. A responder shall generate an explicit response
for each RDMA READ request received. A responder shall generate an
explicit response for each ATOMIC Request received. A responder shall
generate response packets in the PSN order in which the original request
packets were received, including RDMA READ responses.
"

This ack_req should be based on "Reliable Connection service".
As such, I am fine with this commit.

Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Thanks,
Zhu Yanjun

> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Honggang LI <honggangli@163.com>
> ---
>   drivers/infiniband/sw/rxe/rxe_req.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
> index cd14c4c2dff9..ffd7ed712a02 100644
> --- a/drivers/infiniband/sw/rxe/rxe_req.c
> +++ b/drivers/infiniband/sw/rxe/rxe_req.c
> @@ -445,8 +445,12 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
>   	qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn :
>   					 qp->attr.dest_qp_num;
>   
> -	ack_req = ((pkt->mask & RXE_END_MASK) ||
> -		(qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
> +	if (qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_UC)
> +		ack_req = 0;
> +	else {
> +		ack_req = ((pkt->mask & RXE_END_MASK) ||
> +			(qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
> +	}
>   	if (ack_req)
>   		qp->req.noack_pkts = 0;
>   


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

* Re: [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs
  2024-06-24  2:03 [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs Honggang LI
  2024-06-24 13:33 ` Zhu Yanjun
@ 2024-06-24 14:18 ` Leon Romanovsky
  2024-06-24 14:18 ` Leon Romanovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-06-24 14:18 UTC (permalink / raw)
  To: Honggang LI
  Cc: zyjzyj2000, jgg, linux-rdma, dledford, kamalh, amirv, monis,
	haggaie

On Mon, Jun 24, 2024 at 10:03:48AM +0800, Honggang LI wrote:
> BTH_ACK_MASK bit is used to indicate that an acknowledge
> (for this packet) should be scheduled by the responder.
> Both UC and UD QPs are unacknowledged, so don't set
> BTH_ACK_MASK for UC or UD QPs.
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Honggang LI <honggangli@163.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_req.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
> index cd14c4c2dff9..ffd7ed712a02 100644
> --- a/drivers/infiniband/sw/rxe/rxe_req.c
> +++ b/drivers/infiniband/sw/rxe/rxe_req.c
> @@ -445,8 +445,12 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
>  	qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn :
>  					 qp->attr.dest_qp_num;
>  
> -	ack_req = ((pkt->mask & RXE_END_MASK) ||
> -		(qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
> +	if (qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_UC)
> +		ack_req = 0;
> +	else {
> +		ack_req = ((pkt->mask & RXE_END_MASK) ||
> +			(qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
> +	}
>  	if (ack_req)
>  		qp->req.noack_pkts = 0;


Applied the patch with the following change:
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index ffd7ed712a02..479c07e6e4ed 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -424,7 +424,7 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
        int                     paylen;
        int                     solicited;
        u32                     qp_num;
-       int                     ack_req;
+       int                     ack_req = 0;

        /* length from start of bth to end of icrc */
        paylen = rxe_opcode[opcode].length + payload + pad + RXE_ICRC_SIZE;
@@ -445,12 +445,9 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
        qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn :
                                         qp->attr.dest_qp_num;

-       if (qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_UC)
-               ack_req = 0;
-       else {
+       if (qp_type(qp) != IB_QPT_UD && qp_type(qp) != IB_QPT_UC)
                ack_req = ((pkt->mask & RXE_END_MASK) ||
-                       (qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
-       }
+                          (qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK));
        if (ack_req)
                qp->req.noack_pkts = 0;



>  
> -- 
> 2.45.2
> 

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

* Re: [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs
  2024-06-24  2:03 [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs Honggang LI
  2024-06-24 13:33 ` Zhu Yanjun
  2024-06-24 14:18 ` Leon Romanovsky
@ 2024-06-24 14:18 ` Leon Romanovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-06-24 14:18 UTC (permalink / raw)
  To: zyjzyj2000, jgg, linux-rdma, Honggang LI
  Cc: dledford, kamalh, amirv, monis, haggaie


On Mon, 24 Jun 2024 10:03:48 +0800, Honggang LI wrote:
> BTH_ACK_MASK bit is used to indicate that an acknowledge
> (for this packet) should be scheduled by the responder.
> Both UC and UD QPs are unacknowledged, so don't set
> BTH_ACK_MASK for UC or UD QPs.
> 
> 

Applied, thanks!

[1/1] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs
      https://git.kernel.org/rdma/rdma/c/371c54bca36fb5

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


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

end of thread, other threads:[~2024-06-24 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24  2:03 [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs Honggang LI
2024-06-24 13:33 ` Zhu Yanjun
2024-06-24 14:18 ` Leon Romanovsky
2024-06-24 14:18 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox