From patchwork Tue Nov 3 10:26:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 57263 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA3AM6Yl010940 for ; Tue, 3 Nov 2009 10:22:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750862AbZKCKV7 (ORCPT ); Tue, 3 Nov 2009 05:21:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750998AbZKCKV7 (ORCPT ); Tue, 3 Nov 2009 05:21:59 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:47394 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750862AbZKCKV6 (ORCPT ); Tue, 3 Nov 2009 05:21:58 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from kliteyn@dev.mellanox.co.il) with SMTP; 3 Nov 2009 12:27:29 +0200 Received: from [10.4.1.29] ([10.4.1.29]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 3 Nov 2009 12:21:56 +0200 Message-ID: <4AF0056A.5030503@dev.mellanox.co.il> Date: Tue, 03 Nov 2009 12:26:50 +0200 From: Yevgeny Kliteynik Reply-To: kliteyn@dev.mellanox.co.il User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Sasha Khapyorsky CC: Linux RDMA Subject: [PATCH] opensm/osm_state_mgr.c: force heavy sweep when fabric consists of single switch X-OriginalArrivalTime: 03 Nov 2009 10:21:56.0300 (UTC) FILETIME=[784E40C0:01CA5C6F] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c index 4303d6e..537c855 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1062,13 +1062,18 @@ static void do_sweep(osm_sm_t * sm) * Otherwise, this is probably our first discovery pass * or we are connected in loopback. In both cases do a * heavy sweep. - * Note: If we are connected in loopback we want a heavy - * sweep, since we will not be getting any traps if there is - * a lost connection. + * Note the following: + * 1. If we are connected in loopback we want a heavy sweep, since we + * will not be getting any traps if there is a lost connection. + * 2. If we are in DISCOVERING state - this means it is either in + * initializing or wake up from STANDBY - run the heavy sweep. + * 3. If there is only one node in the fabric, and this node is a + * switch, and OSM runs on top of it, there might be a race when + * OSM starts running before the external ports are up - run the + * heavy sweep. */ - /* if we are in DISCOVERING state - this means it is either in - * initializing or wake up from STANDBY - run the heavy sweep */ if (cl_qmap_count(&sm->p_subn->sw_guid_tbl) + && cl_qmap_count(&sm->p_subn->node_guid_tbl) != 1 && sm->p_subn->sm_state != IB_SMINFO_STATE_DISCOVERING && sm->p_subn->opt.force_heavy_sweep == FALSE && sm->p_subn->force_heavy_sweep == FALSE