From patchwork Fri Nov 20 19:15:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Schutt X-Patchwork-Id: 61727 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 nAKJWmvD031252 for ; Fri, 20 Nov 2009 19:32:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753045AbZKTTcr (ORCPT ); Fri, 20 Nov 2009 14:32:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754067AbZKTTcr (ORCPT ); Fri, 20 Nov 2009 14:32:47 -0500 Received: from sentry-three.sandia.gov ([132.175.109.17]:54472 "EHLO sentry-three.sandia.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754918AbZKTTcl (ORCPT ); Fri, 20 Nov 2009 14:32:41 -0500 X-WSS-ID: 0KTF9HP-08-QV1-02 X-M-MSG: Received: from sentry.sandia.gov (sentry.sandia.gov [132.175.109.20]) by sentry-three.sandia.gov (Tumbleweed MailGate 3.6.1) with ESMTP id 282F38FECB2; Fri, 20 Nov 2009 12:15:24 -0700 (MST) Received: from [132.175.109.1] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Fri, 20 Nov 2009 12:15:12 -0700 X-Server-Uuid: 6BFC7783-7E22-49B4-B610-66D6BE496C0E Received: from localhost.localdomain (sale659.sandia.gov [134.253.4.20]) by mailgate.sandia.gov (8.14.1/8.14.1) with ESMTP id nAKJF9tK028412; Fri, 20 Nov 2009 12:15:11 -0700 From: "Jim Schutt" To: linux-rdma@vger.kernel.org cc: sashak@voltaire.com, eitan@mellanox.co.il, jaschut@sandia.gov Subject: [PATCH 02/11] opensm: Allow the routing engine to influence SL2VL calculations. Date: Fri, 20 Nov 2009 12:15:01 -0700 Message-ID: <1258744509-11148-3-git-send-email-jaschut@sandia.gov> X-Mailer: git-send-email 1.5.6.GIT In-Reply-To: <1258744509-11148-1-git-send-email-jaschut@sandia.gov> References: <1258744509-11148-1-git-send-email-jaschut@sandia.gov> X-PMX-Version: 5.5.7.378829, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2009.11.20.190049 X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, TO_NO_NAME 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NS ' X-TMWD-Spam-Summary: TS=20091120191514; ID=1; SEV=2.3.1; DFV=B2009112016; IFV=NA; AIF=B2009112016; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230312E34423036454143322E303035463A534346535441543838363133332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2009112016_5.03.0010 MIME-Version: 1.0 X-WSS-ID: 6718354A4EG2204792-01-01 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/include/opensm/osm_opensm.h b/opensm/include/opensm/osm_opensm.h index e97142e..616113b 100644 --- a/opensm/include/opensm/osm_opensm.h +++ b/opensm/include/opensm/osm_opensm.h @@ -126,6 +126,9 @@ struct osm_routing_engine { int (*build_lid_matrices) (void *context); int (*ucast_build_fwd_tables) (void *context); void (*ucast_dump_tables) (void *context); + void (*update_sl2vl)(void *context, IN osm_port_t *port, + IN uint8_t in_port_num, IN uint8_t out_port_num, + IN OUT ib_slvl_table_t *t); void (*delete) (void *context); struct osm_routing_engine *next; }; @@ -147,6 +150,16 @@ struct osm_routing_engine { * ucast_dump_tables * The callback for dumping unicast routing tables. * +* update_sl2vl(void *context, IN osm_port_t *port, +* IN uint8_t in_port_num, IN uint8_t out_port_num, +* OUT ib_slvl_table_t *t) +* The callback to allow routing engine input for SL2VL maps. +* For switches, *port is the switch management port, and +* in_port_num/out_port_num identify which part of the SL2VL +* map to update. For router/HCA ports, *port is the port +* for which the SL2VL map should be updated, and in_port_num/ +* out_port_num should be ignored. +* * delete * The delete method, may be used for routing engine * internals cleanup. diff --git a/opensm/opensm/osm_qos.c b/opensm/opensm/osm_qos.c index 08f9a60..f42c334 100644 --- a/opensm/opensm/osm_qos.c +++ b/opensm/opensm/osm_qos.c @@ -194,6 +194,7 @@ static ib_api_status_t sl2vl_update(osm_sm_t * sm, osm_port_t * p_port, { ib_api_status_t status; uint8_t i, num_ports; + struct osm_routing_engine *re = sm->p_subn->p_osm->routing_engine_used; osm_physp_t *p_physp; if (osm_node_get_type(osm_physp_get_node_ptr(p)) == IB_NODE_TYPE_SWITCH) { @@ -213,8 +214,24 @@ static ib_api_status_t sl2vl_update(osm_sm_t * sm, osm_port_t * p_port, } for (i = 0; i < num_ports; i++) { + ib_slvl_table_t routing_sl2vl; + const ib_slvl_table_t *port_sl2vl; + const ib_slvl_table_t *port_sl2vl_old; + + if (re->update_sl2vl) { + routing_sl2vl = qcfg->sl2vl; + re->update_sl2vl(re->context, + p_port, i, port_num, &routing_sl2vl); + port_sl2vl = &routing_sl2vl; + port_sl2vl_old = osm_physp_get_slvl_tbl(p, i); + if (memcmp(port_sl2vl, port_sl2vl_old, + sizeof(*port_sl2vl)) != 0) + force_update = 1; + } else + port_sl2vl = &qcfg->sl2vl; + status = sl2vl_update_table(sm, p, i, port_num, force_update, - &qcfg->sl2vl); + port_sl2vl); if (status != IB_SUCCESS) return status; } diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c index 7540adc..c3f49dc 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1228,8 +1228,6 @@ repeat_discovery: osm_pkey_mgr_process(sm->p_subn->p_osm); - osm_qos_setup(sm->p_subn->p_osm); - /* try to restore SA DB (this should be before lid_mgr because we may want to disable clients reregistration when SA DB is restored) */ @@ -1270,6 +1268,8 @@ repeat_discovery: osm_ucast_cache_process(&sm->ucast_mgr)) osm_ucast_mgr_process(&sm->ucast_mgr); + osm_qos_setup(sm->p_subn->p_osm); + if (wait_for_pending_transactions(&sm->p_subn->p_osm->stats)) return;