[ofa-general] Re: OpenSM: Bug in handling SubnAdmGet of PortInfoRecord

Sasha Khapyorsky sashak at voltaire.com
Sun Nov 11 09:02:02 PST 2007


Hi Yevgeny,

On 15:55 Sun 11 Nov     , Yevgeny Kliteynik wrote:
> 
>  I found a bug in the logic of handling SubnAdmGet method when
>  attribute is PortInfoRecord:
> 
>  When the requests comes without lid/base lid in the component
>  mask here's what OpenSM does:
> 
>     foreach *port* in fabric
>         get node of this port
>         for each port of this node
>              check if it fits the request
>                  if it does - add it to list
> 
>  More specifically, if there's a request with only a port_number
>  in the component mask, here's what OpenSM will do:
> 
>     foreach *port* in fabric
>         get node of this port
>         get port with the required port_num on this node
>         check if it fits the request
>             if it does - add it to list
> 
>  So if there is a node with two ports in the same subnet, and
>  there's a request for port_num 1, OpenSM will add the same
>  port to the list twice.

Looks like a "typical" bug (similar broken logic was used with SubnetUp
report printing).

>  Any particular reason why we're scanning the ports this way?

Don't know, I didn't work with OpenSM then.

>  Perhaps OpenSM should iterate through nodes instead of ports
>  if there's no request for a specific lid/guid?

Yes, I agree. Will you care about patch?

>  Alternatively, we can check the list for duplicated guids, but
>  it will consume some runtime.
> 
>  Also, do you know any other places in the where the same bug may happen?

This seems to be a "typical" OpenSM bug, I guess there could be more
similar places - we need to search.

Sasha



More information about the general mailing list