Speedup a port lookup over LMC array - it is not necessary to match LMC exactly for found port because base lid should be equal to requested lid masked value, so '<=' comparison should be enough and we don't need to loop up to an actual port's lmc value match.
Signed-off-by: Sasha Khapyorsky <[email protected]> --- opensm/opensm/osm_subnet.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c index 67bc7e1..30f8af5 100644 --- a/opensm/opensm/osm_subnet.c +++ b/opensm/opensm/osm_subnet.c @@ -661,7 +661,7 @@ osm_port_t *osm_get_port_by_lid(IN osm_subn_t const * subn, IN ib_net16_t lid) port = cl_ptr_vector_get(&subn->port_lid_tbl, base_lid); /* Determine if base LID "tested" is the real base LID */ /* This is true if the LMC "tested" is the port's actual LMC */ - if (port && lmc == osm_port_get_lmc(port)) + if (port && lmc <= osm_port_get_lmc(port)) return port; } -- 1.6.5.rc1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
