From: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: OpenIB
<general-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org>,
linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] opensm/osm_get_port_by_lid(): speedup a port lookup
Date: Tue, 29 Sep 2009 13:02:44 +0200 [thread overview]
Message-ID: <20090929110244.GL26931@me> (raw)
In-Reply-To: <20090929110215.GK26931@me>
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 <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-09-29 11:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 11:02 [PATCH] opensm/osm_get_port_by_lid(): use faster cl_ptr_vector_get() Sasha Khapyorsky
2009-09-29 11:02 ` Sasha Khapyorsky [this message]
2009-09-29 11:03 ` [PATCH] opensm/osm_get_port_by_lid(): don't bother with lmc Sasha Khapyorsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090929110244.GL26931@me \
--to=sashak-smomgflxvozwk0htik3j/w@public.gmane.org \
--cc=general-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.