From patchwork Fri Sep 3 16:42:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Schutt X-Patchwork-Id: 154451 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o83Ghm0O023398 for ; Fri, 3 Sep 2010 16:43:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756361Ab0ICQnb (ORCPT ); Fri, 3 Sep 2010 12:43:31 -0400 Received: from sentry-three.sandia.gov ([132.175.109.17]:46228 "EHLO sentry-three.sandia.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756331Ab0ICQn2 (ORCPT ); Fri, 3 Sep 2010 12:43:28 -0400 X-WSS-ID: 0L86JSB-0C-3ZF-02 X-M-MSG: Received: from sentry.sandia.gov (sentry.sandia.gov [132.175.109.21]) by sentry-three.sandia.gov (Postfix) with ESMTP id 1A015529C00; Fri, 3 Sep 2010 10:43:22 -0600 (MDT) Received: from [132.175.109.1] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Fri, 03 Sep 2010 10:43:18 -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 o83Gh6aW008533; Fri, 3 Sep 2010 10:43:08 -0600 From: "Jim Schutt" To: linux-rdma@vger.kernel.org cc: sashak@voltaire.com, "Jim Schutt" Subject: [PATCH v4 02/18] opensm: Allow the routing engine to influence SL2VL calculations. Date: Fri, 3 Sep 2010 10:42:58 -0600 Message-ID: <1283532194-27112-3-git-send-email-jaschut@sandia.gov> X-Mailer: git-send-email 1.6.2.2 In-Reply-To: <1283532194-27112-1-git-send-email-jaschut@sandia.gov> References: <1283532194-27112-1-git-send-email-jaschut@sandia.gov> X-PMX-Version: 5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.9.3.163016 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_6000_6999 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' X-TMWD-Spam-Summary: TS=20100903164319; ID=1; SEV=2.3.1; DFV=B2010090317; IFV=NA; AIF=B2010090317; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230392E34433831323541372E303130433A534346535441543838363133332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2010090317_5.03.0010 MIME-Version: 1.0 X-WSS-ID: 609FFA2C29K3240755-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 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Sep 2010 16:43:49 +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 c90073e..e0f4411 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 in, out; uint8_t op_vl1; @@ -224,7 +225,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); op_vl1 = ib_port_info_get_op_vls(&p->port_info); force_update = p->need_update || sm->p_subn->need_update; @@ -249,10 +250,20 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node, p = osm_node_get_physp_ptr(node, out); force_update = p->need_update || sm->p_subn->need_update; /* go over all in ports */ - for (in = 0; in < num_ports; in++) + for (in = 0; in < num_ports; in++) { + 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, in, out, &routing_sl2vl); + port_sl2vl = &routing_sl2vl; + } if (sl2vl_update_table(sm, p, in, in << 8 | out, - force_update, &qcfg->sl2vl)) + force_update, port_sl2vl)) ret = -1; + } } return ret; @@ -262,6 +273,9 @@ static int qos_endport_setup(osm_sm_t * sm, osm_physp_t * p, const struct qos_config *qcfg, int vlarb_only) { 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)) @@ -272,7 +286,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 e7bff46..a3d09d8 100644 --- a/opensm/opensm/osm_state_mgr.c +++ b/opensm/opensm/osm_state_mgr.c @@ -1143,6 +1143,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; @@ -1273,8 +1274,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) */ @@ -1315,6 +1314,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;