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

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Sun Nov 11 05:55:16 PST 2007


Hi Sasha,

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.

Any particular reason why we're scanning the ports this way?
Perhaps OpenSM should iterate through nodes instead of ports
if there's no request for a specific lid/guid?

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?

-- Yevgeny



More information about the general mailing list