From patchwork Thu Aug 8 15:05:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 2841306 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4F71B9F271 for ; Thu, 8 Aug 2013 16:04:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34A6C2037A for ; Thu, 8 Aug 2013 16:04:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D673020375 for ; Thu, 8 Aug 2013 16:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934137Ab3HHQEw (ORCPT ); Thu, 8 Aug 2013 12:04:52 -0400 Received: from mailp.voltaire.com ([193.47.165.129]:33781 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1757733Ab3HHQEv (ORCPT ); Thu, 8 Aug 2013 12:04:51 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from yishaih@mellanox.com) with SMTP; 8 Aug 2013 19:04:47 +0300 Received: from vnc17.lab.mtl.com (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id r78G4lt6030604; Thu, 8 Aug 2013 19:04:47 +0300 Received: from vnc17.lab.mtl.com (localhost.localdomain [127.0.0.1]) by vnc17.lab.mtl.com (8.13.8/8.13.8) with ESMTP id r78F6eaO026878; Thu, 8 Aug 2013 18:06:40 +0300 Received: (from yishaih@localhost) by vnc17.lab.mtl.com (8.13.8/8.13.8/Submit) id r78F6drU026868; Thu, 8 Aug 2013 18:06:39 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org, roland@purestorage.com Cc: ogerlitz@mellanox.com, tzahio@mellanox.com, yishaih@mellanox.com, sean.hefty@intel.com, jay.e.sternberg@intel.com, Eli Cohen Subject: [PATCH libibverbs] XRC - Sample application issues Date: Thu, 8 Aug 2013 18:05:36 +0300 Message-Id: <1375974336-26314-1-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.7.8.2 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix sync issue when clients go down, it comes to prevent a case when client misses a response from the daemon then wait forever. Fix typo in error message. Signed-off-by: Yishai Hadas Signed-off-by: Eli Cohen --- This patch is on top of V9 of XRC series that was already sent. It should be squashed into latest patch #7 named 'Add XRC sample application'. Jay, Sean - please review. examples/xsrq_pingpong.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/examples/xsrq_pingpong.c b/examples/xsrq_pingpong.c index 984740d..aceef2e 100644 --- a/examples/xsrq_pingpong.c +++ b/examples/xsrq_pingpong.c @@ -376,7 +376,7 @@ static int connect_qps(int index) IBV_QP_STATE | IBV_QP_AV | IBV_QP_PATH_MTU | IBV_QP_DEST_QPN | IBV_QP_RQ_PSN | IBV_QP_MAX_DEST_RD_ATOMIC | IBV_QP_MIN_RNR_TIMER)) { - fprintf(stderr, "Failed to modify send QP[%d] to RTR\n", index); + fprintf(stderr, "Failed to modify recv QP[%d] to RTR\n", index); return 1; } @@ -884,6 +884,13 @@ int main(int argc, char *argv[]) if (ctx.use_event) ibv_ack_cq_events(ctx.recv_cq, num_cq_events); + /* Process should wait before closing its resources to make sure + * latest daemon's response sent via its target QP destined to an XSRQ + * created by another client won't be lost. + * Failure to do so will cause the client to wait for that sent message forever. + * See comment on pp_post_send. + */ + sleep(1); if (pp_close_ctx()) return 1;