From patchwork Wed Oct 23 14:38:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3088991 X-Patchwork-Delegate: hal@mellanox.com 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 6A6459F2B8 for ; Wed, 23 Oct 2013 14:38:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC788202FF for ; Wed, 23 Oct 2013 14:38:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B84820295 for ; Wed, 23 Oct 2013 14:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496Ab3JWOiX (ORCPT ); Wed, 23 Oct 2013 10:38:23 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:48487 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408Ab3JWOiW (ORCPT ); Wed, 23 Oct 2013 10:38:22 -0400 Received: by mail-we0-f173.google.com with SMTP id u57so904649wes.18 for ; Wed, 23 Oct 2013 07:38:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=au7GcVBcVt4DI6mj5yrLS0iu1FfP5iuJu1QNMAFyPyw=; b=nCJap2Il6YIWIXFRNNvj6lHz8Nz+LAeQwlIRUODQ06APJvNs8j+IgJvaxcKE7DqCNt IYNwA21NnTFobd6vmp+gj3vWMzMQdGWMEvFKntkfHyhROa1/pK3Nh2tr3bb0DGa6ctWs XSZormfU+41V/qn3yeAH7BlBeNp448S92InW1xW5Z7KwwaRc73Tl5k7ZISfOYQNcCvfE xvUbvVTYR0G4t1XET0kR1ztnxPCPkVU9r7GO6wwmHnp+ITYUJYdVZ992VCXjlbZwUor1 /MZE6UjJg6Y7QkEcxd2wHnHlIK9P/sbFD3X1uqQFyoz0UN0vBRYsHdYcPQIs9vhu7Zqo B48w== X-Gm-Message-State: ALoCoQm/FUqiWLOp5EVUM/lLrUgtQc+BpVvIxB+6qs6pW5UhB7wwZ4PAGH9xffqmmOpPoN3zHPJy X-Received: by 10.194.143.100 with SMTP id sd4mr1965815wjb.69.1382539101063; Wed, 23 Oct 2013 07:38:21 -0700 (PDT) Received: from [10.222.163.5] (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id q17sm17688390wiv.10.2013.10.23.07.38.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Oct 2013 07:38:20 -0700 (PDT) Message-ID: <5267DF59.7000809@dev.mellanox.co.il> Date: Wed, 23 Oct 2013 10:38:17 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Alex Netes Subject: [PATCH opensm] Resend trap 144 when detecting remote MASTER SM with lower priority Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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: Alex Netes Remote MASTER SM might not get trap 144 and therefore never perform a HANDOVER. The patch solves this by resending trap 144 when receiving GetResp(SMInfo) to a remote MASTER SM after polling timeout expires. Signed-off-by: Alex Netes --- opensm/osm_sminfo_rcv.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/opensm/osm_sminfo_rcv.c b/opensm/osm_sminfo_rcv.c index 2fee359..16d2a4c 100644 --- a/opensm/osm_sminfo_rcv.c +++ b/opensm/osm_sminfo_rcv.c @@ -383,11 +383,20 @@ static void smi_rcv_process_get_sm(IN osm_sm_t * sm, switch (ib_sminfo_get_state(p_smi)) { case IB_SMINFO_STATE_MASTER: /* If this is a response due to our polling, this means that we are - waiting for a handover from this SM, and it is still alive - - signal that. */ - if (sm->p_polling_sm) + * waiting for a handover from this SM, and it is still alive - + * signal that. If we detected the remote SM with higher priority + * we should init a heavy sweep in order to go STANDBY. If we + * detected a remote SM with lower priority, we should resend trap144 + * as it might not get it and we don't want to wait for a HANDOVER + * forever. + */ + if (sm->p_polling_sm) { + if (smi_rcv_remote_sm_is_higher(sm, p_smi)) + sm->p_subn->force_heavy_sweep = TRUE; + else + osm_send_trap144(sm, TRAP_144_MASK_SM_PRIORITY_CHANGE); osm_sm_state_mgr_signal_master_is_alive(sm); - else { + } else { /* This is a response we got while sweeping the subnet. * * If this is during a heavy sweep, we will handle a case of