[openib-general] [PATCH 3/4] OpenSM: Other changes to incorporate optional SA SwitchInfoRecord support
Hal Rosenstock
halr at voltaire.com
Wed Dec 27 08:46:27 PST 2006
OpenSM: Other changes to incorporate optional SA SwitchInfoRecord
support
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
diff --git a/osm/include/Makefile.am b/osm/include/Makefile.am
index cc90283..d051b9a 100644
--- a/osm/include/Makefile.am
+++ b/osm/include/Makefile.am
@@ -109,6 +109,8 @@ EXTRA_DIST = \
$(srcdir)/opensm/osm_sa_link_record_ctrl.h \
$(srcdir)/opensm/osm_sw_info_rcv_ctrl.h \
$(srcdir)/opensm/osm_sa_mcmember_record.h \
+ $(srcdir)/opensm/osm_sa_sw_info_record_ctrl.h \
+ $(srcdir)/opensm/osm_sa_sw_info_record.h \
$(srcdir)/opensm/osm_vl15intf.h \
$(srcdir)/opensm/osm_drop_mgr.h \
$(srcdir)/opensm/osm_port_info_rcv.h \
diff --git a/osm/include/opensm/osm_msgdef.h b/osm/include/opensm/osm_msgdef.h
index a9fa613..3611025 100644
--- a/osm/include/opensm/osm_msgdef.h
+++ b/osm/include/opensm/osm_msgdef.h
@@ -195,6 +195,7 @@ enum
OSM_MSG_MAD_SLVL,
OSM_MSG_MAD_GUIDINFO_RECORD,
OSM_MSG_MAD_INFORM_INFO_RECORD,
+ OSM_MSG_MAD_SWITCH_INFO_RECORD,
#if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)
OSM_MSG_MAD_MULTIPATH_RECORD,
#endif
diff --git a/osm/include/opensm/osm_sa.h b/osm/include/opensm/osm_sa.h
index 93324b2..ae8d5ac 100644
--- a/osm/include/opensm/osm_sa.h
+++ b/osm/include/opensm/osm_sa.h
@@ -76,6 +76,7 @@
#include <opensm/osm_sa_vlarb_record_ctrl.h>
#include <opensm/osm_sa_pkey_record_ctrl.h>
#include <opensm/osm_sa_lft_record_ctrl.h>
+#include <opensm/osm_sa_sw_info_record_ctrl.h>
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
@@ -190,6 +191,10 @@ typedef struct _osm_sa
/* LinearForwardingTable Query */
osm_lftr_rcv_t lftr_rcv;
osm_lftr_rcv_ctrl_t lftr_rcv_ctrl;
+
+ /* SwitchInfo Query */
+ osm_sir_rcv_t sir_rcv;
+ osm_sir_rcv_ctrl_t sir_rcv_ctrl;
} osm_sa_t;
/*
* FIELDS
diff --git a/osm/opensm/Makefile.am b/osm/opensm/Makefile.am
index 7c09e81..3ef246c 100644
--- a/osm/opensm/Makefile.am
+++ b/osm/opensm/Makefile.am
@@ -77,7 +77,8 @@ opensm_SOURCES = main.c osm_console.c os
osm_sa_service_record_ctrl.c osm_sa_slvl_record.c \
osm_sa_slvl_record_ctrl.c osm_sa_sminfo_record.c \
osm_sa_sminfo_record_ctrl.c osm_sa_vlarb_record.c \
- osm_sa_vlarb_record_ctrl.c osm_service.c \
+ osm_sa_vlarb_record_ctrl.c osm_sa_sw_info_record.c \
+ osm_sa_sw_info_record_ctrl.c osm_service.c \
osm_slvl_map_rcv.c osm_slvl_map_rcv_ctrl.c \
osm_sm.c osm_sminfo_rcv.c \
osm_sminfo_rcv_ctrl.c osm_sm_mad_ctrl.c \
diff --git a/osm/opensm/osm_sa.c b/osm/opensm/osm_sa.c
index a6c475c..983d5e5 100644
--- a/osm/opensm/osm_sa.c
+++ b/osm/opensm/osm_sa.c
@@ -128,6 +128,9 @@ osm_sa_construct(
osm_lftr_rcv_construct( &p_sa->lftr_rcv );
osm_lftr_rcv_ctrl_construct( &p_sa->lftr_rcv_ctrl );
+
+ osm_sir_rcv_construct( &p_sa->sir_rcv );
+ osm_sir_rcv_ctrl_construct( &p_sa->sir_rcv_ctrl );
}
/**********************************************************************
@@ -159,6 +162,7 @@ osm_sa_shutdown(
osm_slvl_rec_rcv_ctrl_destroy( &p_sa->slvl_rec_rcv_ctrl );
osm_pkey_rec_rcv_ctrl_destroy( &p_sa->pkey_rec_rcv_ctrl );
osm_lftr_rcv_ctrl_destroy( &p_sa->lftr_rcv_ctrl );
+ osm_sir_rcv_ctrl_destroy( &p_sa->sir_rcv_ctrl );
osm_sa_mad_ctrl_destroy( &p_sa->mad_ctrl );
OSM_LOG_EXIT( p_sa->p_log );
@@ -190,6 +194,7 @@ osm_sa_destroy(
osm_slvl_rec_rcv_destroy( &p_sa->slvl_rec_rcv );
osm_pkey_rec_rcv_destroy( &p_sa->pkey_rec_rcv );
osm_lftr_rcv_destroy( &p_sa->lftr_rcv );
+ osm_sir_rcv_destroy( &p_sa->sir_rcv );
osm_sa_resp_destroy( &p_sa->resp );
OSM_LOG_EXIT( p_sa->p_log );
@@ -514,6 +519,24 @@ osm_sa_init(
if( status != IB_SUCCESS )
goto Exit;
+ status = osm_sir_rcv_init(
+ &p_sa->sir_rcv,
+ &p_sa->resp,
+ p_sa->p_mad_pool,
+ p_subn,
+ p_log,
+ p_lock);
+ if( status != IB_SUCCESS )
+ goto Exit;
+
+ status = osm_sir_rcv_ctrl_init(
+ &p_sa->sir_rcv_ctrl,
+ &p_sa->sir_rcv,
+ p_log,
+ p_disp );
+ if( status != IB_SUCCESS )
+ goto Exit;
+
Exit:
OSM_LOG_EXIT( p_log );
return( status );
diff --git a/osm/opensm/osm_sa_class_port_info.c b/osm/opensm/osm_sa_class_port_info.c
index 440d773..4d7bcbb 100644
--- a/osm/opensm/osm_sa_class_port_info.c
+++ b/osm/opensm/osm_sa_class_port_info.c
@@ -194,7 +194,6 @@ __osm_cpi_rcv_respond(
/* set specific capability mask bits */
/* we do not support the following optional records:
OSM_CAP_IS_SUBN_OPT_RECS_SUP :
- SwitchInfoRecord,
RandomForwardingTableRecord,
MulticastForwardingTableRecord,
ServiceAssociationRecord
diff --git a/osm/opensm/osm_sa_mad_ctrl.c b/osm/opensm/osm_sa_mad_ctrl.c
index 2605fbf..90c732d 100644
--- a/osm/opensm/osm_sa_mad_ctrl.c
+++ b/osm/opensm/osm_sa_mad_ctrl.c
@@ -212,6 +212,10 @@ __osm_sa_mad_ctrl_process(
msg_id = OSM_MSG_MAD_INFORM_INFO_RECORD;
break;
+ case IB_MAD_ATTR_SWITCH_INFO_RECORD:
+ msg_id = OSM_MSG_MAD_SWITCH_INFO_RECORD;
+ break;
+
#if defined (VENDOR_RMPP_SUPPORT) && defined (DUAL_SIDED_RMPP)
case IB_MAD_ATTR_MULTIPATH_RECORD:
msg_id = OSM_MSG_MAD_MULTIPATH_RECORD;
More information about the general
mailing list