Skip to contentSkip to conversation

opensm/osm_sa_path_record.c: Add support for alias GUIDs

PATCH In review Hal Rosenstock 1 participant 1 message Apr 29, 2011 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 5/13 opensm/osm_sa_path_record.c: Add support for alias GUIDs

Quoted 1 line

From 9b4c9c5e455a453986413758785563be97136bf4 Mon Sep 17 00:00:00 2001

From: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/[email protected]>
Date: Thu, 28 Apr 2011 23:36:38 +0300
Subject: [PATCH] opensm/osm_sa_path_record.c: Add support for alias GUIDs

Use alias_port_guid_tbl to resolve SA path queries. Any alias GUIDs in addition to the base port GUID are present in the table based on SA sets and deletes of GUIDInfoRecord.

Use this table for any DGID/SGID queries so if alias GUID is used the alias GUID paths are also determined.

---
 include/opensm/osm_subnet.h |   30 ++++
 opensm/osm_sa_path_record.c |  371 ++++++++++++++++++++++++++++---------------
 opensm/osm_subnet.c         |   15 ++-
 3 files changed, 285 insertions(+), 131 deletions(-)
include/opensm/osm_subnet.h +30 -0
index 5c19b19..1205846 100644
@@ -1039,6 +1039,36 @@ struct osm_port *osm_get_port_by_lid_ho(const osm_subn_t * subn, uint16_t lid);
 *       Subnet object, osm_port_t
 *********/
 
+/****f* OpenSM: Subnet/osm_get_alias_guid_by_guid
+* NAME
+*	osm_get_alias_guid_by_guid
+*
+* DESCRIPTION
+*	This looks for the given port guid in the subnet table of ports by
+*	alias guid.
+*  NOTE: this code is not thread safe. Need to grab the lock before
+*  calling it.
+*
+* SYNOPSIS
+*/
+struct osm_alias_guid *osm_get_alias_guid_by_guid(IN osm_subn_t const *p_subn,
+						  IN ib_net64_t guid);
+/*
+* PARAMETERS
+*	p_subn
+*		[in] Pointer to an osm_subn_t object
+*
+*	guid
+*		[in] The alias port guid in network order
+*
+* RETURN VALUES
+*	The alias guid structure pointer if found. NULL otherwise.
+*
+* SEE ALSO
+*	Subnet object, osm_subn_construct, osm_subn_destroy,
+*	osm_alias_guid_t
+*********/
+
 /****f* OpenSM: Subnet/osm_get_port_by_alias_guid
 * NAME
 *	osm_get_port_by_alias_guid
opensm/osm_sa_path_record.c +242 -129

681 lines not on this page · raw message

opensm/osm_subnet.c +13 -2
index 32b5e1e..e8d5646 100644
@@ -651,14 +651,25 @@ osm_port_t *osm_get_port_by_guid(IN osm_subn_t const *p_subn, IN ib_net64_t guid
 	return p_port;
 }
 
-osm_port_t *osm_get_port_by_alias_guid(IN osm_subn_t const *p_subn,
-				       IN ib_net64_t guid)
+osm_alias_guid_t *osm_get_alias_guid_by_guid(IN osm_subn_t const *p_subn,
+					     IN ib_net64_t guid)
 {
 	osm_alias_guid_t *p_alias_guid;
 
 	p_alias_guid = (osm_alias_guid_t *) cl_qmap_get(&(p_subn->alias_port_guid_tbl), guid);
 	if (p_alias_guid == (osm_alias_guid_t *) cl_qmap_end(&(p_subn->alias_port_guid_tbl)))
 		return NULL;
+	return p_alias_guid;
+}
+
+osm_port_t *osm_get_port_by_alias_guid(IN osm_subn_t const *p_subn,
+				       IN ib_net64_t guid)
+{
+	osm_alias_guid_t *p_alias_guid;
+
+	p_alias_guid = osm_get_alias_guid_by_guid(p_subn, guid);
+	if (!p_alias_guid)
+		return NULL;
 	return p_alias_guid->p_base_port;
 }
 
Signature · 6 lines
1.5.3

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