[openib-general] Re: [PATCH] OpenSM - osm_vendor_get_all_port_attr- add info

Yael Kalka yael at mellanox.co.il
Thu Mar 2 02:19:00 PST 2006


Hi Hal,

> -----Original Message-----
> From: openib-general-bounces at openib.org [mailto:openib-general-
> bounces at openib.org] On Behalf Of Hal Rosenstock
> Sent: Tuesday, February 28, 2006 3:39 PM
> To: Yael Kalka
> Cc: openib-general at openib.org
> Subject: [openib-general] Re: [PATCH] OpenSM -
> osm_vendor_get_all_port_attr- add info
> 
> 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 ?
[Yael Kalka] This is used for ibis, on machines with 2 HCA cards. The
report of the ports wasn't correct.
> 
> > The following patch adds this information.
> 
> Aside from being rejected and having to be applied manually, I have
some
> comments on this.
[Yael Kalka] You are right. I didn't send the full patch. Resending it
separately.

Thanks,
Yael
> 
> > 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
> 
> _______________________________________________
> openib-general mailing list
> openib-general at openib.org
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit
http://openib.org/mailman/listinfo/openib-
> general



More information about the general mailing list