diff mbox

[2/8] opensm: Add routing specific update_vlarb hook routine

Message ID 50B65FE5.1060400@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock Nov. 28, 2012, 7:03 p.m. UTC
Signed-off-by: Jim Schutt <jaschut@sandia.gov>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 include/opensm/osm_opensm.h |   12 ++++++++++++
 opensm/osm_qos.c            |    6 ++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
diff mbox

Patch

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;