From patchwork Wed Nov 28 19:03:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1817881 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E422CDF26F for ; Wed, 28 Nov 2012 19:03:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754572Ab2K1TDI (ORCPT ); Wed, 28 Nov 2012 14:03:08 -0500 Received: from mail-bk0-f46.google.com ([209.85.214.46]:61131 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754421Ab2K1TDG (ORCPT ); Wed, 28 Nov 2012 14:03:06 -0500 Received: by mail-bk0-f46.google.com with SMTP id q16so5900875bkw.19 for ; Wed, 28 Nov 2012 11:03:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=h7mhs8w3wz0hzc9XbkPayHQ3gtq2Kh+h52kmYkXxWOk=; b=GzBjz//UUBwsF+ZOTa/+jgmosebEoRYuddMyOlFvtY2HRa9hT5r7qWJcipKWff2UkM 0rVL2ErpPqMVeiPDX8gxBE9sXifyl0hSLoMELV9WtowSEumzuJJC/2BPDaAdR6CbW9Vh bFH4jkY8hXTrAu4eqJc/+rYViACgbKiYh21W8TLA+OYc+PO/nEJL1BG4kTudUeMkA8ea wYuW1OTnXwa1q8V26siZDwU0mQW9i00Vwi3O9pRDU6dHxs40dqDM8DY0Ed19efGmy8co g3QgM12vVfdBXVoUwghHpL10vqBMGf66obi5dVSCEXEYjkbyXSD8+1eYm5YOZVEq2kD+ Hhiw== Received: by 10.204.149.12 with SMTP id r12mr6015153bkv.30.1354129385227; Wed, 28 Nov 2012 11:03:05 -0800 (PST) Received: from [192.168.1.102] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id gy18sm13526231bkc.4.2012.11.28.11.03.03 (version=SSLv3 cipher=OTHER); Wed, 28 Nov 2012 11:03:04 -0800 (PST) Message-ID: <50B65FE5.1060400@dev.mellanox.co.il> Date: Wed, 28 Nov 2012 14:03:01 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" , Jim Schutt Subject: [PATCH 2/8] opensm: Add routing specific update_vlarb hook routine X-Gm-Message-State: ALoCoQmQQ0g7odf41FXEUvMPAnyTtqnYVrblbPsyHSOsYf/IiAhtB3WZp23pQKYGPkL+eo4zPFsZ Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Jim Schutt Signed-off-by: Hal Rosenstock --- include/opensm/osm_opensm.h | 12 ++++++++++++ opensm/osm_qos.c | 6 ++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/include/opensm/osm_opensm.h b/include/opensm/osm_opensm.h index 0b6e44f..b93a09a 100644 --- a/include/opensm/osm_opensm.h +++ b/include/opensm/osm_opensm.h @@ -136,6 +136,10 @@ struct osm_routing_engine { 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 (*update_vlarb)(void *context, IN osm_physp_t *port, + IN uint8_t port_num, + IN OUT ib_vl_arb_table_t *block, + unsigned block_length, unsigned block_num); uint8_t (*path_sl)(void *context, IN uint8_t path_sl_hint, IN const ib_net16_t slid, IN const ib_net16_t dlid); ib_api_status_t (*mcast_build_stree)(void *context, @@ -170,6 +174,14 @@ struct osm_routing_engine { * which part of the SL2VL map to update. For router/HCA ports, * in_port_num/out_port_num should be ignored. * +* update_vlarb(void *context, IN osm_physp_t *port, +* IN uint8_t port_num, +* IN OUT ib_vl_arb_table_t *block, +* unsigned block_length, unsigned block_num) +* The callback to allow routing engine input for VLArbitration. +* *port is the physical port for which the VLArb table is to be +* updated. +* * path_sl * The callback for computing path SL. * diff --git a/opensm/osm_qos.c b/opensm/osm_qos.c index ac15bcd..0bd116a 100644 --- a/opensm/osm_qos.c +++ b/opensm/osm_qos.c @@ -144,6 +144,7 @@ static ib_api_status_t vlarb_update_table_block(osm_sm_t * sm, unsigned block_num, cl_qlist_t *mad_list) { + struct osm_routing_engine *re = sm->p_subn->p_osm->routing_engine_used; ib_vl_arb_table_t block; uint32_t attr_mod; unsigned vl_mask, i; @@ -152,6 +153,11 @@ static ib_api_status_t vlarb_update_table_block(osm_sm_t * sm, memset(&block, 0, sizeof(block)); memcpy(&block, table_block, block_length * sizeof(block.vl_entry[0])); + + if (re && re->update_vlarb) + re->update_vlarb(re->context, p, port_num, &block, + block_length, block_num); + for (i = 0; i < block_length; i++) block.vl_entry[i].vl &= vl_mask;