[ofw] OpenSM patches for saquery porting - 1 of 6 patches.

Stan C. Smith stan.smith at intel.com
Fri Jan 30 14:50:03 PST 2009


Hello,
  The following OpenSM patches update OpenSM's ib_types.h a small step closer to the OFED version by
  1) matching field names.
  2) missing #defines
  3) missing functions
Changes were required in order to port the OFED 1.4 ibsaquery command.

With your permission, I can commit the changes upon your approval.

Signed-off by stan.smith at intel.com

Path record changes:
resv0[8] --> service_id
sl --> qos_class_sl
resp_time_val --> cap_mask2_resp_time

diff U3 C:/Documents and Settings/scsmith/Local Settings/Temp/ib_types.h-revBASE.svn000.tmp.h C:/Documents and
Settings/scsmith/My Documents/openIB-windows/SVN/gen1/trunk/ulp/opensm/user/include/iba/ib_types.h
--- C:/Documents and Settings/scsmith/Local Settings/Temp/ib_types.h-revBASE.svn000.tmp.h	Fri Jan 30 14:21:58 2009
+++ C:/Documents and Settings/scsmith/My Documents/openIB-windows/SVN/gen1/trunk/ulp/opensm/user/include/iba/ib_types.h
Fri Jan 30 09:48:28 2009
@@ -1696,6 +1696,50 @@
 #define IB_SMINFO_STATE_MASTER				3
 /**********/
 
+/****d* IBA Base: Constants/IB_PATH_REC_SL_MASK
+* NAME
+*	IB_PATH_REC_SL_MASK
+*
+* DESCRIPTION
+*	Mask for the sl field for path record
+*
+* SOURCE
+*/
+#define IB_PATH_REC_SL_MASK				0x000F
+
+/****d* IBA Base: Constants/IB_MULTIPATH_REC_SL_MASK
+* NAME
+*	IB_MILTIPATH_REC_SL_MASK
+*
+* DESCRIPTION
+*	Mask for the sl field for MultiPath record
+*
+* SOURCE
+*/
+#define IB_MULTIPATH_REC_SL_MASK			0x000F
+
+/****d* IBA Base: Constants/IB_PATH_REC_QOS_CLASS_MASK
+* NAME
+*	IB_PATH_REC_QOS_CLASS_MASK
+*
+* DESCRIPTION
+*	Mask for the QoS class field for path record
+*
+* SOURCE
+*/
+#define IB_PATH_REC_QOS_CLASS_MASK			0xFFF0
+
+/****d* IBA Base: Constants/IB_MULTIPATH_REC_QOS_CLASS_MASK
+* NAME
+*	IB_MULTIPATH_REC_QOS_CLASS_MASK
+*
+* DESCRIPTION
+*	Mask for the QoS class field for MultiPath record
+*
+* SOURCE
+*/
+#define IB_MULTIPATH_REC_QOS_CLASS_MASK			0xFFF0
+
 /****d* IBA Base: Constants/IB_PATH_REC_SELECTOR_MASK
 * NAME
 *	IB_PATH_REC_SELECTOR_MASK
@@ -2310,7 +2354,7 @@
 #include <complib/cl_packon.h>
 typedef struct _ib_path_rec
 {
-	uint8_t					resv0[8];
+	ib_net64_t				service_id;
 	ib_gid_t				dgid;
 	ib_gid_t				sgid;
 	ib_net16_t				dlid;
@@ -2319,7 +2363,7 @@
 	uint8_t					tclass;
 	uint8_t					num_path; 
 	ib_net16_t				pkey;
-	ib_net16_t				sl;
+	ib_net16_t				qos_class_sl;
 	uint8_t					mtu;
 	uint8_t					rate;
 	uint8_t					pkt_life;
@@ -2670,7 +2714,7 @@
 	p_rec->num_path = num_path;
 	p_rec->pkey = pkey;
 	/* Lower 4 bits of path rec's SL are reserved. */
