[openib-general] OpenSM: Add support for optional SA GUIDInfoRecord
Hal Rosenstock
halr at voltaire.com
Fri Jan 27 12:55:45 PST 2006
OpenSM: Add support for optional SA GUIDInfoRecord
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Index: osm/include/opensm/osm_sa_guidinfo_record.h
===================================================================
--- osm/include/opensm/osm_sa_guidinfo_record.h (revision 0)
+++ osm/include/opensm/osm_sa_guidinfo_record.h (revision 0)
@@ -0,0 +1,283 @@
+/*
+ * Copyright (c) 2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2005 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
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id: $
+ */
+
+
+/*
+ * Abstract:
+ * Declaration of osm_gir_rcv_t.
+ * This object represents the GUIDInfo Record Receiver object.
+ * attribute from a node.
+ * This object is part of the OpenSM family of objects.
+ *
+ * Environment:
+ * Linux User Mode
+ *
+ */
+
+
+#ifndef _OSM_GIR_RCV_H_
+#define _OSM_GIR_RCV_H_
+
+
+#include <complib/cl_passivelock.h>
+#include <complib/cl_qlist.h>
+#include <opensm/osm_base.h>
+#include <opensm/osm_madw.h>
+#include <opensm/osm_sa_response.h>
+#include <opensm/osm_subnet.h>
+#include <opensm/osm_port.h>
+#include <opensm/osm_log.h>
+
+#ifdef __cplusplus
+# define BEGIN_C_DECLS extern "C" {
+# define END_C_DECLS }
+#else /* !__cplusplus */
+# define BEGIN_C_DECLS
+# define END_C_DECLS
+#endif /* __cplusplus */
+
+BEGIN_C_DECLS
+
+/****h* OpenSM/GUIDInfo Record Receiver
+* NAME
+* GUIDInfo Record Receiver
+*
+* DESCRIPTION
+* The GUIDInfo Record Receiver object encapsulates the information
+* needed to receive the GUIDInfoRecord attribute from a node.
+*
+* The GUIDInfo Record Receiver object is thread safe.
+*
+* This object should be treated as opaque and should be
+* manipulated only through the provided functions.
+*
+* AUTHOR
+* Hal Rosenstock, Voltaire
+*
+*********/
+/****s* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_t
+* NAME
+* osm_gir_rcv_t
+*
+* DESCRIPTION
+* GUIDInfo Record Receiver structure.
+*
+* This object should be treated as opaque and should
+* be manipulated only through the provided functions.
+*
+* SYNOPSIS
+*/
+typedef struct _osm_gir_rcv
+{
+ const osm_subn_t *p_subn;
+ osm_sa_resp_t *p_resp;
+ osm_mad_pool_t *p_mad_pool;
+ osm_log_t *p_log;
+ cl_plock_t *p_lock;
+ cl_qlock_pool_t pool;
+
+} osm_gir_rcv_t;
+/*
+* FIELDS
+* p_subn
+* Pointer to the Subnet object for this subnet.
+*
+* p_resp
+* Pointer to the SA reponder.
+*
+* p_mad_pool
+* Pointer to the mad pool.
+*
+* p_log
+* Pointer to the log object.
+*
+* p_lock
+* Pointer to the serializing lock.
+*
+* pool
+* Pool of linkable GUIDInfo Record objects used to generate
+* the query response.
+*
+* SEE ALSO
+*
+*********/
+
+/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_construct
+* NAME
+* osm_gir_rcv_construct
+*
+* DESCRIPTION
+* This function constructs a GUIDInfo Record Receiver object.
+*
+* SYNOPSIS
+*/
+void
+osm_gir_rcv_construct(
+ IN osm_gir_rcv_t* const p_rcv );
+/*
+* PARAMETERS
+* p_rcv
+* [in] Pointer to a GUIDInfo Record Receiver object to construct.
+*
+* RETURN VALUE
+* This function does not return a value.
+*
+* NOTES
+* Allows calling osm_gir_rcv_init, osm_gir_rcv_destroy
+*
+* Calling osm_gir_rcv_construct is a prerequisite to calling any other
+* method except osm_gir_rcv_init.
+*
+* SEE ALSO
+* GUIDInfo Record Receiver object, osm_gir_rcv_init,
+* osm_gir_rcv_destroy
+*********/
+
+/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_destroy
+* NAME
+* osm_gir_rcv_destroy
+*
+* DESCRIPTION
+* The osm_gir_rcv_destroy function destroys the object, releasing
+* all resources.
+*
+* SYNOPSIS
+*/
+void
+osm_gir_rcv_destroy(
+ IN osm_gir_rcv_t* const p_rcv );
+/*
+* PARAMETERS
+* p_rcv
+* [in] Pointer to the object to destroy.
+*
+* RETURN VALUE
+* This function does not return a value.
+*
+* NOTES
+* Performs any necessary cleanup of the specified
+* GUIDInfo Record Receiver object.
+* Further operations should not be attempted on the destroyed object.
+* This function should only be called after a call to
+* osm_gir_rcv_construct or osm_gir_rcv_init.
+*
+* SEE ALSO
+* GUIDInfo Record Receiver object, osm_gir_rcv_construct,
+* osm_gir_rcv_init
+*********/
+
+/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_init
+* NAME
+* osm_gir_rcv_init
+*
+* DESCRIPTION
+* The osm_gir_rcv_init function initializes a
+* GUIDInfo Record Receiver object for use.
+*
+* SYNOPSIS
+*/
+ib_api_status_t
+osm_gir_rcv_init(
+ IN osm_gir_rcv_t* const p_rcv,
+ IN osm_sa_resp_t* const p_resp,
+ IN osm_mad_pool_t* const p_mad_pool,
+ IN const osm_subn_t* const p_subn,
+ IN osm_log_t* const p_log,
+ IN cl_plock_t* const p_lock );
+/*
+* PARAMETERS
+* p_rcv
+* [in] Pointer to an osm_gir_rcv_t object to initialize.
+*
+* p_req
+* [in] Pointer to an osm_req_t object.
+*
+* p_subn
+* [in] Pointer to the Subnet object for this subnet.
+*
+* p_log
+* [in] Pointer to the log object.
+*
+* p_lock
+* [in] Pointer to the OpenSM serializing lock.
+*
+* RETURN VALUES
+* CL_SUCCESS if the GUIDInfo Record Receiver object was initialized
+* successfully.
+*
+* NOTES
+* Allows calling other GUIDInfo Record Receiver methods.
+*
+* SEE ALSO
+* GUIDInfo Record Receiver object, osm_gir_rcv_construct,
+* osm_gir_rcv_destroy
+*********/
+
+/****f* OpenSM: GUIDInfo Record Receiver/osm_gir_rcv_process
+* NAME
+* osm_gir_rcv_process
+*
+* DESCRIPTION
+* Process the GUIDInfoRecord attribute.
+*
+* SYNOPSIS
+*/
+void
+osm_gir_rcv_process(
+ IN osm_gir_rcv_t* const p_rcv,
+ IN const osm_madw_t* const p_madw );
+/*
+* PARAMETERS
+* p_rcv
+* [in] Pointer to an osm_gir_rcv_t object.
+*
+* p_madw
+* [in] Pointer to the MAD Wrapper containing the MAD
+* that contains the node's GUIDInfoRecord attribute.
+*
+* RETURN VALUES
+* CL_SUCCESS if the GUIDInfoRecord processing was successful.
+*
+* NOTES
+* This function processes a GUIDInfoRecord attribute.
+*
+* SEE ALSO
+* GUIDInfo Record Receiver, GUIDInfo Record Response Controller
+*********/
+
+END_C_DECLS
+
+#endif /* _OSM_GIR_RCV_H_ */
Property changes on: osm/include/opensm/osm_sa_guidinfo_record.h
___________________________________________________________________
Name: svn:keywords
+ Id
Index: osm/include/opensm/osm_helper.h
===================================================================
--- osm/include/opensm/osm_helper.h (revision 5193)
+++ osm/include/opensm/osm_helper.h (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
*
@@ -247,6 +247,12 @@ osm_dump_portinfo_record(
IN const osm_log_level_t log_level );
void
+osm_dump_guidinfo_record(
+ IN osm_log_t* const p_log,
+ IN const ib_guidinfo_record_t* const p_gir,
+ IN const osm_log_level_t log_level );
+
+void
osm_dump_inform_info(
IN osm_log_t* const p_log,
IN const ib_inform_info_t* const p_ii,
Index: osm/include/opensm/osm_sa.h
===================================================================
--- osm/include/opensm/osm_sa.h (revision 5193)
+++ osm/include/opensm/osm_sa.h (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
*
@@ -64,6 +64,7 @@
#include <opensm/osm_log.h>
#include <opensm/osm_sa_node_record_ctrl.h>
#include <opensm/osm_sa_portinfo_record_ctrl.h>
+#include <opensm/osm_sa_guidinfo_record_ctrl.h>
#include <opensm/osm_sa_link_record_ctrl.h>
#include <opensm/osm_sa_path_record_ctrl.h>
#include <opensm/osm_sa_sminfo_record_ctrl.h>
@@ -154,6 +155,8 @@ typedef struct _osm_sa
osm_nr_rcv_ctrl_t nr_rcv_ctrl;
osm_pir_rcv_t pir_rcv;
osm_pir_rcv_ctrl_t pir_rcv_ctrl;
+ osm_gir_rcv_t gir_rcv;
+ osm_gir_rcv_ctrl_t gir_rcv_ctrl;
osm_lr_rcv_t lr_rcv;
osm_lr_rcv_ctrl_t lr_rcv_ctrl;
osm_pr_rcv_t pr_rcv;
Index: osm/include/opensm/osm_msgdef.h
===================================================================
--- osm/include/opensm/osm_msgdef.h (revision 5193)
+++ osm/include/opensm/osm_msgdef.h (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
*
@@ -191,6 +191,7 @@ enum
OSM_MSG_MAD_PKEY,
OSM_MSG_MAD_VL_ARB,
OSM_MSG_MAD_SLVL,
+ OSM_MSG_MAD_GUIDINFO_RECORD,
OSM_MSG_MAX
};
Index: osm/include/opensm/osm_sa_guidinfo_record_ctrl.h
===================================================================
--- osm/include/opensm/osm_sa_guidinfo_record_ctrl.h (revision 0)
+++ osm/include/opensm/osm_sa_guidinfo_record_ctrl.h (revision 0)
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2005 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
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id: $
+ */
+
+
+/*
+ * Abstract:
+ * Declaration of osm_sa_gir_rec_rcv_ctrl_t.
+ * This object represents a controller that receives the IBA GUID Info
+ * record query from SA client.
+ * This object is part of the OpenSM family of objects.
+ *
+ * Environment:
+ * Linux User Mode
+ *
+ */
+
+
+#ifndef _OSM_GIR_CTRL_H_
+#define _OSM_GIR_CTRL_H_
+
+
+#include <complib/cl_dispatcher.h>
+#include <opensm/osm_base.h>
+#include <opensm/osm_madw.h>
+#include <opensm/osm_log.h>
+#include <opensm/osm_sa_guidinfo_record.h>
+
+#ifdef __cplusplus
+# define BEGIN_C_DECLS extern "C" {
+# define END_C_DECLS }
+#else /* !__cplusplus */
+# define BEGIN_C_DECLS
+# define END_C_DECLS
+#endif /* __cplusplus */
+
+BEGIN_C_DECLS
+
+/****h* OpenSM/GUID Info Record Receive Controller
+* NAME
+* GUID Info Record Receive Controller
+*
+* DESCRIPTION
+* The GUID Info Record Receive Controller object encapsulates
+* the information needed to handle GUID Info record query from SA client.
+*
+* The GUID Info Record Receive Controller object is thread safe.
+*
+* This object should be treated as opaque and should be
+* manipulated only through the provided functions.
+*
+* AUTHOR
+* Hal Rosenstock, Voltaire
+*
+*********/
+/****s* OpenSM: GUID Info Record Receive Controller/osm_gir_rcv_ctrl_t
+* NAME
+* osm_gir_rcv_ctrl_t
+*
+* DESCRIPTION
+* GUID Info Record Receive Controller structure.
+*
+* This object should be treated as opaque and should
+* be manipulated only through the provided functions.
+*
+* SYNOPSIS
+*/
+typedef struct _osm_gir_rcv_ctrl
+{
+ osm_gir_rcv_t *p_rcv;
+ osm_log_t *p_log;
+ cl_dispatcher_t *p_disp;
+ cl_disp_reg_handle_t h_disp;
+
+} osm_gir_rcv_ctrl_t;
+/*
+* FIELDS
+* p_rcv
+* Pointer to the GUID Info Record Receiver object.
+*
+* p_log
+* Pointer to the log object.
+*
+* p_disp
+* Pointer to the Dispatcher.
+*
+* h_disp
+* Handle returned from dispatcher registration.
+*
+* SEE ALSO
+* GUID Info Record Receive Controller object
+* GUID Info Record Receiver object
+*********/
+
+/****f* OpenSM: GUID Info Record Receive Controller/osm_gir_rec_rcv_ctrl_construct
+* NAME
+* osm_gir_rcv_ctrl_construct
+*
+* DESCRIPTION
+* This function constructs a GUID Info Record Receive Controller object.
+*
+* SYNOPSIS
+*/
+void osm_gir_rcv_ctrl_construct(
+ IN osm_gir_rcv_ctrl_t* const p_ctrl );
+/*
+* PARAMETERS
+* p_ctrl
+* [in] Pointer to a GUID Info Record Receive Controller
+* object to construct.
+*
+* RETURN VALUE
+* This function does not return a value.
+*
+* NOTES
+* Allows calling osm_gir_rcv_ctrl_init, osm_gir_rcv_ctrl_destroy
+*
+* Calling osm_gir_rcv_ctrl_construct is a prerequisite to calling any other
+* method except osm_gir_rcv_ctrl_init.
+*
+* SEE ALSO
+* GUID Info Record Receive Controller object, osm_gir_rcv_ctrl_init,
+* osm_gir_rcv_ctrl_destroy
+*********/
+
+/****f* OpenSM: GUID Info Record Receive Controller/osm_gir_rcv_ctrl_destroy
+* NAME
+* osm_gir_rcv_ctrl_destroy
+*
+* DESCRIPTION
+* The osm_gir_rcv_ctrl_destroy function destroys the object, releasing
+* all resources.
+*
+* SYNOPSIS
+*/
+void osm_gir_rcv_ctrl_destroy(
+ IN osm_gir_rcv_ctrl_t* const p_ctrl );
+/*
+* PARAMETERS
+* p_ctrl
+* [in] Pointer to the object to destroy.
+*
+* RETURN VALUE
+* This function does not return a value.
+*
+* NOTES
+* Performs any necessary cleanup of the specified
+* GUIDInfo Record Receive Controller object.
+* Further operations should not be attempted on the destroyed object.
+* This function should only be called after a call to
+* osm_gir_rcv_ctrl_construct or osm_gir_rcv_ctrl_init.
+*
+* SEE ALSO
+* GUIDInfo Record Receive Controller object, osm_gir_rcv_ctrl_construct,
+* osm_gir_rcv_ctrl_init
+*********/
+
+/****f* OpenSM: GUID Info Record Receive Controller/osm_gir_rcv_ctrl_init
+* NAME
+* osm_gir_rcv_ctrl_init
+*
+* DESCRIPTION
+* The osm_gir_rcv_ctrl_init function initializes a
+* GUID Info Record Receive Controller object for use.
+*
+* SYNOPSIS
+*/
+ib_api_status_t osm_gir_rcv_ctrl_init(
+ IN osm_gir_rcv_ctrl_t* const p_ctrl,
+ IN osm_gir_rcv_t* const p_rcv,
+ IN osm_log_t* const p_log,
+ IN cl_dispatcher_t* const p_disp );
+/*
+* PARAMETERS
+* p_ctrl
+* [in] Pointer to an osm_gir_rcv_ctrl_t object to initialize.
+*
+* p_rcv
+* [in] Pointer to an osm_gir_rcv_t object.
+*
+* p_log
+* [in] Pointer to the log object.
+*
+* p_disp
+* [in] Pointer to the OpenSM central Dispatcher.
+*
+* RETURN VALUES
+* CL_SUCCESS if the GUID Info Record Receive Controller object was initialized
+* successfully.
+*
+* NOTES
+* Allows calling other GUID Info Record Receive Controller methods.
+*
+* SEE ALSO
+* GUID Info Record Receive Controller object, osm_gir_rcv_ctrl_construct,
+* osm_gir_rcv_ctrl_destroy
+*********/
+
+END_C_DECLS
+
+#endif /* _OSM_GIR_CTRL_H_ */
Property changes on: osm/include/opensm/osm_sa_guidinfo_record_ctrl.h
___________________________________________________________________
Name: svn:keywords
+ Id
Index: osm/include/Makefile.am
===================================================================
--- osm/include/Makefile.am (revision 5193)
+++ osm/include/Makefile.am (working copy)
@@ -5,6 +5,7 @@ nobase_pkginclude_HEADERS = iba/ib_types
EXTRA_DIST = \
$(srcdir)/opensm/osm_version.h \
$(srcdir)/opensm/osm_sa_portinfo_record_ctrl.h \
+ $(srcdir)/opensm/osm_sa_guidinfo_record_ctrl.h \
$(srcdir)/opensm/osm_sa_path_record.h \
$(srcdir)/opensm/osm_lid_mgr.h \
$(srcdir)/opensm/osm_vl_arb_rcv.h \
@@ -33,6 +34,7 @@ EXTRA_DIST = \
$(srcdir)/opensm/osm_sa_pkey_record_ctrl.h \
$(srcdir)/opensm/osm_helper.h \
$(srcdir)/opensm/osm_sa_portinfo_record.h \
+ $(srcdir)/opensm/osm_sa_guidinfo_record.h \
$(srcdir)/opensm/osm_sa_service_record.h \
$(srcdir)/opensm/osm_sa_response.h \
$(srcdir)/opensm/osm_node.h \
Index: osm/include/iba/ib_types.h
===================================================================
--- osm/include/iba/ib_types.h (revision 5193)
+++ osm/include/iba/ib_types.h (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
*
@@ -1109,6 +1109,18 @@ ib_class_is_vendor_specific(
#define IB_MAD_ATTR_SMINFO_RECORD (CL_NTOH16(0x0018))
/**********/
+/****d* IBA Base: Constants/IB_MAD_ATTR_GUIDINFO_RECORD
+* NAME
+* IB_MAD_ATTR_GUIDINFO_RECORD
+*
+* DESCRIPTION
+* GuidInfoRecord attribute (15.2.5)
+*
+* SOURCE
+*/
+#define IB_MAD_ATTR_GUIDINFO_RECORD (CL_NTOH16(0x0030))
+/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_VENDOR_DIAG
* NAME
* IB_MAD_ATTR_VENDOR_DIAG
@@ -1120,6 +1132,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_VENDOR_DIAG (CL_NTOH16(0x0030))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_LED_INFO
* NAME
* IB_MAD_ATTR_LED_INFO
@@ -1131,6 +1144,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_LED_INFO (CL_NTOH16(0x0031))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_RECORD
* NAME
* IB_MAD_ATTR_SERVICE_RECORD
@@ -1142,6 +1156,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_SERVICE_RECORD (CL_NTOH16(0x0031))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_LFT_RECORD
* NAME
* IB_MAD_ATTR_LFT_RECORD
@@ -1153,6 +1168,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_LFT_RECORD (CL_NTOH16(0x0015))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_PKEYTBL_RECORD
* NAME
* IB_MAD_ATTR_PKEYTBL_RECORD
@@ -1164,6 +1180,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_PKEY_TBL_RECORD (CL_NTOH16(0x0033))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_PATH_RECORD
* NAME
* IB_MAD_ATTR_PATH_RECORD
@@ -1175,6 +1192,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_PATH_RECORD (CL_NTOH16(0x0035))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_VLARB_RECORD
* NAME
* IB_MAD_ATTR_VLARB_RECORD
@@ -1186,6 +1204,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_VLARB_RECORD (CL_NTOH16(0x0036))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_SLVL_RECORD
* NAME
* IB_MAD_ATTR_SLVL_RECORD
@@ -1197,6 +1216,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_SLVL_RECORD (CL_NTOH16(0x0013))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_MCMEMBER_RECORD
* NAME
* IB_MAD_ATTR_MCMEMBER_RECORD
@@ -1208,6 +1228,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_MCMEMBER_RECORD (CL_NTOH16(0x0038))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_TRACE_RECORD
* NAME
* IB_MAD_ATTR_MTRACE_RECORD
@@ -1219,6 +1240,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_TRACE_RECORD (CL_NTOH16(0x0039))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_MULTIPATH_RECORD
* NAME
* IB_MAD_ATTR_MULTIPATH_RECORD
@@ -1230,6 +1252,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_MULTIPATH_RECORD (CL_NTOH16(0x003A))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
* NAME
* IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
@@ -1241,6 +1264,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD (CL_NTOH16(0x003B))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_IO_UNIT_INFO
* NAME
* IB_MAD_ATTR_IO_UNIT_INFO
@@ -1252,6 +1276,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_IO_UNIT_INFO (CL_NTOH16(0x0010))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_IO_CONTROLLER_PROFILE
* NAME
* IB_MAD_ATTR_IO_CONTROLLER_PROFILE
@@ -1263,6 +1288,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_IO_CONTROLLER_PROFILE (CL_NTOH16(0x0011))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_ENTRIES
* NAME
* IB_MAD_ATTR_SERVICE_ENTRIES
@@ -1274,6 +1300,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_SERVICE_ENTRIES (CL_NTOH16(0x0012))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT
* NAME
* IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT
@@ -1285,6 +1312,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT (CL_NTOH16(0x0020))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_PREPARE_TO_TEST
* NAME
* IB_MAD_ATTR_PREPARE_TO_TEST
@@ -1296,6 +1324,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_PREPARE_TO_TEST (CL_NTOH16(0x0021))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_ONCE
* NAME
* IB_MAD_ATTR_TEST_DEVICE_ONCE
@@ -1307,6 +1336,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_TEST_DEVICE_ONCE (CL_NTOH16(0x0022))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_LOOP
* NAME
* IB_MAD_ATTR_TEST_DEVICE_LOOP
@@ -1318,6 +1348,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_TEST_DEVICE_LOOP (CL_NTOH16(0x0023))
/**********/
+
/****d* IBA Base: Constants/IB_MAD_ATTR_DIAG_CODE
* NAME
* IB_MAD_ATTR_DIAG_CODE
@@ -1341,6 +1372,7 @@ ib_class_is_vendor_specific(
*/
#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD (CL_NTOH16(0x003B))
/**********/
+
/****d* IBA Base: Constants/IB_NODE_TYPE_CA
* NAME
* IB_NODE_TYPE_CA
@@ -1352,6 +1384,7 @@ ib_class_is_vendor_specific(
*/
#define IB_NODE_TYPE_CA 0x01
/**********/
+
/****d* IBA Base: Constants/IB_NODE_TYPE_SWITCH
* NAME
* IB_NODE_TYPE_SWITCH
@@ -1363,6 +1396,7 @@ ib_class_is_vendor_specific(
*/
#define IB_NODE_TYPE_SWITCH 0x02
/**********/
+
/****d* IBA Base: Constants/IB_NODE_TYPE_ROUTER
* NAME
* IB_NODE_TYPE_ROUTER
@@ -1386,6 +1420,7 @@ ib_class_is_vendor_specific(
*/
#define IB_NOTICE_NODE_TYPE_CA (CL_NTOH32(0x000001))
/**********/
+
/****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SWITCH
* NAME
* IB_NOTICE_NODE_TYPE_SWITCH
@@ -1397,6 +1432,7 @@ ib_class_is_vendor_specific(
*/
#define IB_NOTICE_NODE_TYPE_SWITCH (CL_NTOH32(0x000002))
/**********/
+
/****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_ROUTER
* NAME
* IB_NOTICE_NODE_TYPE_ROUTER
@@ -1408,6 +1444,7 @@ ib_class_is_vendor_specific(
*/
#define IB_NOTICE_NODE_TYPE_ROUTER (CL_NTOH32(0x000003))
/**********/
+
/****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SUBN_MGMT
* NAME
* IB_NOTICE_NODE_TYPE_SUBN_MGMT
@@ -2148,18 +2185,22 @@ typedef struct _ib_path_rec
#define IB_VLA_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
#define IB_VLA_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<1))
#define IB_VLA_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<2))
+
/* SLtoVL Mapping Record Masks */
#define IB_SLVL_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
#define IB_SLVL_COMPMASK_IN_PORT (CL_HTON64(((uint64_t)1)<<1))
#define IB_SLVL_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<2))
+
/* P_Key Table Record Masks */
#define IB_PKEY_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
#define IB_PKEY_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1))
#define IB_PKEY_COMPMASK_PORT (CL_HTON64(((uint64_t)1)<<2))
-/* LFT Record MASKS */
+
+/* LFT Record Masks */
#define IB_LFTR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
#define IB_LFTR_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1))
-/* ModeInfo Record MASKS */
+
+/* NodeInfo Record Masks */
#define IB_NR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
#define IB_NR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<1))
#define IB_NR_COMPMASK_BASEVERSION (CL_HTON64(((uint64_t)1)<<2))
@@ -2175,6 +2216,7 @@ typedef struct _ib_path_rec
#define IB_NR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<12))
#define IB_NR_COMPMASK_VENDID (CL_HTON64(((uint64_t)1)<<13))
#define IB_NR_COMPMASK_NODEDESC (CL_HTON64(((uint64_t)1)<<14))
+
/* Service Record Component Mask Sec 15.2.5.14 Ver 1.1*/
#define IB_SR_COMPMASK_SID (CL_HTON64(((uint64_t)1)<<0))
#define IB_SR_COMPMASK_SGID (CL_HTON64(((uint64_t)1)<<1))
@@ -2213,6 +2255,7 @@ typedef struct _ib_path_rec
#define IB_SR_COMPMASK_SDATA32_3 (CL_HTON64(((uint64_t)1)<<34))
#define IB_SR_COMPMASK_SDATA64_0 (CL_HTON64(((uint64_t)1)<<35))
#define IB_SR_COMPMASK_SDATA64_1 (CL_HTON64(((uint64_t)1)<<36))
+
/* Port Info Record Component Masks */
#define IB_PIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
#define IB_PIR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<1))
@@ -2263,6 +2306,7 @@ typedef struct _ib_path_rec
#define IB_PIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<46))
#define IB_PIR_COMPMASK_LOCALPHYERR (CL_HTON64(((uint64_t)1)<<47))
#define IB_PIR_COMPMASK_OVERRUNERR (CL_HTON64(((uint64_t)1)<<48))
+
/* Multicast Member Record Component Masks */
#define IB_MCR_COMPMASK_GID (CL_HTON64(((uint64_t)1)<<0))
#define IB_MCR_COMPMASK_MGID (CL_HTON64(((uint64_t)1)<<0))
@@ -2284,6 +2328,20 @@ typedef struct _ib_path_rec
#define IB_MCR_COMPMASK_JOIN_STATE (CL_HTON64(((uint64_t)1)<<16))
#define IB_MCR_COMPMASK_PROXY (CL_HTON64(((uint64_t)1)<<17))
+/* GUID Info Record Component Masks */
+#define IB_GIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
+#define IB_GIR_COMPMASK_BLOCKNUM (CL_HTON64(((uint64_t)1)<<1))
+#define IB_GIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<2))
+#define IB_GIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<3))
+#define IB_GIR_COMPMASK_GID0 (CL_HTON64(((uint64_t)1)<<4))
+#define IB_GIR_COMPMASK_GID1 (CL_HTON64(((uint64_t)1)<<5))
+#define IB_GIR_COMPMASK_GID2 (CL_HTON64(((uint64_t)1)<<6))
+#define IB_GIR_COMPMASK_GID3 (CL_HTON64(((uint64_t)1)<<7))
+#define IB_GIR_COMPMASK_GID4 (CL_HTON64(((uint64_t)1)<<8))
+#define IB_GIR_COMPMASK_GID5 (CL_HTON64(((uint64_t)1)<<9))
+#define IB_GIR_COMPMASK_GID6 (CL_HTON64(((uint64_t)1)<<10))
+#define IB_GIR_COMPMASK_GID7 (CL_HTON64(((uint64_t)1)<<11))
+
/****f* IBA Base: Types/ib_path_rec_init_local
* NAME
* ib_path_rec_init_local
@@ -5383,6 +5441,17 @@ typedef struct _ib_guid_info
#include <complib/cl_packoff.h>
/************/
+#include <complib/cl_packon.h>
+typedef struct _ib_guidinfo_record
+{
+ ib_net16_t lid;
+ uint8_t block_num;
+ uint8_t resv;
+ uint32_t reserved;
+ ib_guid_info_t guid_info;
+} PACK_SUFFIX ib_guidinfo_record_t;
+#include <complib/cl_packoff.h>
+
#define IB_NUM_PKEY_ELEMENTS_IN_BLOCK 32
/****s* IBA Base: Types/ib_pkey_table_t
* NAME
Index: osm/opensm/osm_sa_guidinfo_record.c
===================================================================
--- osm/opensm/osm_sa_guidinfo_record.c (revision 0)
+++ osm/opensm/osm_sa_guidinfo_record.c (revision 0)
@@ -0,0 +1,624 @@
+/*
+ * Copyright (c) 2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2005 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
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id: $
+ */
+
+
+/*
+ * Abstract:
+ * Implementation of osm_gir_rcv_t.
+ * This object represents the GUIDInfoRecord Receiver object.
+ * This object is part of the opensm family of objects.
+ *
+ * Environment:
+ * Linux User Mode
+ *
+ */
+
+/*
+ Next available error code: 0x403
+*/
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <iba/ib_types.h>
+#include <complib/cl_memory.h>
+#include <complib/cl_qmap.h>
+#include <complib/cl_passivelock.h>
+#include <complib/cl_debug.h>
+#include <complib/cl_qlist.h>
+#include <opensm/osm_sa_guidinfo_record.h>
+#include <opensm/osm_port.h>
+#include <opensm/osm_node.h>
+#include <vendor/osm_vendor_api.h>
+#include <opensm/osm_helper.h>
+#include <opensm/osm_pkey.h>
+
+#define OSM_GIR_RCV_POOL_MIN_SIZE 32
+#define OSM_GIR_RCV_POOL_GROW_SIZE 32
+
+typedef struct _osm_gir_item
+{
+ cl_pool_item_t pool_item;
+ ib_guidinfo_record_t rec;
+
+} osm_gir_item_t;
+
+typedef struct _osm_gir_search_ctxt
+{
+ const ib_guidinfo_record_t* p_rcvd_rec;
+ ib_net64_t comp_mask;
+ cl_qlist_t* p_list;
+ osm_gir_rcv_t* p_rcv;
+ const osm_physp_t* p_req_physp;
+
+} osm_gir_search_ctxt_t;
+
+/**********************************************************************
+ **********************************************************************/
+void
+osm_gir_rcv_construct(
+ IN osm_gir_rcv_t* const p_rcv )
+{
+ cl_memclr( p_rcv, sizeof(*p_rcv) );
+ cl_qlock_pool_construct( &p_rcv->pool );
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
+osm_gir_rcv_destroy(
+ IN osm_gir_rcv_t* const p_rcv )
+{
+ OSM_LOG_ENTER( p_rcv->p_log, osm_gir_rcv_destroy );
+ cl_qlock_pool_destroy( &p_rcv->pool );
+ OSM_LOG_EXIT( p_rcv->p_log );
+}
+
+/**********************************************************************
+ **********************************************************************/
+ib_api_status_t
+osm_gir_rcv_init(
+ IN osm_gir_rcv_t* const p_rcv,
+ IN osm_sa_resp_t* const p_resp,
+ IN osm_mad_pool_t* const p_mad_pool,
+ IN const osm_subn_t* const p_subn,
+ IN osm_log_t* const p_log,
+ IN cl_plock_t* const p_lock )
+{
+ ib_api_status_t status;
+
+ OSM_LOG_ENTER( p_log, osm_gir_rcv_init );
+
+ osm_gir_rcv_construct( p_rcv );
+
+ p_rcv->p_log = p_log;
+ p_rcv->p_subn = p_subn;
+ p_rcv->p_lock = p_lock;
+ p_rcv->p_resp = p_resp;
+ p_rcv->p_mad_pool = p_mad_pool;
+
+ status = cl_qlock_pool_init( &p_rcv->pool,
+ OSM_GIR_RCV_POOL_MIN_SIZE,
+ 0,
+ OSM_GIR_RCV_POOL_GROW_SIZE,
+ sizeof(osm_gir_item_t),
+ NULL, NULL, NULL );
+
+ OSM_LOG_EXIT( p_log );
+ return( status );
+}
+
+/**********************************************************************
+ **********************************************************************/
+static ib_api_status_t
+__osm_gir_rcv_new_gir(
+ IN osm_gir_rcv_t* const p_rcv,
+ IN const osm_node_t* const p_node,
+ IN cl_qlist_t* const p_list,
+ IN ib_net64_t const match_port_guid,
+ IN ib_net16_t const match_lid,
+ IN const osm_physp_t* const p_req_physp,
+ IN uint8_t const block_num )
+{
+ osm_gir_item_t* p_rec_item;
+ ib_api_status_t status = IB_SUCCESS;
+
+ OSM_LOG_ENTER( p_rcv->p_log, __osm_gir_rcv_new_gir );
+
+ p_rec_item = (osm_gir_item_t*)cl_qlock_pool_get( &p_rcv->pool );
+ if( p_rec_item == NULL )
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "__osm_gir_rcv_new_gir: ERR 5102: "
+ "cl_qlock_pool_get failed\n" );
+ status = IB_INSUFFICIENT_RESOURCES;
+ goto Exit;
+ }
+
+ if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) )
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "__osm_gir_rcv_new_gir: "
+ "New GUIDInfoRecord: lid 0x%X, block num %d\n",
+ cl_ntoh16( match_lid ), block_num );
+ }
+
+ cl_memclr( &p_rec_item->rec, sizeof( p_rec_item->rec ) );
+
+ p_rec_item->rec.lid = match_lid;
+ p_rec_item->rec.block_num = block_num;
+ if (!block_num)
+ p_rec_item->rec.guid_info.guid[0] = osm_physp_get_port_guid( p_req_physp );
+
+ cl_qlist_insert_tail( p_list, (cl_list_item_t*)&p_rec_item->pool_item );
+
+ Exit:
+ OSM_LOG_EXIT( p_rcv->p_log );
+ return( status );
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
+__osm_sa_gir_create_gir(
+ IN osm_gir_rcv_t* const p_rcv,
+ IN const osm_node_t* const p_node,
+ IN cl_qlist_t* const p_list,
+ IN ib_net64_t const match_port_guid,
+ IN ib_net16_t const match_lid,
+ IN const osm_physp_t* const p_req_physp,
+ IN uint8_t const match_block_num )
+{
+ const osm_physp_t* p_physp;
+ uint8_t port_num;
+ uint8_t num_ports;
+ uint16_t match_lid_ho;
+ uint16_t lid_ho;
+ ib_net16_t base_lid_ho;
+ ib_net16_t max_lid_ho;
+ uint8_t lmc;
+ ib_net64_t port_guid;
+ ib_api_status_t status;
+ const ib_port_info_t* p_pi;
+ uint8_t block_num, start_block_num, end_block_num, num_blocks;
+
+ OSM_LOG_ENTER( p_rcv->p_log, __osm_sa_gir_create_gir );
+
+ if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) )
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "__osm_sa_gir_create_gir: "
+ "Looking for GUIDRecord with LID: 0x%X GUID:0x%016" PRIx64 "\n",
+ cl_ntoh16( match_lid ),
+ cl_ntoh64( match_port_guid )
+ );
+ }
+
+ /*
+ For switches, do not return the GUIDInfo record(s)
+ for each port on the switch, just for port 0.
+ */
+ if( osm_node_get_type( p_node ) == IB_NODE_TYPE_SWITCH )
+ num_ports = 1;
+ else
+ num_ports = osm_node_get_num_physp( p_node );
+
+ for( port_num = 0; port_num < num_ports; port_num++ )
+ {
+ p_physp = osm_node_get_physp_ptr( p_node, port_num );
+
+ if( !osm_physp_is_valid( p_physp ) )
+ continue;
+
+ /* Check to see if the found p_physp and the requestor physp
+ share a pkey. If not - continue */
+ if (!osm_physp_share_pkey( p_rcv->p_log, p_physp, p_req_physp ) )
+ continue;
+
+ port_guid = osm_physp_get_port_guid( p_physp );
+
+ if( match_port_guid && ( port_guid != match_port_guid ) )
+ continue;
+
+ p_pi = osm_physp_get_port_info_ptr( p_physp );
+ num_blocks = p_pi->guid_cap / 8;
+ if ( p_pi->guid_cap % 8 )
+ num_blocks++;
+ if (match_block_num == 255)
+ {
+ start_block_num = 0;
+ end_block_num = num_blocks - 1;
+ }
+ else
+ {
+ if (match_block_num >= num_blocks)
+ continue;
+ end_block_num = start_block_num = match_block_num;
+ }
+
+ base_lid_ho = cl_ntoh16( osm_physp_get_base_lid( p_physp ) );
+ lmc = osm_physp_get_lmc( p_physp );
+ max_lid_ho = (uint16_t)( base_lid_ho + (1 << lmc) - 1 );
+ match_lid_ho = cl_ntoh16( match_lid );
+
+ if( match_lid_ho )
+ {
+ /*
+ We validate that the lid belongs to this node.
+ */
+ if( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) )
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "__osm_sa_gir_create_gir: "
+ "Comparing LID: 0x%X <= 0x%X <= 0x%X\n",
+ cl_ntoh16( base_lid_ho ),
+ cl_ntoh16( match_lid_ho ),
+ cl_ntoh16( max_lid_ho )
+ );
+ }
+
+ if( (match_lid_ho <= max_lid_ho) && (match_lid_ho >= base_lid_ho) )
+ {
+ /*
+ Ignore return code for now.
+ */
+ for (block_num = start_block_num; block_num <= end_block_num; block_num++)
+ __osm_gir_rcv_new_gir( p_rcv, p_node, p_list,
+ port_guid, match_lid,
+ p_physp, block_num );
+ }
+ }
+ else
+ {
+ /*
+ For every lid value create the GUIDInfo record(s).
+ */
+ for( lid_ho = base_lid_ho; lid_ho <= max_lid_ho; lid_ho++ )
+ {
+ for (block_num = start_block_num; block_num <= end_block_num; block_num++)
+ {
+ status = __osm_gir_rcv_new_gir( p_rcv, p_node, p_list,
+ port_guid, cl_hton16( lid_ho ),
+ p_physp, block_num );
+ if( status != IB_SUCCESS )
+ break;
+ }
+ }
+ }
+ }
+
+ OSM_LOG_EXIT( p_rcv->p_log );
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
+__osm_sa_gir_by_comp_mask_cb(
+ IN cl_map_item_t* const p_map_item,
+ IN void* context )
+{
+ const osm_gir_search_ctxt_t* const p_ctxt = (osm_gir_search_ctxt_t *)context;
+ const osm_node_t* const p_node = (osm_node_t*)p_map_item;
+ const ib_guidinfo_record_t* const p_rcvd_rec = p_ctxt->p_rcvd_rec;
+ const osm_physp_t* const p_req_physp = p_ctxt->p_req_physp;
+ osm_gir_rcv_t* const p_rcv = p_ctxt->p_rcv;
+ const ib_guid_info_t* p_comp_gi;
+ ib_net64_t const comp_mask = p_ctxt->comp_mask;
+ ib_net64_t match_port_guid = 0;
+ ib_net16_t match_lid = 0;
+ uint8_t match_block_num = 255;
+
+ OSM_LOG_ENTER( p_ctxt->p_rcv->p_log, __osm_sa_gir_by_comp_mask_cb);
+
+ if( comp_mask & IB_GIR_COMPMASK_LID )
+ match_lid = p_rcvd_rec->lid;
+
+ if( comp_mask & IB_GIR_COMPMASK_BLOCKNUM )
+ match_block_num = p_rcvd_rec->block_num;
+
+ p_comp_gi = &p_rcvd_rec->guid_info;
+ /* Different rule for block 0 v. other blocks */
+ if( comp_mask & IB_GIR_COMPMASK_GID0 )
+ {
+ if ( !p_rcvd_rec->block_num )
+ match_port_guid = osm_physp_get_port_guid( p_req_physp );
+ if ( p_comp_gi->guid[0] != match_port_guid )
+ goto Exit;
+ }
+
+ if( comp_mask & IB_GIR_COMPMASK_GID1 )
+ {
+ if ( p_comp_gi->guid[1] != 0)
+ goto Exit;
+ }
+
+ if( comp_mask & IB_GIR_COMPMASK_GID2 )
+ {
+ if ( p_comp_gi->guid[2] != 0)
+ goto Exit;
+ }
+
+ if( comp_mask & IB_GIR_COMPMASK_GID3 )
+ {
+ if ( p_comp_gi->guid[3] != 0)
+ goto Exit;
+ }
+
+ if( comp_mask & IB_GIR_COMPMASK_GID4 )
+ {
+ if ( p_comp_gi->guid[4] != 0)
+ goto Exit;
+ }
+
+ if( comp_mask & IB_GIR_COMPMASK_GID5 )
+ {
+ if ( p_comp_gi->guid[5] != 0)
+ goto Exit;
+ }
+
+ if( comp_mask & IB_GIR_COMPMASK_GID6 )
+ {
+ if ( p_comp_gi->guid[6] != 0)
+ goto Exit;
+ }
+
+ if( comp_mask & IB_GIR_COMPMASK_GID7 )
+ {
+ if ( p_comp_gi->guid[7] != 0)
+ goto Exit;
+ }
+
+ __osm_sa_gir_create_gir( p_rcv, p_node, p_ctxt->p_list,
+ match_port_guid, match_lid, p_req_physp,
+ match_block_num );
+
+ Exit:
+ OSM_LOG_EXIT( p_ctxt->p_rcv->p_log );
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
+osm_gir_rcv_process(
+ IN osm_gir_rcv_t* const p_rcv,
+ IN const osm_madw_t* const p_madw )
+{
+ const ib_sa_mad_t* p_rcvd_mad;
+ const ib_guidinfo_record_t* p_rcvd_rec;
+ cl_qlist_t rec_list;
+ osm_madw_t* p_resp_madw;
+ ib_sa_mad_t* p_resp_sa_mad;
+ ib_guidinfo_record_t* p_resp_rec;
+ uint32_t num_rec, pre_trim_num_rec;
+#ifndef VENDOR_RMPP_SUPPORT
+ uint32_t trim_num_rec;
+#endif
+ uint32_t i;
+ osm_gir_search_ctxt_t context;
+ osm_gir_item_t* p_rec_item;
+ ib_api_status_t status;
+ osm_physp_t* p_req_physp;
+
+ CL_ASSERT( p_rcv );
+
+ OSM_LOG_ENTER( p_rcv->p_log, osm_gir_rcv_process );
+
+ CL_ASSERT( p_madw );
+
+ p_rcvd_mad = osm_madw_get_sa_mad_ptr( p_madw );
+ p_rcvd_rec = (ib_guidinfo_record_t*)ib_sa_mad_get_payload_ptr( p_rcvd_mad );
+
+ CL_ASSERT( p_rcvd_mad->attr_id == IB_MAD_ATTR_GUIDINFO_RECORD );
+
+ /* update the requestor physical port. */
+ p_req_physp = osm_get_physp_by_mad_addr(p_rcv->p_log,
+ p_rcv->p_subn,
+ osm_madw_get_mad_addr_ptr(p_madw) );
+ if (p_req_physp == NULL)
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "osm_gir_rcv_process: ERR 5104: "
+ "Cannot find requestor physical port\n" );
+ goto Exit;
+ }
+
+ if ( (p_rcvd_mad->method != IB_MAD_METHOD_GET) &&
+ (p_rcvd_mad->method != IB_MAD_METHOD_GETTABLE) )
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "osm_gir_rcv_process: ERR 5105: "
+ "Unsupported Method (%s)\n",
+ ib_get_sa_method_str( p_rcvd_mad->method ) );
+ osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
+ goto Exit;
+ }
+
+ if ( osm_log_is_active( p_rcv->p_log, OSM_LOG_DEBUG ) )
+ osm_dump_guidinfo_record( p_rcv->p_log, p_rcvd_rec, OSM_LOG_DEBUG );
+
+ cl_qlist_init( &rec_list );
+
+ context.p_rcvd_rec = p_rcvd_rec;
+ context.p_list = &rec_list;
+ context.comp_mask = p_rcvd_mad->comp_mask;
+ context.p_rcv = p_rcv;
+ context.p_req_physp = p_req_physp;
+
+ cl_plock_acquire( p_rcv->p_lock );
+
+ cl_qmap_apply_func( &p_rcv->p_subn->node_guid_tbl,
+ __osm_sa_gir_by_comp_mask_cb,
+ &context );
+
+ cl_plock_release( p_rcv->p_lock );
+
+ num_rec = cl_qlist_count( &rec_list );
+
+ /*
+ * C15-0.1.30:
+ * If we do a SubnAdmGet and got more than one record it is an error !
+ */
+ if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) &&
+ (num_rec > 1)) {
+ osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+ "osm_gir_rcv_process: "
+ "Got more than one record for SubnAdmGet (%u)\n",
+ num_rec );
+ osm_sa_send_error( p_rcv->p_resp, p_madw,
+ IB_SA_MAD_STATUS_TOO_MANY_RECORDS);
+
+ /* need to set the mem free ... */
+ p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
+ while( p_rec_item != (osm_gir_item_t*)cl_qlist_end( &rec_list ) )
+ {
+ cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item );
+ p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
+ }
+
+ goto Exit;
+ }
+
+ pre_trim_num_rec = num_rec;
+#ifndef VENDOR_RMPP_SUPPORT
+ trim_num_rec = (MAD_BLOCK_SIZE - IB_SA_MAD_HDR_SIZE) / sizeof(ib_guidinfo_record_t);
+ if (trim_num_rec < num_rec)
+ {
+ osm_log( p_rcv->p_log, OSM_LOG_VERBOSE,
+ "osm_gir_rcv_process: "
+ "Number of records:%u trimmed to:%u to fit in one MAD\n",
+ num_rec, trim_num_rec );
+ num_rec = trim_num_rec;
+ }
+#endif
+
+ osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
+ "osm_gir_rcv_process: "
+ "Returning %u records\n", num_rec );
+
+ if ((p_rcvd_mad->method == IB_MAD_METHOD_GET) && (num_rec == 0))
+ {
+ osm_sa_send_error( p_rcv->p_resp, p_madw,
+ IB_SA_MAD_STATUS_NO_RECORDS );
+ goto Exit;
+ }
+
+ /*
+ * Get a MAD to reply. Address of Mad is in the received mad_wrapper
+ */
+ p_resp_madw = osm_mad_pool_get( p_rcv->p_mad_pool,
+ p_madw->h_bind,
+ num_rec * sizeof(ib_guidinfo_record_t) + IB_SA_MAD_HDR_SIZE,
+ &p_madw->mad_addr );
+
+ if( !p_resp_madw )
+ {
+ osm_log(p_rcv->p_log, OSM_LOG_ERROR,
+ "osm_gir_rcv_process: ERR 5106: "
+ "osm_mad_pool_get failed\n" );
+
+ for( i = 0; i < num_rec; i++ )
+ {
+ p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
+ cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item );
+ }
+
+ osm_sa_send_error( p_rcv->p_resp, p_madw,
+ IB_SA_MAD_STATUS_NO_RESOURCES );
+
+ goto Exit;
+ }
+
+ p_resp_sa_mad = osm_madw_get_sa_mad_ptr( p_resp_madw );
+
+ /*
+ Copy the MAD header back into the response mad.
+ Set the 'R' bit and the payload length,
+ Then copy all records from the list into the response payload.
+ */
+
+ cl_memcpy( p_resp_sa_mad, p_rcvd_mad, IB_SA_MAD_HDR_SIZE );
+ p_resp_sa_mad->method = (uint8_t)(p_resp_sa_mad->method | 0x80);
+ /* C15-0.1.5 - always return SM_Key = 0 (table 151 p 782) */
+ p_resp_sa_mad->sm_key = 0;
+ /* Fill in the offset (paylen will be done by the rmpp SAR) */
+ p_resp_sa_mad->attr_offset =
+ ib_get_attr_offset( sizeof(ib_guidinfo_record_t) );
+
+ p_resp_rec = (ib_guidinfo_record_t*)
+ ib_sa_mad_get_payload_ptr( p_resp_sa_mad );
+
+#ifndef VENDOR_RMPP_SUPPORT
+ /* we support only one packet RMPP - so we will set the first and
+ last flags for gettable */
+ if (p_resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP)
+ {
+ p_resp_sa_mad->rmpp_type = IB_RMPP_TYPE_DATA;
+ p_resp_sa_mad->rmpp_flags = IB_RMPP_FLAG_FIRST | IB_RMPP_FLAG_LAST | IB_RMPP_FLAG_ACTIVE;
+ }
+#else
+ /* forcefully define the packet as RMPP one */
+ if (p_resp_sa_mad->method == IB_MAD_METHOD_GETTABLE_RESP)
+ p_resp_sa_mad->rmpp_flags = IB_RMPP_FLAG_ACTIVE;
+#endif
+
+ for( i = 0; i < pre_trim_num_rec; i++ )
+ {
+ p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
+ /* copy only if not trimmed */
+ if (i < num_rec)
+ {
+ *p_resp_rec = p_rec_item->rec;
+ }
+ cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item );
+ p_resp_rec++;
+ }
+
+ CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
+
+ status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE);
+ if(status != IB_SUCCESS)
+ {
+ osm_log(p_rcv->p_log, OSM_LOG_ERROR,
+ "osm_gir_rcv_process: ERR 5107: "
+ "osm_vendor_send. status = %s\n",
+ ib_get_err_str(status));
+ goto Exit;
+ }
+
+ Exit:
+ OSM_LOG_EXIT( p_rcv->p_log );
+}
Property changes on: osm/opensm/osm_sa_guidinfo_record.c
___________________________________________________________________
Name: svn:keywords
+ Id
Index: osm/opensm/osm_helper.c
===================================================================
--- osm/opensm/osm_helper.c (revision 5193)
+++ osm/opensm/osm_helper.c (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
*
@@ -763,6 +763,50 @@ osm_dump_portinfo_record(
/**********************************************************************
**********************************************************************/
void
+osm_dump_guidinfo_record(
+ IN osm_log_t* const p_log,
+ IN const ib_guidinfo_record_t* const p_gir,
+ IN const osm_log_level_t log_level )
+{
+ const ib_guid_info_t * const p_gi = &p_gir->guid_info;
+
+ if( osm_log_is_active( p_log, log_level ) )
+ {
+ osm_log( p_log, log_level,
+ "GUIDInfo Record dump:\n"
+ "\t\t\t\tRID\n"
+ "\t\t\t\tLid.....................0x%X\n"
+ "\t\t\t\tBlockNum................0x%X\n"
+ "\t\t\t\tReserved................0x%X\n"
+ "\t\t\t\tGUIDInfo dump\n"
+ "\t\t\t\tReserved................0x%X\n"
+ "\t\t\t\tGUID 0..................0x%016" PRIx64 "\n"
+ "\t\t\t\tGUID 1..................0x%016" PRIx64 "\n"
+ "\t\t\t\tGUID 2..................0x%016" PRIx64 "\n"
+ "\t\t\t\tGUID 3..................0x%016" PRIx64 "\n"
+ "\t\t\t\tGUID 4..................0x%016" PRIx64 "\n"
+ "\t\t\t\tGUID 5..................0x%016" PRIx64 "\n"
+ "\t\t\t\tGUID 6..................0x%016" PRIx64 "\n"
+ "\t\t\t\tGUID 7..................0x%016" PRIx64 "\n",
+ cl_ntoh16(p_gir->lid),
+ p_gir->block_num,
+ p_gir->resv,
+ cl_ntoh32(p_gir->reserved),
+ cl_ntoh64(p_gi->guid[0]),
+ cl_ntoh64(p_gi->guid[1]),
+ cl_ntoh64(p_gi->guid[2]),
+ cl_ntoh64(p_gi->guid[3]),
+ cl_ntoh64(p_gi->guid[4]),
+ cl_ntoh64(p_gi->guid[5]),
+ cl_ntoh64(p_gi->guid[6]),
+ cl_ntoh64(p_gi->guid[7])
+ );
+ }
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
osm_dump_node_info(
IN osm_log_t* const p_log,
IN const ib_node_info_t* const p_ni,
Index: osm/opensm/osm_sa.c
===================================================================
--- osm/opensm/osm_sa.c (revision 5193)
+++ osm/opensm/osm_sa.c (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
*
@@ -89,6 +89,9 @@ osm_sa_construct(
osm_pir_rcv_construct( &p_sa->pir_rcv );
osm_pir_rcv_ctrl_construct( &p_sa->pir_rcv_ctrl );
+ osm_gir_rcv_construct( &p_sa->gir_rcv );
+ osm_gir_rcv_ctrl_construct( &p_sa->gir_rcv_ctrl );
+
osm_lr_rcv_construct( &p_sa->lr_rcv );
osm_lr_rcv_ctrl_construct( &p_sa->lr_rcv_ctrl );
@@ -135,6 +138,7 @@ osm_sa_shutdown(
/* remove any registered dispatcher message */
osm_nr_rcv_ctrl_destroy( &p_sa->nr_rcv_ctrl );
osm_pir_rcv_ctrl_destroy( &p_sa->pir_rcv_ctrl );
+ osm_gir_rcv_ctrl_destroy( &p_sa->gir_rcv_ctrl );
osm_lr_rcv_ctrl_destroy( &p_sa->lr_rcv_ctrl );
osm_pr_rcv_ctrl_destroy( &p_sa->pr_rcv_ctrl );
osm_smir_ctrl_destroy( &p_sa->smir_ctrl );
@@ -162,6 +166,7 @@ osm_sa_destroy(
osm_nr_rcv_destroy( &p_sa->nr_rcv );
osm_pir_rcv_destroy( &p_sa->pir_rcv );
+ osm_gir_rcv_destroy( &p_sa->gir_rcv );
osm_lr_rcv_destroy( &p_sa->lr_rcv );
osm_pr_rcv_destroy( &p_sa->pr_rcv );
osm_smir_rcv_destroy( &p_sa->smir_rcv );
@@ -276,6 +281,24 @@ osm_sa_init(
if( status != IB_SUCCESS )
goto Exit;
+ status = osm_gir_rcv_init(
+ &p_sa->gir_rcv,
+ &p_sa->resp,
+ p_sa->p_mad_pool,
+ p_subn,
+ p_log,
+ p_lock );
+ if( status != IB_SUCCESS )
+ goto Exit;
+
+ status = osm_gir_rcv_ctrl_init(
+ &p_sa->gir_rcv_ctrl,
+ &p_sa->gir_rcv,
+ p_log,
+ p_disp );
+ if( status != IB_SUCCESS )
+ goto Exit;
+
status = osm_lr_rcv_init(
&p_sa->lr_rcv,
&p_sa->resp,
Index: osm/opensm/osm_sa_class_port_info.c
===================================================================
--- osm/opensm/osm_sa_class_port_info.c (revision 5193)
+++ osm/opensm/osm_sa_class_port_info.c (working copy)
@@ -183,7 +183,6 @@ __osm_cpi_rcv_respond(
SMInfoRecord, (we do support it - under the table)
InformInfoRecord,
LinkRecord, (we do support it - under the table)
- GuidInfoRecord
ServiceAssociationRecord
OSM_CAP_IS_SUBN_OPT_MULTI_PATH_SUP:
Index: osm/opensm/libopensm.map
===================================================================
--- osm/opensm/libopensm.map (revision 5193)
+++ osm/opensm/libopensm.map (working copy)
@@ -17,6 +17,7 @@ OPENSM_1.0 {
osm_dbg_get_capabilities_str;
osm_dump_port_info;
osm_dump_portinfo_record;
+ osm_dump_guidinfo_record;
osm_dump_node_info;
osm_dump_node_record;
osm_dump_path_record;
Index: osm/opensm/osm_sa_mad_ctrl.c
===================================================================
--- osm/opensm/osm_sa_mad_ctrl.c (revision 5193)
+++ osm/opensm/osm_sa_mad_ctrl.c (working copy)
@@ -205,6 +205,10 @@ __osm_sa_mad_ctrl_process(
msg_id = OSM_MSG_MAD_LFT_RECORD;
break;
+ case IB_MAD_ATTR_GUIDINFO_RECORD:
+ msg_id = OSM_MSG_MAD_GUIDINFO_RECORD;
+ break;
+
default:
osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
"__osm_sa_mad_ctrl_process: ERR 1A01: "
Index: osm/opensm/osm_sa_guidinfo_record_ctrl.c
===================================================================
--- osm/opensm/osm_sa_guidinfo_record_ctrl.c (revision 0)
+++ osm/opensm/osm_sa_guidinfo_record_ctrl.c (revision 0)
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2005 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
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id: $
+ */
+
+
+/*
+ * Abstract:
+ * Implementation of osm_gir_rcv_ctrl_t.
+ * This object represents the GUIDInfoRecord request controller object.
+ * This object is part of the opensm family of objects.
+ *
+ * Environment:
+ * Linux User Mode
+ *
+ */
+
+/*
+ Next available error code: 0x203
+*/
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <complib/cl_memory.h>
+#include <opensm/osm_sa_guidinfo_record_ctrl.h>
+#include <opensm/osm_msgdef.h>
+
+/**********************************************************************
+ **********************************************************************/
+void
+__osm_gir_rcv_ctrl_disp_callback(
+ IN void *context,
+ IN void *p_data )
+{
+ /* ignore return status when invoked via the dispatcher */
+ osm_gir_rcv_process( ((osm_gir_rcv_ctrl_t*)context)->p_rcv,
+ (osm_madw_t*)p_data );
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
+osm_gir_rcv_ctrl_construct(
+ IN osm_gir_rcv_ctrl_t* const p_ctrl )
+{
+ cl_memclr( p_ctrl, sizeof(*p_ctrl) );
+ p_ctrl->h_disp = CL_DISP_INVALID_HANDLE;
+}
+
+/**********************************************************************
+ **********************************************************************/
+void
+osm_gir_rcv_ctrl_destroy(
+ IN osm_gir_rcv_ctrl_t* const p_ctrl )
+{
+ CL_ASSERT( p_ctrl );
+ cl_disp_unregister( p_ctrl->h_disp );
+}
+
+/**********************************************************************
+ **********************************************************************/
+ib_api_status_t
+osm_gir_rcv_ctrl_init(
+ IN osm_gir_rcv_ctrl_t* const p_ctrl,
+ IN osm_gir_rcv_t* const p_rcv,
+ IN osm_log_t* const p_log,
+ IN cl_dispatcher_t* const p_disp )
+{
+ ib_api_status_t status = IB_SUCCESS;
+
+ OSM_LOG_ENTER( p_log, osm_gir_rcv_ctrl_init );
+
+ osm_gir_rcv_ctrl_construct( p_ctrl );
+ p_ctrl->p_log = p_log;
+ p_ctrl->p_rcv = p_rcv;
+ p_ctrl->p_disp = p_disp;
+
+ p_ctrl->h_disp = cl_disp_register(
+ p_disp,
+ OSM_MSG_MAD_GUIDINFO_RECORD,
+ __osm_gir_rcv_ctrl_disp_callback,
+ p_ctrl );
+
+ if( p_ctrl->h_disp == CL_DISP_INVALID_HANDLE )
+ {
+ osm_log( p_log, OSM_LOG_ERROR,
+ "osm_gir_rcv_ctrl_init: ERR 5201: "
+ "Dispatcher registration failed\n" );
+ status = IB_INSUFFICIENT_RESOURCES;
+ goto Exit;
+ }
+
+ Exit:
+ OSM_LOG_EXIT( p_log );
+ return( status );
+}
Property changes on: osm/opensm/osm_sa_guidinfo_record_ctrl.c
___________________________________________________________________
Name: svn:keywords
+ Id
Index: osm/opensm/Makefile.am
===================================================================
--- osm/opensm/Makefile.am (revision 5193)
+++ osm/opensm/Makefile.am (working copy)
@@ -46,6 +46,7 @@ opensm_SOURCES = main.c osm_console.c os
osm_sa_path_record.c osm_sa_path_record_ctrl.c \
osm_sa_pkey_record.c osm_sa_pkey_record_ctrl.c \
osm_sa_portinfo_record.c osm_sa_portinfo_record_ctrl.c \
+ osm_sa_guidinfo_record.c osm_sa_guidinfo_record_ctrl.c \
osm_sa_response.c osm_sa_service_record.c \
osm_sa_service_record_ctrl.c osm_sa_slvl_record.c \
osm_sa_slvl_record_ctrl.c osm_sa_sminfo_record.c \
More information about the general
mailing list