From patchwork Tue Jun 15 19:53:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Schutt X-Patchwork-Id: 106314 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5FJrgMg028443 for ; Tue, 15 Jun 2010 19:53:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754298Ab0FOTxm (ORCPT ); Tue, 15 Jun 2010 15:53:42 -0400 Received: from sentry-three.sandia.gov ([132.175.109.17]:52732 "EHLO sentry-three.sandia.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753832Ab0FOTxk (ORCPT ); Tue, 15 Jun 2010 15:53:40 -0400 X-WSS-ID: 0L42N97-0C-6XG-02 X-M-MSG: Received: from sentry.sandia.gov (mm03snlnto.sandia.gov [132.175.109.20]) by sentry-three.sandia.gov (Postfix) with ESMTP id 1815F4D8869; Tue, 15 Jun 2010 13:53:30 -0600 (MDT) Received: from [132.175.109.1] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Tue, 15 Jun 2010 13:53:28 -0600 X-Server-Uuid: AF72F651-81B1-4134-BA8C-A8E1A4E620FF Received: from localhost.localdomain (sale659.sandia.gov [134.253.4.20]) by mailgate.sandia.gov (8.14.4/8.14.4) with ESMTP id o5FJrIBG028244; Tue, 15 Jun 2010 13:53:20 -0600 From: "Jim Schutt" To: linux-rdma@vger.kernel.org cc: sashak@voltaire.com, "Jim Schutt" Subject: [PATCH v3 02/17] opensm: Allow the routing engine to influence SL2VL calculations. Date: Tue, 15 Jun 2010 13:53:09 -0600 Message-ID: <1276631604-29230-3-git-send-email-jaschut@sandia.gov> X-Mailer: git-send-email 1.6.2.2 In-Reply-To: <1276631604-29230-1-git-send-email-jaschut@sandia.gov> References: <1276631604-29230-1-git-send-email-jaschut@sandia.gov> X-PMX-Version: 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.15.194814 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_6000_6999 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_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' X-TMWD-Spam-Summary: TS=20100615195330; ID=1; SEV=2.3.1; DFV=B2010061519; IFV=NA; AIF=B2010061519; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230372E34433137444133412E303131343A534346535441543838363133332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2010061519_5.03.0010 MIME-Version: 1.0 X-WSS-ID: 600905BD2GW1265958-01-01 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 15 Jun 2010 19:53:44 +0000 (UTC) diff --git a/opensm/include/opensm/osm_opensm.h b/opensm/include/opensm/osm_opensm.h index e97142e..25a6f90 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_physp_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,15 @@ struct osm_routing_engine { * ucast_dump_tables * The callback for dumping unicast routing tables. * +* update_sl2vl(void *context, IN osm_physp_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. +* *port is the phyical port for which the SL2VL map is to be +* updated. For switches, in_port_num/out_port_num identify +* which part of the SL2VL map to update. For router/HCA ports, +* 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 cce59ee..dadef29 100644 --- a/opensm/opensm/osm_qos.c +++ b/opensm/opensm/osm_qos.c @@ -207,6 +207,7 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node, osm_physp_t *p0, *p; unsigned force_update; unsigned num_ports = osm_node_get_num_physp(node); + struct osm_routing_engine *re = sm->p_subn->p_osm->routing_engine_used; int ret = 0; unsigned i, j; @@ -223,7 +224,7 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node, return ret; if (ib_switch_info_get_opt_sl2vlmapping(&node->sw->switch_info) && - sm->p_subn->opt.use_optimized_slvl) { + sm->p_subn->opt.use_optimized_slvl && !re->update_sl2vl) { p = osm_node_get_physp_ptr(node, 1); force_update = p->need_update || sm->p_subn->need_update; return sl2vl_update_table(sm, p, 1, 0x30000, force_update, @@ -234,10 +235,20 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node, p = osm_node_get_physp_ptr(node, i); force_update = p->need_update || sm->p_subn->need_update; j = ib_switch_info_is_enhanced_port0(&node->sw->switch_info) ? 0 : 1; - for (; j < num_ports; j++) + for (; j < num_ports; j++) { + const ib_slvl_table_t *port_sl2vl = &qcfg->sl2vl; + ib_slvl_table_t routing_sl2vl; + + if (re->update_sl2vl) { + routing_sl2vl = *port_sl2vl; + re->update_sl2vl(re->context, + p, i, j, &routing_sl2vl); + port_sl2vl = &routing_sl2vl; + } if (sl2vl_update_table(sm, p, i, i << 8 | j, - force_update, &qcfg->sl2vl)) + force_update, port_sl2vl)) ret = -1; + } } return ret; @@ -247,6 +258,9 @@ static int qos_endport_setup(osm_sm_t * sm, osm_physp_t * p, const struct qos_config *qcfg) { unsigned force_update = p->need_update || sm->p_subn->need_update; + struct osm_routing_engine *re = sm->p_subn->p_osm->routing_engine_used; + const ib_slvl_table_t *port_sl2vl = &qcfg->sl2vl; + ib_slvl_table_t routing_sl2vl; p->vl_high_limit = qcfg->vl_high_limit; if (vlarb_update(sm, p, 0, force_update, qcfg)) @@ -255,7 +269,12 @@ static int qos_endport_setup(osm_sm_t * sm, osm_physp_t * p, if (!(p->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP)) return 0; - if (sl2vl_update_table(sm, p, 0, 0, force_update, &qcfg->sl2vl)) + if (re->update_sl2vl) { + routing_sl2vl = *port_sl2vl; + re->update_sl2vl(re->context, p, 0, 0, &routing_sl2vl); + port_sl2vl = &routing_sl2vl; + } + if (sl2vl_update_table(sm, p, 0, 0, force_update, port_sl2vl)) return -1; return 0; diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c index 81c8f54..cdd72c1 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1141,6 +1141,7 @@ static void do_sweep(osm_sm_t * sm) sm->p_subn->ignore_existing_lfts = TRUE; osm_ucast_mgr_process(&sm->ucast_mgr); + osm_qos_setup(sm->p_subn->p_osm); /* Reset flag */ sm->p_subn->ignore_existing_lfts = FALSE; @@ -1259,8 +1260,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) */ @@ -1301,6 +1300,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;