From patchwork Mon Jan 25 20:22:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 75094 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0PKQwaD028350 for ; Mon, 25 Jan 2010 20:26:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751611Ab0AYU05 (ORCPT ); Mon, 25 Jan 2010 15:26:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752522Ab0AYU05 (ORCPT ); Mon, 25 Jan 2010 15:26:57 -0500 Received: from qmta08.westchester.pa.mail.comcast.net ([76.96.62.80]:37844 "EHLO qmta08.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611Ab0AYU05 (ORCPT ); Mon, 25 Jan 2010 15:26:57 -0500 Received: from omta19.westchester.pa.mail.comcast.net ([76.96.62.98]) by qmta08.westchester.pa.mail.comcast.net with comcast id Zv2K1d00b27AodY58wSviH; Mon, 25 Jan 2010 20:26:55 +0000 Received: from hal.comcast.net ([75.69.247.31]) by omta19.westchester.pa.mail.comcast.net with comcast id ZwTP1d00J0hNrtn3fwTQqh; Mon, 25 Jan 2010 20:27:24 +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 o0PKQ9nW010729; Mon, 25 Jan 2010 15:26:14 -0500 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id o0PKMmQb009203; Mon, 25 Jan 2010 15:22:48 -0500 Date: Mon, 25 Jan 2010 15:22:48 -0500 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCHv2] opensm/osm_qos.c: Eliminate unneeded endport SL to VL setup Message-ID: <20100125202247.GA9197@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_qos.c b/opensm/opensm/osm_qos.c index f814ea8..218e128 100644 --- a/opensm/opensm/osm_qos.c +++ b/opensm/opensm/osm_qos.c @@ -243,13 +243,15 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node, } static int qos_endport_setup(osm_sm_t * sm, osm_physp_t * p, - const struct qos_config *qcfg) + const struct qos_config *qcfg, int vlarb_only) { unsigned force_update = p->need_update || sm->p_subn->need_update; p->vl_high_limit = qcfg->vl_high_limit; if (vlarb_update(sm, p, 0, force_update, qcfg)) return -1; + if (vlarb_only) + return 0; if (!(p->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP)) return 0; @@ -269,6 +271,7 @@ int osm_qos_setup(osm_opensm_t * p_osm) osm_port_t *p_port; osm_node_t *p_node; int ret = 0; + int vlarb_only; if (!p_osm->subn.opt.qos) return 0; @@ -292,6 +295,7 @@ int osm_qos_setup(osm_opensm_t * p_osm) p_tbl = &p_osm->subn.port_guid_tbl; p_next = cl_qmap_head(p_tbl); while (p_next != cl_qmap_end(p_tbl)) { + vlarb_only = 0; p_port = (osm_port_t *) p_next; p_next = cl_qmap_next(p_next); @@ -305,13 +309,20 @@ int osm_qos_setup(osm_opensm_t * p_osm) (&p_node->sw->switch_info)) continue; + if (ib_switch_info_get_opt_sl2vlmapping(&p_node->sw->switch_info) && + p_osm->sm.p_subn->opt.use_optimized_slvl && + !memcmp(&swe_config.sl2vl, &sw0_config.sl2vl, + sizeof(swe_config.sl2vl))) + vlarb_only = 1; + cfg = &sw0_config; } else if (osm_node_get_type(p_node) == IB_NODE_TYPE_ROUTER) cfg = &rtr_config; else cfg = &ca_config; - if (qos_endport_setup(&p_osm->sm, p_port->p_physp, cfg)) + if (qos_endport_setup(&p_osm->sm, p_port->p_physp, cfg, + vlarb_only)) ret = -1; }