From patchwork Thu Mar 6 13:01:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 3784531 X-Patchwork-Delegate: hal@mellanox.com 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 77091BF540 for ; Thu, 6 Mar 2014 15:03:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D0AD201FD for ; Thu, 6 Mar 2014 15:03:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64DE02018B for ; Thu, 6 Mar 2014 15:03:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751612AbaCFPDl (ORCPT ); Thu, 6 Mar 2014 10:03:41 -0500 Received: from mail-we0-f179.google.com ([74.125.82.179]:37809 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbaCFPDk (ORCPT ); Thu, 6 Mar 2014 10:03:40 -0500 Received: by mail-we0-f179.google.com with SMTP id x48so3163913wes.24 for ; Thu, 06 Mar 2014 07:03:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=E3G813WCT9MxlfLIOFN6anw7yynt6xN0am7kLgxDsBU=; b=W76X34ZzMJXHRXZC31blZyuuJ4H+BCngsLc2zu3mvKXR2Rkivc3Z27n/qMj08qG05l S/N2gHIEWnIaifLuZlSY/28Sz5r1zdCIz9NDPluWhxrJjlvFrB0pLrjOL8QKbp266uJ1 Fp1AmdgrQE26TlnsPYEeneP7xQgrElFGdkkSd/maSqsm86rUd6jB5ubLoSR45xbaKpOg gl12izJsqyRAuVcJ7qlZTDM9isZgbiOM0LAEJcUk1/xbDMfwu4R2PE474k1riBmYSnR+ 6g6k2ElhgQoXhL866PwNzEIketf1bzcDpu4Y2SAFQpt0K8fUcqYTsA0e+nB28BUDZevH f0HQ== X-Gm-Message-State: ALoCoQmuo4ie2ZTIS724jHcX9cjmsfmtC0JV3rlqerI1oZ7V5+KVxh1xKhOykFlr9/U8PcyIM5h6 X-Received: by 10.194.250.34 with SMTP id yz2mr11065513wjc.18.1394118216952; Thu, 06 Mar 2014 07:03:36 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id h13sm18263794wjr.22.2014.03.06.07.03.35 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 06 Mar 2014 07:03:36 -0800 (PST) From: Alex Netes To: linux-rdma@vger.kernel.org, Hal Rosenstock Cc: Alex Netes Subject: [PATCH] opensm/osm_sminfo_rcv.c: send trap144 to a newly found MASTER SM when in MASTER state Date: Thu, 6 Mar 2014 15:01:01 +0200 Message-Id: <1394110861-6128-1-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.1 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=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 Before this patch, when SM in Master state finds other Master SM, it sends trap144 to previously found Master SM/SM with higher priority when it was in Discovering/Standby state. This can lead to wrong behaviour in a multi-SM topolgy: Setup: SM1 with priority 1, SM2 with priority 2, SM3 with priority 3. Flow: 1. setting SM3 to ignore SMInfo MADs -> SM2 become master 2. setting SM2 to ignore SMInfo MADs -> SM1 become master 3. setting SM2 to accept SMInfo MADs 4. SM2 sends SMInfo to SM1 -> finds that SM1 is master 5. SM2 sends trap144 to SM3 instead of sending it to SM1 Signed-off-by: Alex Netes --- opensm/osm_sminfo_rcv.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/opensm/osm_sminfo_rcv.c b/opensm/osm_sminfo_rcv.c index 9f62f9f..100a82d 100644 --- a/opensm/osm_sminfo_rcv.c +++ b/opensm/osm_sminfo_rcv.c @@ -395,8 +395,13 @@ static void smi_rcv_process_get_sm(IN osm_sm_t * sm, if (sm->polling_sm_guid) { if (smi_rcv_remote_sm_is_higher(sm, p_smi)) sm->p_subn->force_heavy_sweep = TRUE; - else + else { + /* Update master_sm_guid to the GUID of the newly + * found MASTER SM and send trap 144 to it. + */ + sm->master_sm_guid = sm->polling_sm_guid; osm_send_trap144(sm, TRAP_144_MASK_SM_PRIORITY_CHANGE); + } osm_sm_state_mgr_signal_master_is_alive(sm); } else { /* This is a response we got while sweeping the subnet.