Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Chengguang Xu <cgxu519@mykernel.net>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: Question about AETH_NAK_PSN_SEQ_ERROR
Date: Sat, 14 May 2022 11:22:36 -0500	[thread overview]
Message-ID: <64bb14e5-2511-e78f-8618-d1877cc856bb@gmail.com> (raw)
In-Reply-To: <7f51a1c8-757f-21c2-cf8d-fd91b5e26563@mykernel.net>

On 5/14/22 09:20, Chengguang Xu wrote:
> 
> 在 2022/5/14 21:35, Chengguang Xu 写道:
>> Hello Folks,
>>
>>
>> There is a logic(below code) in check_ack() in rxe_comp.c,  the case (AETH_NAK_PSN_SEQ_ERROR)
>> indicates sending side received a nak ack which means opposite side had an psn seq error(expected psn < received psn).
>> I don't fully understand the comment(/* a nak implicitly acks all packets with psns before */) here,
>> could someone give me a hint for this?

For a start go to

https://www.infinibandta.org/ibta-specification/

and follow the directions to get access to the InfiniBand Architecture Specification Vol. 1. It should be
free but you have to provide contact information. Unless your company is a member of the IBTA.

If you already have access then look at IBA 9.7.5.1.2 Coalesced Acknowledge Messages.

Any response carrying a packet sequence number implicitly acks all request packets with
a PSN smaller than the one carried in the response packet. It may ack or nak the request packet
with the same psn.

> 
> Carefully checking rxe_resp.c and found the psn in the ack (with AETH_NAK_PSN_SEQ_ERROR) is resp.psn not received pkt->psn.  :-)
> 
resp.psn will carry the correct response psn for the current response packet. This will be the same
as the psn of the req packet for send/write, and atomic requests but will be one of the range
of psns of a read request response. I.e. if the mtu is 4K and the read is 1MB there will be
256 read response packets to reply to the read request with psns starting at the psn of the
request and increasing by 1 until the message is done. The next request packet must leave a gap of
255 psns.
> 
> 
>>
>> Also, set qp->comp.psn as pkt->psn will skip some psns(from qp->comp.psn to pkt->psn) in the retry, is it correct?
>>
>> Many thanks in advance!
>> Chengguang
>>
>> -------------------------
>>
>>   case AETH_NAK:
>>             switch (syn) {
>>             case AETH_NAK_PSN_SEQ_ERROR:
>>                 /* a nak implicitly acks all packets with psns
>>                  * before
>>                  */
>>                 if (psn_compare(pkt->psn, qp->comp.psn) > 0) {
>>                     rxe_counter_inc(rxe,
>>                             RXE_CNT_RCV_SEQ_ERR);
>>                     qp->comp.psn = pkt->psn;
>>                     if (qp->req.wait_psn) {
>>                         qp->req.wait_psn = 0;
>>                         rxe_run_task(&qp->req.task, 0);
>>                     }
>>                 }
>>                 return COMPST_ERROR_RETRY;
>>
>>
>>
> 
> 


  reply	other threads:[~2022-05-14 16:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-14 13:35 Question about AETH_NAK_PSN_SEQ_ERROR Chengguang Xu
2022-05-14 14:20 ` Chengguang Xu
2022-05-14 16:22   ` Bob Pearson [this message]
2022-05-17  5:12     ` Chengguang Xu

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=64bb14e5-2511-e78f-8618-d1877cc856bb@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=cgxu519@mykernel.net \
    --cc=linux-rdma@vger.kernel.org \
    /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