Skip to contentSkip to conversation

opensm/osm_console.c: Do not perform portstatus checks on down ports

PATCH In review Albert Chu 2 participants 2 messages Feb 26, 2013 – Feb 28, 2013 1 message not in the archive InfiniBand

lore
Share & tools
lore

Albert Chu

author
#0 lore raw

PATCH 2/2 opensm/osm_console.c: Do not perform portstatus checks on down ports

Portstatus checks were performed on ports regardless of them being down or active. This could lead to confusing output from the console portstatus command.

---
 opensm/osm_console.c |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)
opensm/osm_console.c +16 -12
index 7f9a963..e3f27a2 100644
@@ -770,6 +770,22 @@ static void __get_stats(cl_map_item_t * const p_map_item, void *context)
 		port_state = ib_port_info_get_port_state(pi);
 		port_phys_state = ib_port_info_get_port_phys_state(pi);
 
+		if (port_state == IB_LINK_DOWN)
+			fs->ports_down++;
+		else if (port_state == IB_LINK_ACTIVE)
+			fs->ports_active++;
+		if (port_phys_state == IB_PORT_PHYS_STATE_DISABLED) {
+			__tag_port_report(&(fs->disabled_ports),
+					  cl_ntoh64(node->node_info.node_guid),
+					  port, node->print_desc);
+			fs->ports_disabled++;
+		}
+
+		fs->total_ports++;
+
+		if (port_state == IB_LINK_DOWN)
+			continue;
+
 		if (!(active_width & enabled_width)) {
 			__tag_port_report(&(fs->unenabled_width_ports),
 					  cl_ntoh64(node->node_info.node_guid),
@@ -872,18 +888,6 @@ static void __get_stats(cl_map_item_t * const p_map_item, void *context)
 			fs->ports_unknown_width++;
 			break;
 		}
-		if (port_state == IB_LINK_DOWN)
-			fs->ports_down++;
-		else if (port_state == IB_LINK_ACTIVE)
-			fs->ports_active++;
-		if (port_phys_state == IB_PORT_PHYS_STATE_DISABLED) {
-			__tag_port_report(&(fs->disabled_ports),
-					  cl_ntoh64(node->node_info.node_guid),
-					  port, node->print_desc);
-			fs->ports_disabled++;
-		}
-
-		fs->total_ports++;
 	}
 }
 
Signature · 8 lines
1.7.1



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1361915682.28997.12.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org