From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C82D6C433FE for ; Sat, 14 May 2022 14:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232437AbiENOVW (ORCPT ); Sat, 14 May 2022 10:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233352AbiENOVI (ORCPT ); Sat, 14 May 2022 10:21:08 -0400 Received: from sender2-op-o12.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFF38F72 for ; Sat, 14 May 2022 07:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1652538062; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=Date:Date:MIME-Version:Subject:Subject:From:From:To:To:Message-ID:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=yJJ9zdW0XMMl72uPz2ouTv3OGeJR4TX/jmo1x2aYSac=; b=HaEbRrPXb319k76beF/lfocBYYAW2pTXWXOtv8kPqAjweUyIyo1x5kmt/AXLNGqn 8mCbvyuISoMTgELKc/kNOpgXNN2ZeHLi//qfThYhBjOOca4V00dgUh2hhTX8wVrPkc1 ECAYmCv6JyJVl1VvLAqZ67gRlHHC3XBzJmgADkJs= Received: from [192.168.255.10] (116.30.195.187 [116.30.195.187]) by mx.zoho.com.cn with SMTPS id 1652538060839473.4094830715509; Sat, 14 May 2022 22:21:00 +0800 (CST) Date: Sat, 14 May 2022 22:20:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: Question about AETH_NAK_PSN_SEQ_ERROR From: Chengguang Xu To: "linux-rdma@vger.kernel.org" Message-ID: <7f51a1c8-757f-21c2-cf8d-fd91b5e26563@mykernel.net> References: <2eeb36ab-0f4d-fc9a-44a6-9b6bfa2f7970@mykernel.net> In-Reply-To: <2eeb36ab-0f4d-fc9a-44a6-9b6bfa2f7970@mykernel.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org =E5=9C=A8 2022/5/14 21:35, Chengguang Xu =E5=86=99=E9=81=93: > Hello Folks, > > > There is a logic(below code) in check_ack() in rxe_comp.c,=C2=A0 the case= =20 > (AETH_NAK_PSN_SEQ_ERROR) > indicates sending side received a nak ack which means opposite side=20 > had an psn seq error(expected psn < received psn). > I don't fully understand the comment(/* a nak implicitly acks all=20 > packets with psns before */) here, > could someone give me a hint for this? Carefully checking rxe_resp.c and found the psn in the ack (with=20 AETH_NAK_PSN_SEQ_ERROR) is resp.psn not received pkt->psn.=C2=A0 :-) > > Also, set qp->comp.psn as pkt->psn will skip some psns(from=20 > qp->comp.psn to pkt->psn) in the retry, is it correct? > > Many thanks in advance! > Chengguang > > ------------------------- > > =C2=A0 case AETH_NAK: > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0switch (syn) { > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0case AETH_NAK_PS= N_SEQ_ERROR: > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0/* a nak implicitly acks all packets with psns > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=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