opensm/osm_port: Add infrastructure for alias GUID support
PATCH 1/2 opensm/osm_port: Add infrastructure for alias GUID support
alias GUIDs are those indicated in SM GUIDInfo attribute (other than index 0) and are created/removed via SA Set/Delete of GUIDInfoRecord per IBTA MgtWG errata RefIDs 4704-4706.
Up to now, this attribute was unneeded by the SM as only base port GUIDs were supported (and are available from the SM NodeInfo attribute).
In order to support alias GUIDs, a new alias GUID table is to be added indexed by alias GUID, each containing a pointer to the base port. The routines for creating and removing alias GUID table entries are added by this patch. Also, a pointer to the alias port GUIDs provided by the SM GUIDInfo attribute is added to the osm_physp_t structure.
---
include/opensm/osm_port.h +94 -1
@@ -1,6 +1,6 @@/* * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. -* Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved. +* Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two
@@ -105,6 +105,7 @@ struct osm_mgrp; typedef struct osm_physp { ib_port_info_t port_info; ib_net64_t port_guid; + ib_net64_t (*p_guids)[]; uint8_t port_num; struct osm_node *p_node; struct osm_physp *p_remote_physp;
@@ -127,6 +128,11 @@ typedef struct osm_physp {* Port GUID value of this port. For switches, * all ports share the same GUID value. * +* p_guids +* Pointer to array of GUIDs obtained from GUIDInfo. +* This pointer is null for switch physical/external ports +* (used for endports only). +* * port_num * The port number of this port. The PortInfo also * contains a port_number, but that number is not
@@ -1456,5 +1462,92 @@ osm_physp_replace_dr_path_with_alternate_dr_path(IN osm_log_t * p_log,* PhysPort object *********/ +/****s* OpenSM: Port/osm_alias_guid_t +* NAME +* osm_alias_guid_t +* +* DESCRIPTION +* This object represents an alias guid for an endport. +* +* The osm_alias_guid_t object should be treated as opaque and should +* be manipulated only through the provided functions. +* +* SYNOPSIS +*/ +typedef struct osm_alias_guid { +cl_map_item_t map_item; +ib_net64_t alias_guid; +osm_port_t *p_base_port; +}osm_alias_guid_t ; +/* +* FIELDS +* map_item +* Linkage structure for cl_qmap. MUST BE FIRST MEMBER! +* +* alias_guid +* Alias GUID for port obtained from SM GUIDInfo attribute +* +* p_base_port +* Pointer to osm_port_t for base port GUID +* +* SEE ALSO +* Port, Physical Port, Physical Port Table +*/ + +/****f* OpenSM: Port/osm_alias_guid_new +* NAME +* osm_alias_guid_new +* +* DESCRIPTION +* This function allocates and initializes an alias guid object. +* +* SYNOPSIS +*/ +osm_alias_guid_t *osm_alias_guid_new(IN const ib_net64_t alias_guid, + IN osm_port_t *p_base_port); +/* +* PARAMETERS +* alias_guid +* [in] Alias GUID in network order +* +* p_base_port +* [in] Pointer to the port for this base GUID +* +* RETURN VALUE +* Pointer to the initialized alias guid object. +* +* NOTES +* Allows calling other alias guid methods. +* +* SEE ALSO +* Port +*********/ + +/****f* OpenSM: Port/osm_alias_guid_delete +* NAME +* osm_alias_guid_delete +* +* DESCRIPTION +* This function destroys and deallocates an alias guid object. +* +* SYNOPSIS +*/ +void osm_alias_guid_delete(IN OUT osm_alias_guid_t ** pp_alias_guid); +/* +* PARAMETERS +* pp_alias_guid +* [in][out] Pointer to a pointer to an alias guid object to delete. +* On return, this pointer is NULL. +* +* RETURN VALUE +* This function does not return a value. +* +* NOTES +* Performs any necessary cleanup of the specified alias guid object. +* +* SEE ALSO +* Port +*********/ + END_C_DECLS#endif /* _OSM_PORT_H_ */
opensm/osm_port.c +23 -1
@@ -1,6 +1,6 @@/* * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. -* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. +* Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two
@@ -67,6 +67,9 @@ void osm_physp_destroy(IN osm_physp_t * p_physp)/* the physp might be uninitialized */ if (p_physp->port_guid) { +if (p_physp->p_guids) +free (p_physp->p_guids); +/* free the SL2VL Tables */ num_slvl =cl_ptr_vector_get_size (&p_physp->slvl_by_port);for (i =0 ; i < num_slvl; i++)
@@ -632,3 +635,22 @@ void osm_physp_set_pkey_tbl(IN osm_log_t * p_log, IN const osm_subn_t * p_subn,osm_pkey_tbl_set (&p_physp->pkeys, block_num, p_pkey_tbl); } + +osm_alias_guid_t *osm_alias_guid_new(IN const ib_net64_t alias_guid, + IN osm_port_t *p_base_port) +{ +osm_alias_guid_t *p_alias_guid; + + p_alias_guid =calloc (1 ,sizeof (*p_alias_guid)); +if (p_alias_guid) { + p_alias_guid->alias_guid = alias_guid; + p_alias_guid->p_base_port = p_base_port; + } +return p_alias_guid; +} + +void osm_alias_guid_delete(IN OUT osm_alias_guid_t ** pp_alias_guid) +{ +free (*pp_alias_guid); + *pp_alias_guid =NULL ; +}
--
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
A message that is not in the archive (sent off-list or not yet received): 4DA31781.7070606-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Hi Hal,
Quoted 29 lines · Hal Rosenstock
alias GUIDs are those indicated in SM GUIDInfo attribute (other than index 0) and are created/removed via SA Set/Delete of GUIDInfoRecord per IBTA MgtWG errata RefIDs 4704-4706.
Up to now, this attribute was unneeded by the SM as only base port GUIDs were supported (and are available from the SM NodeInfo attribute).
In order to support alias GUIDs, a new alias GUID table is to be added indexed by alias GUID, each containing a pointer to the base port. The routines for creating and removing alias GUID table entries are added by this patch. Also, a pointer to the alias port GUIDs provided by the SM GUIDInfo attribute is added to the
osm_physp_tstructure.---
include/opensm/osm_port.h +1
-1@@ -1,6 +1,6 @@/* * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. -* Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved. +* Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two
include/opensm/osm_port.h struct osm_mgrp; · line 108
Quoted 4 lines
include/opensm/osm_port.h +1
-0@@ -105,6 +105,7 @@ struct osm_mgrp; typedef struct osm_physp { ib_port_info_t port_info; ib_net64_t port_guid; + ib_net64_t (*p_guids)[];
Can we use only one array for port guids? I guess port_guid would be always the first element of p_guids[].
-- Alex
--
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
A message that is not in the archive (sent off-list or not yet received): 20110420120854.GA28761-iQai9MGU/dyyaiaB+Ve85laTQe2KTcn/@public.gmane.org
Hi Alex,
Quoted 30 lines · Alex Netes
Hi Hal,
Quoted 27 lines · Hal Rosenstock
alias GUIDs are those indicated in SM GUIDInfo attribute (other than index 0) and are created/removed via SA Set/Delete of GUIDInfoRecord per IBTA MgtWG errata RefIDs 4704-4706.
Up to now, this attribute was unneeded by the SM as only base port GUIDs were supported (and are available from the SM NodeInfo attribute).
In order to support alias GUIDs, a new alias GUID table is to be added indexed by alias GUID, each containing a pointer to the base port. The routines for creating and removing alias GUID table entries are added by this patch. Also, a pointer to the alias port GUIDs provided by the SM GUIDInfo attribute is added to the
osm_physp_tstructure.---
include/opensm/osm_port.h +1
-1@@ -1,6 +1,6 @@/* * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. -* Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved. +* Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. *
Quoted 8 lines
include/opensm/osm_port.h struct osm_mgrp; · line 108
Quoted 6 lines
include/opensm/osm_port.h +1
-0* This software is available to you under a choice of one of two @@ -105,6 +105,7 @@ struct osm_mgrp; typedef struct osm_physp { ib_port_info_t port_info; ib_net64_t port_guid; + ib_net64_t (*p_guids)[];Can we use only one array for port guids?
I'm not 100% sure what you mean. There's only one array above. Do you mean that port_guid could be removed ? If so, that's not the case because the p_guids array is only allocated when alias GUIDs are being used which is not the common case.
Quoted 1 line
I guess
port_guidwould be always the first element of p_guids[].
Yes, port_guid will also be present at index 0 of p_guids array when the p_guids array is allocated.
-- Hal
Quoted 3 lines
-- Alex
--
--
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
A message that is not in the archive (sent off-list or not yet received): 4DAECF94.7000903-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org
Quoted 42 lines · Hal Rosenstock
Hi Alex,
Quoted 30 lines · Alex Netes
Hi Hal,
Quoted 27 lines · Hal Rosenstock
alias GUIDs are those indicated in SM GUIDInfo attribute (other than index 0) and are created/removed via SA Set/Delete of GUIDInfoRecord per IBTA MgtWG errata RefIDs 4704-4706.
Up to now, this attribute was unneeded by the SM as only base port GUIDs were supported (and are available from the SM NodeInfo attribute).
In order to support alias GUIDs, a new alias GUID table is to be added indexed by alias GUID, each containing a pointer to the base port. The routines for creating and removing alias GUID table entries are added by this patch. Also, a pointer to the alias port GUIDs provided by the SM GUIDInfo attribute is added to the
osm_physp_tstructure.---
include/opensm/osm_port.h +1
-1@@ -1,6 +1,6 @@/* * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. -* Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved. +* Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * Quoted 8 lines
include/opensm/osm_port.h struct osm_mgrp; · line 108
Quoted 6 lines
include/opensm/osm_port.h +1
-0* This software is available to you under a choice of one of two @@ -105,6 +105,7 @@ struct osm_mgrp; typedef struct osm_physp { ib_port_info_t port_info; ib_net64_t port_guid; + ib_net64_t (*p_guids)[];Can we use only one array for port guids?
Quoted 4 lines
I'm not 100% sure what you mean. There's only one array above. Do you mean that
port_guidcould be removed ? If so, that's not the case because thep_guidsarray is only allocated when alias GUIDs are being used which is not the common case.
I haven't seen the use you make of p_guids in your patches yet. The initialization of port_guid is done in osm_physp_init(). I guess it's possible to initialize p_guids[0] there instead of port_guid and use p_guids[0] in every places port_guid is used.
Quoted 9 lines
Quoted 2 lines
I guess
port_guidwould be always the first element of p_guids[].Yes,
port_guidwill also be present at index 0 ofp_guidsarray when thep_guidsarray is allocated.-- Hal
Quoted 1 line
Quoted 6 lines
Quoted 2 lines
-- Alex
----
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
--
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
A message that is not in the archive (sent off-list or not yet received): 20110420123947.GB28761-iQai9MGU/dyyaiaB+Ve85laTQe2KTcn/@public.gmane.org
Quoted 43 lines · Alex Netes
Quoted 42 lines · Hal Rosenstock
Hi Alex,
Quoted 38 lines · Alex Netes
Hi Hal,
Quoted 29 lines · Hal Rosenstock
alias GUIDs are those indicated in SM GUIDInfo attribute (other than index 0) and are created/removed via SA Set/Delete of GUIDInfoRecord per IBTA MgtWG errata RefIDs 4704-4706.
Up to now, this attribute was unneeded by the SM as only base port GUIDs were supported (and are available from the SM NodeInfo attribute).
In order to support alias GUIDs, a new alias GUID table is to be added indexed by alias GUID, each containing a pointer to the base port. The routines for creating and removing alias GUID table entries are added by this patch. Also, a pointer to the alias port GUIDs provided by the SM GUIDInfo attribute is added to the
osm_physp_tstructure.---
include/opensm/osm_port.h +1
-1@@ -1,6 +1,6 @@/* * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved. -* Copyright (c) 2002-2007 Mellanox Technologies LTD. All rights reserved. +* Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two include/opensm/osm_port.h struct osm_mgrp; · line 108
Quoted 4 lines
include/opensm/osm_port.h +1
-0@@ -105,6 +105,7 @@ struct osm_mgrp; typedef struct osm_physp { ib_port_info_t port_info; ib_net64_t port_guid; + ib_net64_t (*p_guids)[];Can we use only one array for port guids?
Quoted 6 lines
Quoted 4 lines
I'm not 100% sure what you mean. There's only one array above. Do you mean that
port_guidcould be removed ? If so, that's not the case because thep_guidsarray is only allocated when alias GUIDs are being used which is not the common case.I haven't seen the use you make of
p_guidsin your patches yet.
These haven;t been submitted yet.
Quoted 3 lines
The initialization of
port_guidis done inosm_physp_init(). I guess it's possible to initialize p_guids[0] there instead ofport_guidand use p_guids[0] in every placesport_guidis used.
It's possible but it requires the array to be allocated always even when alias GUIDs are not in use which is the common case. So it's a tradeoff in using one additional 64 bit field in the alias GUID case versus additional memory for the entire GUID table in the non alias GUID cases. It also would mean more code would need to change (access index 0 rather than port_guid in all such places). I chose the former approach for the reasons stated above.
-- Hal
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
I guess
port_guidwould be always the first element of p_guids[].Yes,
port_guidwill also be present at index 0 ofp_guidsarray when thep_guidsarray is allocated.-- Hal
Quoted 3 lines
-- Alex
--
\
--
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
Hi Hal,
Quoted 8 lines · Hal Rosenstock
alias GUIDs are those indicated in SM GUIDInfo attribute (other than index 0) and are created/removed via SA Set/Delete of GUIDInfoRecord per IBTA MgtWG errata RefIDs 4704-4706.
Up to now, this attribute was unneeded by the SM as only base port GUIDs were supported (and are available from the SM NodeInfo attribute).
Quoted 8 lines
In order to support alias GUIDs, a new alias GUID table is to be added indexed by alias GUID, each containing a pointer to the base port. The routines for creating and removing alias GUID table entries are added by this patch. Also, a pointer to the alias port GUIDs provided by the SM GUIDInfo attribute is added to the
osm_physp_tstructure.---
Applied. Thanks.
--
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