[openib-general] [PATCH] osm: osm_vendor_umad to provide port state
Eitan Zahavi
eitan at mellanox.co.il
Sat Aug 20 10:48:48 PDT 2005
Hi Hal
The following patch provides port state in the result of
osm_vendor_get_all_port_attr. The port state is obtained (like lid)
from the query HCA ports and delevered in the resulting port attributes.
This enables clients of osm_vendor_api.h to knwo the state of the port
as well as a the already provided LID, GUID.
BTW: inspecting the umad vendor implementation I have found many usages of
Array Bound Variables. I wonder if we need to clean them up.
Thanks
Eitan
I tested the patch on :
2.6.12.3-smp SuSE Linux 9.3 (i586)
Signed-off-by: Eitan Zahavi <eitan at mellanox.co.il>
Index: osm/libvendor/osm_vendor_ibumad.c
===================================================================
--- osm/libvendor/osm_vendor_ibumad.c (revision 3128)
+++ osm/libvendor/osm_vendor_ibumad.c (working copy)
@@ -493,7 +493,9 @@ osm_vendor_get_all_port_attr(
ib_net64_t *p_guid = portguids, *e = portguids + *p_num_ports;
umad_ca_t ca;
int lids[*p_num_ports];
+ int linkstates[*p_num_ports];
int *p_lid = lids;
+ int *p_linkstates = linkstates;
umad_port_t def_port = {""};
int r, i, j;
@@ -527,7 +529,9 @@ osm_vendor_get_all_port_attr(
for (j = 0; j <= ca.numports; j++) {
if (ca.ports[j]) {
*p_lid = ca.ports[j]->base_lid;
- p_lid++;
+ *p_linkstates = ca.ports[j]->state;
+ p_lid++;
+ p_linkstates++;
}
}
}
@@ -544,6 +548,7 @@ osm_vendor_get_all_port_attr(
portguids[0] = def_port.port_guid;
lids[0] = def_port.base_lid;
+ linkstates[0] = def_port.state;
osm_log( p_vend->p_log, OSM_LOG_ERROR,
"osm_vendor_get_all_port_attr: "
@@ -560,6 +565,7 @@ osm_vendor_get_all_port_attr(
p_attr_array[i].port_guid = portguids[i];
p_attr_array[i].lid = lids[i];
p_attr_array[i].sm_lid = p_vend->umad_port.sm_lid;
+ p_attr_array[i].link_state = linkstates[i];
}
r = 0;
} else
More information about the general
mailing list