Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Honggang LI <honggangli@163.com>
Cc: zyjzyj2000@gmail.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	dledford@redhat.com, kamalh@mellanox.com, amirv@mellanox.com,
	monis@mellanox.com, haggaie@mellanox.com
Subject: Re: [PATCH] RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs
Date: Mon, 24 Jun 2024 17:18:05 +0300	[thread overview]
Message-ID: <20240624141805.GI29266@unreal> (raw)
In-Reply-To: <20240624020348.494338-1-honggangli@163.com>

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
> 

  parent reply	other threads:[~2024-06-24 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-06-24 14:18 ` 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=20240624141805.GI29266@unreal \
    --to=leon@kernel.org \
    --cc=amirv@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=haggaie@mellanox.com \
    --cc=honggangli@163.com \
    --cc=jgg@ziepe.ca \
    --cc=kamalh@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=monis@mellanox.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