From patchwork Thu Oct 4 19:54:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 1548041 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CA6C53FC1A for ; Thu, 4 Oct 2012 19:54:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757437Ab2JDTyr (ORCPT ); Thu, 4 Oct 2012 15:54:47 -0400 Received: from mga09.intel.com ([134.134.136.24]:9471 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757249Ab2JDTyp convert rfc822-to-8bit (ORCPT ); Thu, 4 Oct 2012 15:54:45 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 04 Oct 2012 12:54:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,537,1344236400"; d="scan'208";a="201691769" Received: from fmsmsx106.amr.corp.intel.com ([10.19.9.37]) by orsmga001.jf.intel.com with ESMTP; 04 Oct 2012 12:54:44 -0700 Received: from fmsmsx151.amr.corp.intel.com ([169.254.6.213]) by FMSMSX106.amr.corp.intel.com ([169.254.6.8]) with mapi id 14.01.0355.002; Thu, 4 Oct 2012 12:54:44 -0700 From: "Hefty, Sean" To: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH] [librdmacm] librdmacm/ucmatose: Fix number of connections to disconnect Thread-Topic: [PATCH] [librdmacm] librdmacm/ucmatose: Fix number of connections to disconnect Thread-Index: Ac2iahiH8HED8TwBQha9UwlpsGbQjQ== Date: Thu, 4 Oct 2012 19:54:44 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A8237346A99224@FMSMSX151.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org When ucmatose aborts because of issues trying to connect to the server, it moves to disconnecting all connections. However, not all connections may have been established. The result is that ucmatose will hang in disconnect_events. Fix this by setting the number of times that we need to disconnect to the number of times that we successfully connect. This problem is based on a report by Doug Ledford Signed-off-by: Sean Hefty --- examples/cmatose.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/examples/cmatose.c b/examples/cmatose.c index 94fc4cd..9ea6777 100644 --- a/examples/cmatose.c +++ b/examples/cmatose.c @@ -211,7 +211,6 @@ static int post_sends(struct cmatest_node *node) static void connect_error(void) { - test.disconnects_left--; test.connects_left--; } @@ -323,6 +322,7 @@ static int cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) case RDMA_CM_EVENT_ESTABLISHED: ((struct cmatest_node *) cma_id->context)->connected = 1; test.connects_left--; + test.disconnects_left++; break; case RDMA_CM_EVENT_ADDR_ERROR: case RDMA_CM_EVENT_ROUTE_ERROR: @@ -688,7 +688,6 @@ int main(int argc, char **argv) } test.connects_left = connections; - test.disconnects_left = connections; test.channel = rdma_create_event_channel(); if (!test.channel) {