From patchwork Mon Nov 3 16:28:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 5218101 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 AC61FC11AC for ; Mon, 3 Nov 2014 16:28:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C97A020121 for ; Mon, 3 Nov 2014 16:28:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DAFE200D6 for ; Mon, 3 Nov 2014 16:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753155AbaKCQ2l (ORCPT ); Mon, 3 Nov 2014 11:28:41 -0500 Received: from mail-lb0-f175.google.com ([209.85.217.175]:62305 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345AbaKCQ2k (ORCPT ); Mon, 3 Nov 2014 11:28:40 -0500 Received: by mail-lb0-f175.google.com with SMTP id n15so1658703lbi.34 for ; Mon, 03 Nov 2014 08:28: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:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=3ubfwYpi/W8EGBskT4hZOkf7xuXCUaZOle8g/mHJT4Q=; b=iLDcFsuMOrAO2p2Kfz6rNe5Gq/Yj10etvhJY90lfNNS8RT/zvbFTdSSegWH0easY3J zDVkL7ozJXouoASHz5Hj8AAO20YBY3jJn28o6w/2aeGX2UVSqbaIS9kH+oqGeC0euj8P onGXdky3ARbXs38Vp+peXlulFWLco2NyJ7dTtRQjG76hru7x0xOHX6DlxyqHWjGnRlUQ 5v2cWuFAKcDs1fsw0NTA2l9yBx8Q6UNpVqQuNISjpyHhKWy84TByeWOPiBPzpoGFf7Fd cYz6eCwcft9OKBw6xAkQKj3hf8rTj0itn5ineLwuq6TnQ/Zrw5ThwIJqNXFIP8e+OO7J 94Mw== X-Gm-Message-State: ALoCoQlutNI0rVdswY9gOiZDjLzDVZA1dNT9WrqoVEc55E7BVvcum77ZJOw4Ivybox760cNKummd X-Received: by 10.112.201.201 with SMTP id kc9mr53367596lbc.76.1415032119154; Mon, 03 Nov 2014 08:28:39 -0800 (PST) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id pf1sm8126828lbc.0.2014.11.03.08.28.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 08:28:38 -0800 (PST) Message-ID: <5457AD33.4080209@dev.mellanox.co.il> Date: Mon, 03 Nov 2014 11:28:35 -0500 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: Vladimir Koushnir , Alex Netes Subject: [PATCH opensm] Better way to handle polling other MASTER SM 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.5 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 In the case where another MASTER SM disappears, call OSM_SM_SIGNAL_POLLING_TIMEOUT to reconfigure the fabric from scratch. Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock --- opensm/osm_drop_mgr.c | 3 --- opensm/osm_state_mgr.c | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/opensm/osm_drop_mgr.c b/opensm/osm_drop_mgr.c index ab06bf8..8441f89 100644 --- a/opensm/osm_drop_mgr.c +++ b/opensm/osm_drop_mgr.c @@ -257,9 +257,6 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN osm_port_t * p_port) OSM_LOG(sm->p_log, OSM_LOG_VERBOSE, "Cleaned SM for port guid 0x%016" PRIx64 "\n", cl_ntoh64(port_guid)); - /* clean up the polling_sm_guid */ - if (sm->polling_sm_guid == p_sm->smi.guid) - sm->polling_sm_guid = 0; free(p_sm); } diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c index 9798b41..1dc6e19 100644 --- a/opensm/osm_state_mgr.c +++ b/opensm/osm_state_mgr.c @@ -1404,10 +1404,17 @@ repeat_discovery: * need to wait for that SM to relinquish control * of its portion of the subnet. C14-60.2.1. * Also - need to start polling on that SM. */ + CL_PLOCK_EXCL_ACQUIRE(sm->p_lock); sm->polling_sm_guid = p_remote_sm->smi.guid; + CL_PLOCK_RELEASE(sm->p_lock); osm_sm_state_mgr_process(sm, OSM_SM_SIGNAL_WAIT_FOR_HANDOVER); return; + } else if (sm->polling_sm_guid) { + /* Stop polling SM if it's not found */ + osm_sm_state_mgr_process(sm, + OSM_SM_SIGNAL_POLLING_TIMEOUT); + return; } } }