* [PATCH 2/2] opensm/osm_console.c: Do not perform portstatus checks on down ports
@ 2013-02-26 21:54 Albert Chu
[not found] ` <1361915682.28997.12.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Albert Chu @ 2013-02-26 21:54 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Portstatus checks were performed on ports regardless of them being
down or active. This could lead to confusing output from the console
portstatus command.
Signed-off-by: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
---
opensm/osm_console.c | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/opensm/osm_console.c b/opensm/osm_console.c
index 7f9a963..e3f27a2 100644
--- a/opensm/osm_console.c
+++ b/opensm/osm_console.c
@@ -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++;
}
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] opensm/osm_console.c: Do not perform portstatus checks on down ports
[not found] ` <1361915682.28997.12.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
@ 2013-02-28 15:35 ` Hal Rosenstock
0 siblings, 0 replies; 2+ messages in thread
From: Hal Rosenstock @ 2013-02-28 15:35 UTC (permalink / raw)
To: Albert Chu; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
On 2/26/2013 4:54 PM, Albert Chu wrote:
> Portstatus checks were performed on ports regardless of them being
> down or active. This could lead to confusing output from the console
> portstatus command.
>
> Signed-off-by: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Thanks. Applied.
-- Hal
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-28 15:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-26 21:54 [PATCH 2/2] opensm/osm_console.c: Do not perform portstatus checks on down ports Albert Chu
[not found] ` <1361915682.28997.12.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
2013-02-28 15:35 ` Hal Rosenstock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox