[ofa-general] [PATCH] opensm: switch LFTs incremental update fix

Sasha Khapyorsky sashak at voltaire.com
Wed Mar 26 10:10:48 PDT 2008


When switch is discovered first time its port links could be already
initialized by previous SM, so in this case LFTs update must be enforced
in order to overwrite an "old junk". This patch enforces sw->need_update
flag when switch is found first time.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/osm_port_info_rcv.c |    3 ++-
 opensm/opensm/osm_switch.c        |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/opensm/opensm/osm_port_info_rcv.c b/opensm/opensm/osm_port_info_rcv.c
index c0d9f1f..ff75ef0 100644
--- a/opensm/opensm/osm_port_info_rcv.c
+++ b/opensm/opensm/osm_port_info_rcv.c
@@ -314,7 +314,8 @@ __osm_pi_rcv_process_switch_port(IN osm_sm_t * sm,
 		}
 	}
 
-	if (ib_port_info_get_port_state(p_pi) > IB_LINK_INIT && p_node->sw)
+	if (ib_port_info_get_port_state(p_pi) > IB_LINK_INIT && p_node->sw &&
+	    p_node->sw->need_update == 1)
 		p_node->sw->need_update = 0;
 
 	if (p_physp->need_update)
diff --git a/opensm/opensm/osm_switch.c b/opensm/opensm/osm_switch.c
index c962be7..9623db1 100644
--- a/opensm/opensm/osm_switch.c
+++ b/opensm/opensm/osm_switch.c
@@ -100,7 +100,7 @@ osm_switch_init(IN osm_switch_t * const p_sw,
 	p_sw->p_node = p_node;
 	p_sw->switch_info = *p_si;
 	p_sw->num_ports = num_ports;
-	p_sw->need_update = 1;
+	p_sw->need_update = 2;
 
 	status = osm_fwd_tbl_init(&p_sw->fwd_tbl, p_si);
 	if (status != IB_SUCCESS)
-- 
1.5.4.1.122.gaa8d




More information about the general mailing list