From patchwork Tue Nov 3 15:29:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 57325 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 nA3FTVkL007039 for ; Tue, 3 Nov 2009 15:29:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbZKCP3Z (ORCPT ); Tue, 3 Nov 2009 10:29:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751499AbZKCP3Z (ORCPT ); Tue, 3 Nov 2009 10:29:25 -0500 Received: from qmta01.westchester.pa.mail.comcast.net ([76.96.62.16]:57474 "EHLO QMTA01.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbZKCP3Y (ORCPT ); Tue, 3 Nov 2009 10:29:24 -0500 Received: from OMTA06.westchester.pa.mail.comcast.net ([76.96.62.51]) by QMTA01.westchester.pa.mail.comcast.net with comcast id 0f9o1d00416LCl051fVUYn; Tue, 03 Nov 2009 15:29:28 +0000 Received: from hal.comcast.net ([75.69.247.31]) by OMTA06.westchester.pa.mail.comcast.net with comcast id 0fVV1d00P0hNrtn3SfVWJz; Tue, 03 Nov 2009 15:29:30 +0000 Received: from hal.comcast.net (localhost.localdomain [127.0.0.1]) by hal.comcast.net (8.14.3/8.14.3) with ESMTP id nA3FTnB8007302; Tue, 3 Nov 2009 10:29:54 -0500 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id nA3FTXWi007271; Tue, 3 Nov 2009 10:29:33 -0500 Date: Tue, 3 Nov 2009 10:29:32 -0500 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm/osm_trap_rcv.c: Eliminate heavy sweep on receipt of trap 145 Message-ID: <20091103152932.GA7267@comcast.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) 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_trap_rcv.c b/opensm/opensm/osm_trap_rcv.c index 91c3761..dae6e68 100644 --- a/opensm/opensm/osm_trap_rcv.c +++ b/opensm/opensm/osm_trap_rcv.c @@ -305,6 +305,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, osm_physp_t *p_physp; cl_ptr_vector_t *p_tbl; osm_port_t *p_port; + osm_node_t *p_node; ib_net16_t source_lid = 0; boolean_t is_gsi = TRUE; uint8_t port_num = 0; @@ -504,8 +505,9 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, } /* Check for node description update. IB Spec v1.2.1 pg 823 */ - if (ib_notice_is_generic(p_ntci) && - cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144 && + if (!ib_notice_is_generic(p_ntci)) + goto check_sweep; + if (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144 && p_ntci->data_details.ntc_144.local_changes & TRAP_144_MASK_OTHER_LOCAL_CHANGES && p_ntci->data_details.ntc_144.change_flgs & TRAP_144_MASK_NODE_DESCRIPTION_CHANGE) { OSM_LOG(sm->p_log, OSM_LOG_INFO, "Trap 144 Node description update\n"); @@ -518,20 +520,25 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3812: No physical port found for " "trap 144: \"node description update\"\n"); + goto check_sweep; } - + if (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 145) { + /* update system image guid (in NodeInfo) */ + p_node = osm_physp_get_node_ptr(p_physp); + p_node->node_info.sys_guid = p_ntci->data_details.ntc_145.new_sys_guid; + } +check_sweep: /* do a sweep if we received a trap */ if (sm->p_subn->opt.sweep_on_trap) { /* if this is trap number 128 or run_heavy_sweep is TRUE - update the force_heavy_sweep flag of the subnet. - Sweep also on traps 144/145 - these traps signal a change of - certain port capabilities/system image guid. + Sweep also on traps 144 - these traps signal a change of + certain port capabilities. TODO: In the future this can be changed to just getting PortInfo on this port instead of sweeping the entire subnet. */ if (ib_notice_is_generic(p_ntci) && (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 128 || cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144 || - cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 145 || run_heavy_sweep)) { OSM_LOG(sm->p_log, OSM_LOG_VERBOSE, "Forcing heavy sweep. Received trap:%u\n",