linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] opensm/osm_sa_pkey_record.c: optimize port selection logic
@ 2010-02-03 11:00 Sasha Khapyorsky
  0 siblings, 0 replies; only message in thread
From: Sasha Khapyorsky @ 2010-02-03 11:00 UTC (permalink / raw)
  To: linux-rdma


Optimize port selection logic when port LID is explicitly requested
or wildcarded. Remove unneeded variable.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/opensm/osm_sa_pkey_record.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/opensm/opensm/osm_sa_pkey_record.c b/opensm/opensm/osm_sa_pkey_record.c
index c4c974e..5b1c794 100644
--- a/opensm/opensm/osm_sa_pkey_record.c
+++ b/opensm/opensm/osm_sa_pkey_record.c
@@ -213,7 +213,6 @@ void osm_pkey_rec_rcv_process(IN void *ctx, IN void *data)
 	const ib_pkey_table_t *p_pkey;
 	cl_qlist_t rec_list;
 	osm_pkey_search_ctxt_t context;
-	ib_api_status_t status = IB_SUCCESS;
 	ib_net64_t comp_mask;
 	osm_physp_t *p_req_physp;
 
@@ -291,23 +290,15 @@ void osm_pkey_rec_rcv_process(IN void *ctx, IN void *data)
 	 */
 	if (comp_mask & IB_PKEY_COMPMASK_LID) {
 		p_port = osm_get_port_by_lid(sa->p_subn, p_rcvd_rec->lid);
-		if (!p_port) {
-			status = IB_NOT_FOUND;
+		if (!p_port)
 			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 460B: "
 				"No port found with LID %u\n",
 				cl_ntoh16(p_rcvd_rec->lid));
-		}
-	}
-
-	if (status == IB_SUCCESS) {
-		/* if we got a unique port - no need for a port search */
-		if (p_port)
-			/* this does the loop on all the port phys ports */
-			sa_pkey_by_comp_mask(sa, p_port, &context);
 		else
-			cl_qmap_apply_func(&sa->p_subn->port_guid_tbl,
-					   sa_pkey_by_comp_mask_cb, &context);
-	}
+			sa_pkey_by_comp_mask(sa, p_port, &context);
+	} else
+		cl_qmap_apply_func(&sa->p_subn->port_guid_tbl,
+				   sa_pkey_by_comp_mask_cb, &context);
 
 	cl_plock_release(sa->p_lock);
 
-- 
1.6.6.1

--
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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-03 11:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-03 11:00 [PATCH] opensm/osm_sa_pkey_record.c: optimize port selection logic Sasha Khapyorsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).