diff mbox

[25/27] Increase p_port->discovery_count only when received PortInfo for port 0 of the switch

Message ID 1343750695-28063-25-git-send-email-alexne@mellanox.com (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Alex Netes July 31, 2012, 4:04 p.m. UTC
Some broken SMA may respond to all MADs except of PortInfo port 0. As a result we want
to drop such switch as it's not healthy.

Signed-off-by: Alex Netes <alexne@mellanox.com>
---
 opensm/osm_port_info_rcv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c
index ab7418b..692dc2e 100644
--- a/opensm/osm_port_info_rcv.c
+++ b/opensm/osm_port_info_rcv.c
@@ -568,7 +568,6 @@  void osm_pi_rcv_process(IN void *context, IN void *data)
 	if (p_context->set_method)
 		pi_rcv_process_set(sm, p_node, port_num, p_madw);
 	else {
-		p_port->discovery_count++;
 
 		/*
 		   This PortInfo arrived because we did a Get() method,
@@ -600,10 +599,13 @@  void osm_pi_rcv_process(IN void *context, IN void *data)
 		switch (osm_node_get_type(p_node)) {
 		case IB_NODE_TYPE_CA:
 		case IB_NODE_TYPE_ROUTER:
+			p_port->discovery_count++;
 			pi_rcv_process_ca_or_router_port(sm, p_node, p_physp,
 							 p_pi);
 			break;
 		case IB_NODE_TYPE_SWITCH:
+			if (port_num == 0)
+				p_port->discovery_count++;
 			pi_rcv_process_switch_port(sm, p_node, p_physp, p_pi);
 			break;
 		default: