From patchwork Tue Jan 5 11:23:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 70981 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 o05BKQoM007063 for ; Tue, 5 Jan 2010 11:20:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751086Ab0AELUZ (ORCPT ); Tue, 5 Jan 2010 06:20:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751203Ab0AELUZ (ORCPT ); Tue, 5 Jan 2010 06:20:25 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:40290 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086Ab0AELUY (ORCPT ); Tue, 5 Jan 2010 06:20:24 -0500 Received: by ewy19 with SMTP id 19so8306272ewy.21 for ; Tue, 05 Jan 2010 03:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=n+qUumG1NHe5MOL9JsmidjQQzxbS4O4xMJkq0JyEWT8=; b=DQieMV9B9L9lnf4pYxBOVh1xnUFwOLTulJ5shOjq6sl667oTkCzQSM1bFkPa9IXRGa wO6fPx9oKAcCQoYZHWdmdrdmkwgVV5i0tA4t0un8i72NwLLrWQgx9x69/u1dfvDSWn33 VVTtL4CNs9/zhir5HsXFWNtYiYP43LG//mDK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=faJMW76hUuhnouwCyjcSic4Qdx2WvE78HR22yYzvYxemkdhJ7oSg9Go6BkLhwccK3o owLf/C07PwNWaw0NkHRIcqYP+O/PtqaReNZi9wwjPau/4FCyV54CicnNxINr91EuYTJz P3Wa3aF7ojzh6dC3rhiQXCHc+lMCRoYDbFMkE= Received: by 10.213.0.213 with SMTP id 21mr2592239ebc.57.1262690422911; Tue, 05 Jan 2010 03:20:22 -0800 (PST) Received: from me.localdomain ([72.14.240.161]) by mx.google.com with ESMTPS id 16sm390548ewy.2.2010.01.05.03.20.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Jan 2010 03:20:21 -0800 (PST) Received: by me.localdomain (Postfix, from userid 1000) id 5ED6111DF8; Tue, 5 Jan 2010 13:23:34 +0200 (IST) Date: Tue, 5 Jan 2010 13:23:34 +0200 From: Sasha Khapyorsky To: Hal Rosenstock Cc: linux-rdma@vger.kernel.org Subject: Re: [PATCHv3] opensm: Add support for optimized SLtoVLMappingTable programming Message-ID: <20100105112334.GP26940@me> References: <20091201194110.GA26753@comcast.net> <20100105111841.GO26940@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100105111841.GO26940@me> User-Agent: Mutt/1.5.20 (2009-06-14) 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 f54e995..6bbbfa2 100644 --- a/opensm/opensm/osm_qos.c +++ b/opensm/opensm/osm_qos.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved. + * Copyright (c) 2009 HNR Consulting. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -157,14 +158,13 @@ static ib_api_status_t vlarb_update(osm_sm_t * sm, osm_physp_t * p, } static ib_api_status_t sl2vl_update_table(osm_sm_t * sm, osm_physp_t * p, - uint8_t in_port, uint8_t out_port, + uint8_t in_port, uint32_t attr_mod, unsigned force_update, const ib_slvl_table_t * sl2vl_table) { osm_madw_context_t context; ib_slvl_table_t tbl, *p_tbl; osm_node_t *p_node = osm_physp_get_node_ptr(p); - uint32_t attr_mod; ib_api_status_t status; unsigned vl_mask; uint8_t vl1, vl2; @@ -189,7 +189,6 @@ static ib_api_status_t sl2vl_update_table(osm_sm_t * sm, osm_physp_t * p, context.slvl_context.node_guid = osm_node_get_node_guid(p_node); context.slvl_context.port_guid = osm_physp_get_port_guid(p); context.slvl_context.set_method = TRUE; - attr_mod = in_port << 8 | out_port; status = osm_req_set(sm, osm_physp_get_dr_path_ptr(p), (uint8_t *) & tbl, sizeof(tbl), IB_MAD_ATTR_SLVL_TABLE, cl_hton32(attr_mod), @@ -223,12 +222,20 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node, if (!(p0->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP)) return ret; + if (ib_switch_info_get_opt_sl2vlmapping(&node->sw->switch_info) && + sm->p_subn->opt.use_optimized_slvl) { + 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, + &qcfg->sl2vl); + } + 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++) - if (sl2vl_update_table(sm, p, i, j, force_update, - &qcfg->sl2vl)) + if (sl2vl_update_table(sm, p, i, i << 8 | j, + force_update, &qcfg->sl2vl)) ret = -1; }