-	p_rec->sl = cl_ntoh16( sl );
+	p_rec->qos_class_sl = cl_ntoh16( sl );
 	p_rec->mtu = (uint8_t)((mtu & IB_PATH_REC_BASE_MASK) |
 			(uint8_t)(mtu_selector << 6));
 	p_rec->rate = (uint8_t)((rate & IB_PATH_REC_BASE_MASK) |
@@ -2683,7 +2727,7 @@
 	p_rec->hop_flow_raw = 0;
 	p_rec->tclass = 0;
 
-	*((uint64_t*)p_rec->resv0) = 0;
+	*((uint64_t*)p_rec->service_id) = 0;
 	*((uint32_t*)p_rec->resv2) = 0;
 	*((uint16_t*)p_rec->resv2 + 2) = 0;
 }
@@ -2788,7 +2832,7 @@
 ib_path_rec_sl(
 	IN	const	ib_path_rec_t* const	p_rec )
 {
-	return( (uint8_t)((cl_ntoh16( p_rec->sl )) & 0xF) );
+	return( (uint8_t)((cl_ntoh16( p_rec->qos_class_sl )) & 0xF) );
 }
 /*
 * PARAMETERS
@@ -2804,6 +2848,71 @@
 *	ib_path_rec_t
 *********/
 
+/****f* IBA Base: Types/ib_path_rec_set_qos_class
+* NAME
+*	ib_path_rec_set_qos_class
+*
+* DESCRIPTION
+*	Set path QoS class.
+*
+* SYNOPSIS
+*/
+static inline void OSM_API
+ib_path_rec_set_qos_class(IN ib_path_rec_t * const p_rec,
+			  IN const uint16_t qos_class)
+{
+	p_rec->qos_class_sl =
+	    (p_rec->qos_class_sl & CL_HTON16(IB_PATH_REC_SL_MASK)) |
+	    cl_hton16(qos_class << 4);
+}
+
+/*
+* PARAMETERS
+*	p_rec
+*		[in] Pointer to the path record object.
+*
+*	qos_class
+*		[in] QoS class to set.
+*
+* RETURN VALUES
+*	None
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_path_rec_t
+*********/
+
+/****f* IBA Base: Types/ib_path_rec_qos_class
+* NAME
+*	ib_path_rec_qos_class
+*
+* DESCRIPTION
+*	Get QoS class.
+*
+* SYNOPSIS
+*/
+static inline uint16_t OSM_API
+ib_path_rec_qos_class(IN const ib_path_rec_t * const p_rec)
+{
+	return (cl_ntoh16(p_rec->qos_class_sl) >> 4);
+}
+
+/*
+* PARAMETERS
+*	p_rec
+*		[in] Pointer to the path record object.
+*
+* RETURN VALUES
+*	QoS class of the path record.
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_path_rec_t
+*********/
+
+
 /****f* IBA Base: Types/ib_path_rec_mtu
 * NAME
 *	ib_path_rec_mtu
@@ -3127,8 +3236,7 @@
 	uint8_t					base_ver;
 	uint8_t					class_ver;
 	ib_net16_t				cap_mask;
-	uint8_t					reserved[3];
-	uint8_t					resp_time_val;
+	ib_net32_t				cap_mask2_resp_time;
 	ib_gid_t				redir_gid;
 	ib_net32_t				redir_tc_sl_fl;
 	ib_net16_t				redir_lid;
@@ -3155,8 +3263,9 @@
 *	cap_mask
 *		Supported capabilities of this management class.
 *
-*	resp_time_value
-*		Maximum expected response time.
+*	cap_mask2_resp_time
+*		Maximum expected response time and additional
+*		supported capabilities of this management class.
 *
 *	redr_gid
 *		GID to use for redirection, or zero
@@ -3202,6 +3311,135 @@
 *
 *********/
 
