From patchwork Fri Nov 18 14:36:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 9436663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1E2BB60237 for ; Fri, 18 Nov 2016 14:47:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 180EE29908 for ; Fri, 18 Nov 2016 14:47:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CA0229910; Fri, 18 Nov 2016 14:47:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 972E929908 for ; Fri, 18 Nov 2016 14:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487AbcKROrK (ORCPT ); Fri, 18 Nov 2016 09:47:10 -0500 Received: from esa1.dell-outbound.iphmx.com ([68.232.153.90]:7666 "EHLO esa1.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbcKROrG (ORCPT ); Fri, 18 Nov 2016 09:47:06 -0500 X-Greylist: delayed 575 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Nov 2016 09:47:06 EST DomainKey-Signature: s=smtpout; d=dell.com; c=simple; q=dns; h=Received:Received:Received:X-DKIM:Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To: References:X-RSA-Classifications:X-Sentrion-Hostname; b=bOA1vQ3PM5Xnev7MBmmrQ6lsDSiR3mUg53/1pshxLMEUu4elBfMoKXof Fo7ib+iG/glQjCCKAsTljl8/Y12Q71Kruj13LuoNHclWPVtgQuoGD0rXz fKGEWTS7XemiakGKOuYX20lPGz/evteuN7TmFys4sZQINmdmGIxEQkaHZ o=; DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1479480426; x=1511016426; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ExyN/WncIG1gz9xxVe0M4OP69BgKzsfZKQfw0dB7drs=; b=tJQmmFUKeoOBHdg4VgewFe4J+jZ+Bxf+Yq5gmRKpn92ZEE6QU7+RgH+H 5MLBthcmDY413oWwN5D61btIf0QDFMAPUS8z1irZ2hiEZO6CpsbU6TqhU BA6WBkDrfga8m/fwtRxRe2qHMR4fU741nQj0K6pI7llcHLNFMnzE43uh0 4=; Received: from esa5.dell-outbound2.iphmx.com ([68.232.153.203]) by esa1.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2016 08:37:47 -0600 Received: from mailuogwhop.emc.com ([168.159.213.141]) by esa5.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Nov 2016 20:37:47 +0600 Received: from maildlpprd01.lss.emc.com (maildlpprd01.lss.emc.com [10.253.24.33]) by mailuogwprd04.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id uAIEbjxq025674 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 18 Nov 2016 09:37:45 -0500 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd04.lss.emc.com uAIEbjxq025674 Received: from mailapphubprd02.lss.emc.com (emcmail.lss.emc.com [10.253.24.52]) by maildlpprd01.lss.emc.com (RSA Interceptor); Fri, 18 Nov 2016 09:37:18 -0500 Received: from hopcyc-boyera-1.corp.emc.com (hopcyc-boyera-1.cec.lab.emc.com [10.244.91.191]) by mailapphubprd02.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id uAIEbBSs021870; Fri, 18 Nov 2016 09:37:24 -0500 From: Andrew Boyer To: monis@mellanox.com, linux-rdma@vger.kernel.org Cc: Andrew Boyer Subject: [PATCH 3/7] IB/rxe: Don't update the response PSN unless it's going forwards Date: Fri, 18 Nov 2016 09:36:45 -0500 Message-Id: <1479479809-10798-3-git-send-email-andrew.boyer@dell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1479479809-10798-1-git-send-email-andrew.boyer@dell.com> References: <1479479809-10798-1-git-send-email-andrew.boyer@dell.com> X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd04.lss.emc.com Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A client might post a read followed by a send. The partner receives and acknowledges both transactions, posting an RCQ entry for the send, but something goes wrong with the read ACK. When the client retries the read, the partner's responder processes the duplicate read but incorrectly resets the PSN to the value preceding the original send. When the duplicate send arrives, the responder cannot tell that it is a duplicate, so the responder generates a duplicate RCQ entry, confusing the client. Signed-off-by: Andrew Boyer Reviewed-by: Yonatan Cohen --- drivers/infiniband/sw/rxe/rxe_resp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index dd3d88a..cb3fd4c 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -742,7 +742,8 @@ static enum resp_states read_reply(struct rxe_qp *qp, } else { qp->resp.res = NULL; qp->resp.opcode = -1; - qp->resp.psn = res->cur_psn; + if (psn_compare(res->cur_psn, qp->resp.psn) >= 0) + qp->resp.psn = res->cur_psn; state = RESPST_CLEANUP; }