[openib-general] Re: [PATCH] OpenSM - osm_vendor_get_all_port_attr - add info
Hal Rosenstock
halr at voltaire.com
Tue Feb 28 05:39:29 PST 2006
Hi Yael,
On Mon, 2006-02-27 at 05:14, Yael Kalka wrote:
> Hi Hal,
>
> Currently osm_vendor_get_all_port_attr doesn't update the port number
> information.
Yes, this is currently not implemented and needed. What uses this ?
> The following patch adds this information.
Aside from being rejected and having to be applied manually, I have some
comments on this.
> Thanks,
> Yael
>
> Signed-off-by: Yael Kalka <yael at mellanox.co.il>
>
> Index: libvendor/osm_vendor_ibumad.c
> ===================================================================
> --- libvendor/osm_vendor_ibumad.c (revision 5496)
> +++ libvendor/osm_vendor_ibumad.c (working copy)
> @@ -565,8 +565,10 @@ 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 portnums[*p_num_ports];
> int linkstates[*p_num_ports];
> int *p_lid = lids;
> + int *p_portnum = portnums;
This is not used in your patch (but should be in the below loop in
osm_vendor_get_all_port_attr):
for (i = 0; p_guid < e && i < p_vend->ca_count; i++) {
...
if ((r = umad_get_ca(p_vend->ca_names[i], &ca)) == 0) {
for (j = 0; j <= ca.numports; j++) {
if (ca.ports[j]) {
*p_lid = ca.ports[j]->base_lid;
*p_linkstates = ca.ports[j]->state;
*p_portnum = ca.ports[j]->portnum; <===========
}
p_lid++;
p_linkstates++;
p_portnum++; <=================================
}
}
}
> int *p_linkstates = linkstates;
> umad_port_t def_port = {""};
> int r, i, j;
> @@ -622,6 +624,7 @@ osm_vendor_get_all_port_attr(
>
> portguids[0] = def_port.port_guid;
> lids[0] = def_port.base_lid;
> + portnums[0] = def_port.portnum;
> linkstates[0] = def_port.state;
> sm_lid = def_port.sm_lid;
>
> @@ -642,6 +645,7 @@ osm_vendor_get_all_port_attr(
> continue;
> p_attr_array[j].port_guid = portguids[i];
> p_attr_array[j].lid = lids[i];
> + p_attr_array[j].port_num = portnums[i];
> if (j == 0)
> p_attr_array[j].sm_lid = sm_lid;
> else
>
-- Hal
More information about the general
mailing list