+/****f* IBA Base: Types/ib_class_set_resp_time_val
+* NAME
+*	ib_class_set_resp_time_val
+*
+* DESCRIPTION
+*	Set maximum expected response time.
+*
+* SYNOPSIS
+*/
+static inline void OSM_API
+ib_class_set_resp_time_val(IN ib_class_port_info_t * const p_cpi,
+			   IN const uint8_t val)
+{
+	p_cpi->cap_mask2_resp_time =
+	    (p_cpi->cap_mask2_resp_time & CL_HTON32(~IB_CLASS_RESP_TIME_MASK)) |
+	    cl_hton32(val & IB_CLASS_RESP_TIME_MASK);
+}
+
+/*
+* PARAMETERS
+*	p_cpi
+*		[in] Pointer to the class port info object.
+*
+*	val
+*		[in] Response time value to set.
+*
+* RETURN VALUES
+*	None
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_class_port_info_t
+*********/
+
+/****f* IBA Base: Types/ib_class_resp_time_val
+* NAME
+*	ib_class_resp_time_val
+*
+* DESCRIPTION
+*	Get response time value.
+*
+* SYNOPSIS
+*/
+static inline uint8_t OSM_API
+ib_class_resp_time_val(IN ib_class_port_info_t * const p_cpi)
+{
+	return (uint8_t)(cl_ntoh32(p_cpi->cap_mask2_resp_time) &
+			 IB_CLASS_RESP_TIME_MASK);
+}
+
+/*
+* PARAMETERS
+*	p_cpi
+*		[in] Pointer to the class port info object.
+*
+* RETURN VALUES
+*	Response time value.
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_class_port_info_t
+*********/
+
+/****f* IBA Base: Types/ib_class_set_cap_mask2
+* NAME
+*	ib_class_set_cap_mask2
+*
+* DESCRIPTION
+*	Set ClassPortInfo:CapabilityMask2.
+*
+* SYNOPSIS
+*/
+static inline void OSM_API
+ib_class_set_cap_mask2(IN ib_class_port_info_t * const p_cpi,
+		       IN const uint32_t cap_mask2)
+{
+	p_cpi->cap_mask2_resp_time = (p_cpi->cap_mask2_resp_time &
+		CL_HTON32(IB_CLASS_RESP_TIME_MASK)) |
+		cl_hton32(cap_mask2 << 5);
+}
+
+/*
+* PARAMETERS
+*	p_cpi
+*		[in] Pointer to the class port info object.
+*
+*	cap_mask2
+*		[in] CapabilityMask2 value to set.
+*
+* RETURN VALUES
+*	None
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_class_port_info_t
+*********/
+
+/****f* IBA Base: Types/ib_class_cap_mask2
+* NAME
+*	ib_class_cap_mask2
+*
+* DESCRIPTION
+*	Get ClassPortInfo:CapabilityMask2.
+*
+* SYNOPSIS
+*/
+static inline uint32_t OSM_API
+ib_class_cap_mask2(IN const ib_class_port_info_t * const p_cpi)
+{
+	return (cl_ntoh32(p_cpi->cap_mask2_resp_time) >> 5);
+}
+
+/*
+* PARAMETERS
+*	p_cpi
+*		[in] Pointer to the class port info object.
+*
+* RETURN VALUES
+*	CapabilityMask2 of the ClassPortInfo.
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_class_port_info_t
+*********/
+
 /****s* IBA Base: Types/ib_sm_info_t
 * NAME
 *	ib_sm_info_t
@@ -7196,6 +7434,40 @@
 }
 /*
 * PARAMETERS
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_inform_info_t
+*********/
+
+/****f* IBA Base: Types/ib_inform_info_get_prod_type
+* NAME
+*	ib_inform_info_get_prod_type
+*
+* DESCRIPTION
+*	Get Producer Type of the Inform Info
+*	13.4.8.3 InformInfo
+*
+* SYNOPSIS
+*/
+static inline ib_net32_t OSM_API
+ib_inform_info_get_prod_type(IN const ib_inform_info_t * p_inf)
+{
+	uint32_t nt;
+
+	nt = cl_ntoh16(p_inf->g_or_v.generic.node_type_lsb) |
+	    (p_inf->g_or_v.generic.node_type_msb << 16);
+	return cl_hton32(nt);
+}
+
+/*
+* PARAMETERS
+*	p_inf
+*		[in] pointer to an inform info
+*
+* RETURN VALUES
+*     The producer type
 *
 * NOTES
 *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ib_types.h.patch
Type: application/octet-stream
Size: 7632 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090130/31ffccb1/attachment.obj>


More information about the ofw mailing list