From patchwork Wed Mar 10 18:06:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Schutt X-Patchwork-Id: 84654 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 o2AI7eZO024931 for ; Wed, 10 Mar 2010 18:07:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932630Ab0CJSHm (ORCPT ); Wed, 10 Mar 2010 13:07:42 -0500 Received: from sentry-three.sandia.gov ([132.175.109.17]:52189 "EHLO sentry-three.sandia.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932618Ab0CJSHi (ORCPT ); Wed, 10 Mar 2010 13:07:38 -0500 X-WSS-ID: 0KZ2VOK-0C-MM3-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 1E1F24D5675; Wed, 10 Mar 2010 11:07:32 -0700 (MST) Received: from [132.175.109.1] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Wed, 10 Mar 2010 11:07:26 -0700 X-Server-Uuid: AF72F651-81B1-4134-BA8C-A8E1A4E620FF Received: from localhost.localdomain (jast01.sandia.gov [134.253.4.112]) by mailgate.sandia.gov (8.14.1/8.14.1) with ESMTP id o2AI7OpD016900; Wed, 10 Mar 2010 11:07:25 -0700 From: "Jim Schutt" To: linux-rdma@vger.kernel.org cc: sashak@voltaire.com, eitan@mellanox.co.il, jaschut@sandia.gov Subject: [PATCH v2 02/15] opensm: Allow the routing engine to influence SL2VL calculations. Date: Wed, 10 Mar 2010 11:06:44 -0700 Message-ID: <1268244416-20351-3-git-send-email-jaschut@sandia.gov> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1268244416-20351-1-git-send-email-jaschut@sandia.gov> References: <1268244416-20351-1-git-send-email-jaschut@sandia.gov> X-PMX-Version: 5.5.9.388399, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.3.10.175422 X-PerlMx-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=20100310180727; ID=1; SEV=2.3.1; DFV=B2010031017; IFV=NA; AIF=B2010031017; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230382E34423937444644462E303035353A534346535441543838363133332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2010031017_5.03.0010 MIME-Version: 1.0 X-WSS-ID: 678900540JG908643-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]); Wed, 10 Mar 2010 18:07: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 f814ea8..23fd316 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, @@ -233,10 +234,20 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node, for (i = 1; i < num_ports; i++) { p = osm_node_get_physp_ptr(node, i); force_update = p->need_update || sm->p_subn->need_update; - for (j = 0; j < num_ports; j++) + for (j = 0; 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; @@ -246,6 +257,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)) @@ -254,7 +268,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 e43463f..6fcccba 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;