From patchwork Mon Dec 15 19:58:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 5497361 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6E02BBEEA8 for ; Mon, 15 Dec 2014 19:59:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E17E20973 for ; Mon, 15 Dec 2014 19:59:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87303209E5 for ; Mon, 15 Dec 2014 19:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751054AbaLOT7D (ORCPT ); Mon, 15 Dec 2014 14:59:03 -0500 Received: from mga02.intel.com ([134.134.136.20]:38221 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751053AbaLOT7B (ORCPT ); Mon, 15 Dec 2014 14:59:01 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 15 Dec 2014 11:58:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="499097833" Received: from cst-linux.jf.intel.com ([10.23.221.72]) by orsmga003.jf.intel.com with ESMTP; 15 Dec 2014 11:54:48 -0800 From: arlin.r.davis@intel.com To: linux-rdma@vger.kernel.org Cc: Arlin Davis Subject: [PATCH 1/4] ucm: RTU not retransmitted in TIMEWAIT state Date: Mon, 15 Dec 2014 11:58:52 -0800 Message-Id: <1418673535-1464-2-git-send-email-arlin.r.davis@intel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1418673535-1464-1-git-send-email-arlin.r.davis@intel.com> References: <1418673535-1464-1-git-send-email-arlin.r.davis@intel.com> 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, T_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 From: Arlin Davis Signed-off-by: Arlin Davis --- dapl/openib_ucm/cm.c | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c index e462632..141086d 100644 --- a/dapl/openib_ucm/cm.c +++ b/dapl/openib_ucm/cm.c @@ -231,7 +231,7 @@ static void ucm_check_timers(dp_ib_cm_handle_t cm, int *timer) *timer = cm->hca->ib_trans.cm_timer; if ((time - cm->timer)/1000 > (cm->hca->ib_trans.rtu_time << cm->retries)) { - dapl_log(DAPL_DBG_TYPE_CM_WARN, + dapl_log(DAPL_DBG_TYPE_CM, " CM_TIMEWAIT %d %p [lid, port, cqp, iqp]:" " %x %x %x %x -> %x %x %x %x r_pid %x" " Time(ms) %d > %d\n", @@ -247,8 +247,17 @@ static void ucm_check_timers(dp_ib_cm_handle_t cm, int *timer) } if (cm->retries > 2) { dapl_log(DAPL_DBG_TYPE_CM_WARN, - " CM_TIMEWAIT expired (%d ms) for CM %p\n", - cm, (time - cm->timer)/1000); + " CM_TIMEWAIT EXPIRED %d %p [lid, port, cqp, iqp]:" + " %x %x %x %x -> %x %x %x %x r_pid %x" + " Time(ms) %d > %d\n", + cm->retries+1, cm, + ntohs(cm->msg.saddr.ib.lid), ntohs(cm->msg.sport), + ntohl(cm->msg.sqpn), ntohl(cm->msg.saddr.ib.qpn), + ntohs(cm->msg.daddr.ib.lid), ntohs(cm->msg.dport), + ntohl(cm->msg.dqpn), ntohl(cm->msg.daddr.ib.qpn), + ntohl(cm->msg.d_id), + (time - cm->timer)/1000, + cm->hca->ib_trans.rtu_time << cm->retries); cm->ah = NULL; /* consumer will free AH */ cm->state = DCM_FREE; dapl_os_unlock(&cm->lock); @@ -382,8 +391,10 @@ static void ucm_process_recv(ib_hca_transport_t *tp, ucm_connect_rtu(cm, msg); break; case DCM_CONNECTED: /* active and passive */ + case DCM_TIMEWAIT: /* passive */ /* DREQ, change state and process */ - cm->retries = 2; + if (cm->state == DCM_CONNECTED) + cm->retries = 2; if (ntohs(msg->op) == DCM_DREQ) { cm->state = DCM_DISC_RECV; dapl_os_unlock(&cm->lock); @@ -395,7 +406,7 @@ static void ucm_process_recv(ib_hca_transport_t *tp, dapl_log(DAPL_DBG_TYPE_CM_WARN, " RESEND RTU: op %s st %s [lid, port, cqp, iqp]:" " %x %x %x %x -> %x %x %x %x r_pid %x\n", - dapl_cm_op_str(ntohs(cm->msg.op)), + dapl_cm_op_str(ntohs(msg->op)), dapl_cm_state_str(cm->state), ntohs(cm->msg.saddr.ib.lid), ntohs(cm->msg.sport), ntohl(cm->msg.sqpn), ntohl(cm->msg.saddr.ib.qpn),