16448055 libibmad: Add NodeRecord query API s11-update
authorBoris Chiu <Boris.Chiu@Oracle.COM>
Fri, 26 Apr 2013 10:20:14 -0700
branchs11-update
changeset 2585 9c368d4da1e5
parent 2584 ad7971db6ec0
child 2589 8ecfb2b25ddc
16448055 libibmad: Add NodeRecord query API
components/open-fabrics/libibmad/patches/base.patch
--- a/components/open-fabrics/libibmad/patches/base.patch	Wed Apr 24 10:39:31 2013 -0700
+++ b/components/open-fabrics/libibmad/patches/base.patch	Fri Apr 26 10:20:14 2013 -0700
@@ -15,7 +15,557 @@
 diff -r -u /tmp/libibmad-1.3.7/include/infiniband/mad.h libibmad-1.3.7/include/infiniband/mad.h
 --- /tmp/libibmad-1.3.7/include/infiniband/mad.h	Wed Feb 16 02:12:53 2011
 +++ libibmad-1.3.7/include/infiniband/mad.h	Thu Feb 24 11:27:11 2011
[email protected]@ -1036,6 +1036,10 @@
[email protected]@ -62,6 +62,7 @@
+ #define IB_PC_DATA_SZ		(IB_MAD_SIZE - IB_PC_DATA_OFFS)
+ #define IB_SA_MCM_RECSZ		53
+ #define IB_SA_PR_RECSZ		64
++#define IB_SA_NR_RECSZ		108
+ #define IB_BM_DATA_OFFS		64
+ #define IB_BM_DATA_SZ		(IB_MAD_SIZE - IB_BM_DATA_OFFS)
+ #define IB_BM_BKEY_OFFS		24
[email protected]@ -579,7 +580,8 @@
+ 	/*
+ 	 * GUIDInfo fields
+ 	 */
+-	IB_GUID_GUID0_F,
++	IB_GUID_GUID0_F, /* Obsolete, kept for compatibility
++			    Use IB_GI_GUID0_F going forward */
+ 
+ 	/*
+ 	 * ClassPortInfo fields
[email protected]@ -610,7 +612,8 @@
+ 	/*
+ 	 * PortXmitDataSL fields
+ 	 */
+-	IB_PC_XMT_DATA_SL_FIRST_F,
++	IB_PC_XMT_DATA_SL_FIRST_F, /* for PortSelect and CounterSelect, use IB_P
++C_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
+ 	IB_PC_XMT_DATA_SL0_F = IB_PC_XMT_DATA_SL_FIRST_F,
+ 	IB_PC_XMT_DATA_SL1_F,
+ 	IB_PC_XMT_DATA_SL2_F,
[email protected]@ -632,7 +635,8 @@
+ 	/*
+ 	 * PortRcvDataSL fields
+ 	 */
+-	IB_PC_RCV_DATA_SL_FIRST_F,
++	IB_PC_RCV_DATA_SL_FIRST_F, /* for PortSelect and CounterSelect, use IB_P
++C_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
+ 	IB_PC_RCV_DATA_SL0_F = IB_PC_RCV_DATA_SL_FIRST_F,
+ 	IB_PC_RCV_DATA_SL1_F,
+ 	IB_PC_RCV_DATA_SL2_F,
[email protected]@ -654,6 +658,8 @@
+ 	/*
+ 	 * PortXmitDiscardDetails fields
+ 	 */
++	/* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_C
++OUNTER_SELECT_F */
+ 	IB_PC_XMT_INACT_DISC_F,
+ 	IB_PC_XMT_NEIGH_MTU_DISC_F,
+ 	IB_PC_XMT_SW_LIFE_DISC_F,
[email protected]@ -663,6 +669,8 @@
+ 	/*
+ 	 * PortRcvErrorDetails fields
+ 	 */
++	/* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_C
++OUNTER_SELECT_F */
+ 	IB_PC_RCV_LOCAL_PHY_ERR_F,
+ 	IB_PC_RCV_MALFORMED_PKT_ERR_F,
+ 	IB_PC_RCV_BUF_OVR_ERR_F,
[email protected]@ -706,6 +714,483 @@
+ 	IB_PSC_SAMPLES_ONLY_OPT_MASK_F,
+ 	IB_PSC_LAST_F,
+ 
++
++	/*
++	 * GUIDInfo fields
++	 */
++	IB_GI_GUID0_F, /* a duplicate of IB_GUID_GUID0_F for backwards
++			  compatibility */
++	IB_GI_GUID1_F,
++	IB_GI_GUID2_F,
++	IB_GI_GUID3_F,
++	IB_GI_GUID4_F,
++	IB_GI_GUID5_F,
++	IB_GI_GUID6_F,
++	IB_GI_GUID7_F,
++
++	/*
++	 * GUID Info Record
++	 */
++	IB_SA_GIR_LID_F,
++	IB_SA_GIR_BLOCKNUM_F,
++	IB_SA_GIR_GUID0_F,
++	IB_SA_GIR_GUID1_F,
++	IB_SA_GIR_GUID2_F,
++	IB_SA_GIR_GUID3_F,
++	IB_SA_GIR_GUID4_F,
++	IB_SA_GIR_GUID5_F,
++	IB_SA_GIR_GUID6_F,
++	IB_SA_GIR_GUID7_F,
++
++	/*
++	 * More PortInfo fields
++	 */
++	IB_PORT_CAPMASK2_F,
++	IB_PORT_LINK_SPEED_EXT_ACTIVE_F,
++	IB_PORT_LINK_SPEED_EXT_SUPPORTED_F,
++	IB_PORT_LINK_SPEED_EXT_ENABLED_F,
++	IB_PORT_LINK_SPEED_EXT_LAST_F,
++
++	/*
++	 * PortExtendedSpeedsCounters fields
++	 */
++	IB_PESC_PORT_SELECT_F,
++	IB_PESC_COUNTER_SELECT_F,
++	IB_PESC_SYNC_HDR_ERR_CTR_F,
++	IB_PESC_UNK_BLOCK_CTR_F,
++	IB_PESC_ERR_DET_CTR_LANE0_F,
++	IB_PESC_ERR_DET_CTR_LANE1_F,
++	IB_PESC_ERR_DET_CTR_LANE2_F,
++	IB_PESC_ERR_DET_CTR_LANE3_F,
++	IB_PESC_ERR_DET_CTR_LANE4_F,
++	IB_PESC_ERR_DET_CTR_LANE5_F,
++	IB_PESC_ERR_DET_CTR_LANE6_F,
++	IB_PESC_ERR_DET_CTR_LANE7_F,
++	IB_PESC_ERR_DET_CTR_LANE8_F,
++	IB_PESC_ERR_DET_CTR_LANE9_F,
++	IB_PESC_ERR_DET_CTR_LANE10_F,
++	IB_PESC_ERR_DET_CTR_LANE11_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE0_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE1_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE2_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE3_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE4_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE5_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE6_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE7_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE8_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE9_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE10_F,
++	IB_PESC_FEC_CORR_BLOCK_CTR_LANE11_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE0_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE1_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE2_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE3_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE4_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE5_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE6_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE7_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE8_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE9_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE10_F,
++	IB_PESC_FEC_UNCORR_BLOCK_CTR_LANE11_F,
++	IB_PESC_LAST_F,
++
++	/*
++	 * PortOpRcvCounters fields
++	 */
++	IB_PC_PORT_OP_RCV_COUNTERS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_PORT_OP_RCV_PKTS_F = IB_PC_PORT_OP_RCV_COUNTERS_FIRST_F,
++	IB_PC_PORT_OP_RCV_DATA_F,
++	IB_PC_PORT_OP_RCV_COUNTERS_LAST_F,
++
++	/*
++	 * PortFlowCtlCounters fields
++	 */
++	IB_PC_PORT_FLOW_CTL_COUNTERS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_PORT_XMIT_FLOW_PKTS_F = IB_PC_PORT_FLOW_CTL_COUNTERS_FIRST_F,
++	IB_PC_PORT_RCV_FLOW_PKTS_F,
++	IB_PC_PORT_FLOW_CTL_COUNTERS_LAST_F,
++
++	/*
++	 * PortVLOpPackets fields
++	 */
++	IB_PC_PORT_VL_OP_PACKETS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_PORT_VL_OP_PACKETS0_F = IB_PC_PORT_VL_OP_PACKETS_FIRST_F,
++	IB_PC_PORT_VL_OP_PACKETS1_F,
++	IB_PC_PORT_VL_OP_PACKETS2_F,
++	IB_PC_PORT_VL_OP_PACKETS3_F,
++	IB_PC_PORT_VL_OP_PACKETS4_F,
++	IB_PC_PORT_VL_OP_PACKETS5_F,
++	IB_PC_PORT_VL_OP_PACKETS6_F,
++	IB_PC_PORT_VL_OP_PACKETS7_F,
++	IB_PC_PORT_VL_OP_PACKETS8_F,
++	IB_PC_PORT_VL_OP_PACKETS9_F,
++	IB_PC_PORT_VL_OP_PACKETS10_F,
++	IB_PC_PORT_VL_OP_PACKETS11_F,
++	IB_PC_PORT_VL_OP_PACKETS12_F,
++	IB_PC_PORT_VL_OP_PACKETS13_F,
++	IB_PC_PORT_VL_OP_PACKETS14_F,
++	IB_PC_PORT_VL_OP_PACKETS15_F,
++	IB_PC_PORT_VL_OP_PACKETS_LAST_F,
++
++	/*
++	 * PortVLOpData fields
++	 */
++	IB_PC_PORT_VL_OP_DATA_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_PORT_VL_OP_DATA0_F = IB_PC_PORT_VL_OP_DATA_FIRST_F,
++	IB_PC_PORT_VL_OP_DATA1_F,
++	IB_PC_PORT_VL_OP_DATA2_F,
++	IB_PC_PORT_VL_OP_DATA3_F,
++	IB_PC_PORT_VL_OP_DATA4_F,
++	IB_PC_PORT_VL_OP_DATA5_F,
++	IB_PC_PORT_VL_OP_DATA6_F,
++	IB_PC_PORT_VL_OP_DATA7_F,
++	IB_PC_PORT_VL_OP_DATA8_F,
++	IB_PC_PORT_VL_OP_DATA9_F,
++	IB_PC_PORT_VL_OP_DATA10_F,
++	IB_PC_PORT_VL_OP_DATA11_F,
++	IB_PC_PORT_VL_OP_DATA12_F,
++	IB_PC_PORT_VL_OP_DATA13_F,
++	IB_PC_PORT_VL_OP_DATA14_F,
++	IB_PC_PORT_VL_OP_DATA15_F,
++	IB_PC_PORT_VL_OP_DATA_LAST_F,
++
++	/*
++	 * PortVLXmitFlowCtlUpdateErrors fields
++	 */
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS0_F = IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS_FIRST_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS1_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS2_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS3_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS4_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS5_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS6_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS7_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS8_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS9_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS10_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS11_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS12_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS13_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS14_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS15_F,
++	IB_PC_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS_LAST_F,
++
++	/*
++	 * PortVLXmitWaitCounters fields
++	 */
++	IB_PC_PORT_VL_XMIT_WAIT_COUNTERS_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_PORT_VL_XMIT_WAIT0_F = IB_PC_PORT_VL_XMIT_WAIT_COUNTERS_FIRST_F,
++	IB_PC_PORT_VL_XMIT_WAIT1_F,
++	IB_PC_PORT_VL_XMIT_WAIT2_F,
++	IB_PC_PORT_VL_XMIT_WAIT3_F,
++	IB_PC_PORT_VL_XMIT_WAIT4_F,
++	IB_PC_PORT_VL_XMIT_WAIT5_F,
++	IB_PC_PORT_VL_XMIT_WAIT6_F,
++	IB_PC_PORT_VL_XMIT_WAIT7_F,
++	IB_PC_PORT_VL_XMIT_WAIT8_F,
++	IB_PC_PORT_VL_XMIT_WAIT9_F,
++	IB_PC_PORT_VL_XMIT_WAIT10_F,
++	IB_PC_PORT_VL_XMIT_WAIT11_F,
++	IB_PC_PORT_VL_XMIT_WAIT12_F,
++	IB_PC_PORT_VL_XMIT_WAIT13_F,
++	IB_PC_PORT_VL_XMIT_WAIT14_F,
++	IB_PC_PORT_VL_XMIT_WAIT15_F,
++	IB_PC_PORT_VL_XMIT_WAIT_COUNTERS_LAST_F,
++
++	/*
++	 * SwPortVLCongestion fields
++	 */
++	IB_PC_SW_PORT_VL_CONGESTION_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_SW_PORT_VL_CONGESTION0_F = IB_PC_SW_PORT_VL_CONGESTION_FIRST_F,
++	IB_PC_SW_PORT_VL_CONGESTION1_F,
++	IB_PC_SW_PORT_VL_CONGESTION2_F,
++	IB_PC_SW_PORT_VL_CONGESTION3_F,
++	IB_PC_SW_PORT_VL_CONGESTION4_F,
++	IB_PC_SW_PORT_VL_CONGESTION5_F,
++	IB_PC_SW_PORT_VL_CONGESTION6_F,
++	IB_PC_SW_PORT_VL_CONGESTION7_F,
++	IB_PC_SW_PORT_VL_CONGESTION8_F,
++	IB_PC_SW_PORT_VL_CONGESTION9_F,
++	IB_PC_SW_PORT_VL_CONGESTION10_F,
++	IB_PC_SW_PORT_VL_CONGESTION11_F,
++	IB_PC_SW_PORT_VL_CONGESTION12_F,
++	IB_PC_SW_PORT_VL_CONGESTION13_F,
++	IB_PC_SW_PORT_VL_CONGESTION14_F,
++	IB_PC_SW_PORT_VL_CONGESTION15_F,
++	IB_PC_SW_PORT_VL_CONGESTION_LAST_F,
++
++	/*
++	 * PortRcvConCtrl fields
++	 */
++	IB_PC_RCV_CON_CTRL_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_RCV_CON_CTRL_PKT_RCV_FECN_F = IB_PC_RCV_CON_CTRL_FIRST_F,
++	IB_PC_RCV_CON_CTRL_PKT_RCV_BECN_F,
++	IB_PC_RCV_CON_CTRL_LAST_F,
++
++	/*
++	 * PortSLRcvFECN fields
++	 */
++	IB_PC_SL_RCV_FECN_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_SL_RCV_FECN0_F = IB_PC_SL_RCV_FECN_FIRST_F,
++	IB_PC_SL_RCV_FECN1_F,
++	IB_PC_SL_RCV_FECN2_F,
++	IB_PC_SL_RCV_FECN3_F,
++	IB_PC_SL_RCV_FECN4_F,
++	IB_PC_SL_RCV_FECN5_F,
++	IB_PC_SL_RCV_FECN6_F,
++	IB_PC_SL_RCV_FECN7_F,
++	IB_PC_SL_RCV_FECN8_F,
++	IB_PC_SL_RCV_FECN9_F,
++	IB_PC_SL_RCV_FECN10_F,
++	IB_PC_SL_RCV_FECN11_F,
++	IB_PC_SL_RCV_FECN12_F,
++	IB_PC_SL_RCV_FECN13_F,
++	IB_PC_SL_RCV_FECN14_F,
++	IB_PC_SL_RCV_FECN15_F,
++	IB_PC_SL_RCV_FECN_LAST_F,
++
++	/*
++	 * PortSLRcvBECN fields
++	 */
++	IB_PC_SL_RCV_BECN_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_SL_RCV_BECN0_F = IB_PC_SL_RCV_BECN_FIRST_F,
++	IB_PC_SL_RCV_BECN1_F,
++	IB_PC_SL_RCV_BECN2_F,
++	IB_PC_SL_RCV_BECN3_F,
++	IB_PC_SL_RCV_BECN4_F,
++	IB_PC_SL_RCV_BECN5_F,
++	IB_PC_SL_RCV_BECN6_F,
++	IB_PC_SL_RCV_BECN7_F,
++	IB_PC_SL_RCV_BECN8_F,
++	IB_PC_SL_RCV_BECN9_F,
++	IB_PC_SL_RCV_BECN10_F,
++	IB_PC_SL_RCV_BECN11_F,
++	IB_PC_SL_RCV_BECN12_F,
++	IB_PC_SL_RCV_BECN13_F,
++	IB_PC_SL_RCV_BECN14_F,
++	IB_PC_SL_RCV_BECN15_F,
++	IB_PC_SL_RCV_BECN_LAST_F,
++
++	/*
++	 * PortXmitConCtrl fields
++	 */
++	IB_PC_XMIT_CON_CTRL_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_XMIT_CON_CTRL_TIME_CONG_F = IB_PC_XMIT_CON_CTRL_FIRST_F,
++	IB_PC_XMIT_CON_CTRL_LAST_F,
++
++	/*
++	 * PortVLXmitTimeCong fields
++	 */
++	IB_PC_VL_XMIT_TIME_CONG_FIRST_F, /* for PortSelect and CounterSelect, use IB_PC_PORT_SELECT_F and IB_PC_COUNTER_SELECT_F */
++	IB_PC_VL_XMIT_TIME_CONG0_F = IB_PC_VL_XMIT_TIME_CONG_FIRST_F,
++	IB_PC_VL_XMIT_TIME_CONG1_F,
++	IB_PC_VL_XMIT_TIME_CONG2_F,
++	IB_PC_VL_XMIT_TIME_CONG3_F,
++	IB_PC_VL_XMIT_TIME_CONG4_F,
++	IB_PC_VL_XMIT_TIME_CONG5_F,
++	IB_PC_VL_XMIT_TIME_CONG6_F,
++	IB_PC_VL_XMIT_TIME_CONG7_F,
++	IB_PC_VL_XMIT_TIME_CONG8_F,
++	IB_PC_VL_XMIT_TIME_CONG9_F,
++	IB_PC_VL_XMIT_TIME_CONG10_F,
++	IB_PC_VL_XMIT_TIME_CONG11_F,
++	IB_PC_VL_XMIT_TIME_CONG12_F,
++	IB_PC_VL_XMIT_TIME_CONG13_F,
++	IB_PC_VL_XMIT_TIME_CONG14_F,
++	IB_PC_VL_XMIT_TIME_CONG_LAST_F,
++
++	/*
++	 * Mellanox ExtendedPortInfo fields
++	 */
++	IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
++	IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
++	IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
++	IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
++	IB_MLNX_EXT_PORT_LAST_F,
++
++	/*
++	 * Congestion Control Mad fields
++	 * bytes 24-31 of congestion control mad
++	 */
++	IB_CC_CCKEY_F,
++
++	/*
++	 * CongestionInfo fields
++	 */
++	IB_CC_CONGESTION_INFO_FIRST_F,
++	IB_CC_CONGESTION_INFO_F = IB_CC_CONGESTION_INFO_FIRST_F,
++	IB_CC_CONGESTION_INFO_CONTROL_TABLE_CAP_F,
++	IB_CC_CONGESTION_INFO_LAST_F,
++
++	/*
++	 * CongestionKeyInfo fields
++	 */
++	IB_CC_CONGESTION_KEY_INFO_FIRST_F,
++	IB_CC_CONGESTION_KEY_INFO_CC_KEY_F = IB_CC_CONGESTION_KEY_INFO_FIRST_F,
++	IB_CC_CONGESTION_KEY_INFO_CC_KEY_PROTECT_BIT_F,
++	IB_CC_CONGESTION_KEY_INFO_CC_KEY_LEASE_PERIOD_F,
++	IB_CC_CONGESTION_KEY_INFO_CC_KEY_VIOLATIONS_F,
++	IB_CC_CONGESTION_KEY_INFO_LAST_F,
++
++	/*
++	 * CongestionLog (common) fields
++	 */
++	IB_CC_CONGESTION_LOG_FIRST_F,
++	IB_CC_CONGESTION_LOG_LOGTYPE_F = IB_CC_CONGESTION_LOG_FIRST_F,
++	IB_CC_CONGESTION_LOG_CONGESTION_FLAGS_F,
++	IB_CC_CONGESTION_LOG_LAST_F,
++
++	/*
++	 * CongestionLog (Switch) fields
++	 */
++	IB_CC_CONGESTION_LOG_SWITCH_FIRST_F,
++	IB_CC_CONGESTION_LOG_SWITCH_LOG_EVENTS_COUNTER_F = IB_CC_CONGESTION_LOG_SWITCH_FIRST_F,
++	IB_CC_CONGESTION_LOG_SWITCH_CURRENT_TIME_STAMP_F,
++	IB_CC_CONGESTION_LOG_SWITCH_PORTMAP_F,
++	IB_CC_CONGESTION_LOG_SWITCH_LAST_F,
++
++	/*
++	 * CongestionLogEvent (Switch) fields
++	 */
++	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_FIRST_F,
++	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_SLID_F = IB_CC_CONGESTION_LOG_ENTRY_SWITCH_FIRST_F,
++	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_DLID_F,
++	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_SL_F,
++	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_TIMESTAMP_F,
++	IB_CC_CONGESTION_LOG_ENTRY_SWITCH_LAST_F,
++
++	/*
++	 * CongestionLog (CA) fields
++	 */
++	IB_CC_CONGESTION_LOG_CA_FIRST_F,
++	IB_CC_CONGESTION_LOG_CA_THRESHOLD_EVENT_COUNTER_F = IB_CC_CONGESTION_LOG_CA_FIRST_F,
++	IB_CC_CONGESTION_LOG_CA_THRESHOLD_CONGESTION_EVENT_MAP_F,
++	IB_CC_CONGESTION_LOG_CA_CURRENT_TIMESTAMP_F,
++	IB_CC_CONGESTION_LOG_CA_LAST_F,
++
++	/*
++	 * CongestionLogEvent (CA) fields
++	 */
++	IB_CC_CONGESTION_LOG_ENTRY_CA_FIRST_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_LOCAL_QP_CN_ENTRY_F = IB_CC_CONGESTION_LOG_ENTRY_CA_FIRST_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_SL_CN_ENTRY_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_SERVICE_TYPE_CN_ENTRY_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_REMOTE_QP_NUMBER_CN_ENTRY_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_LOCAL_LID_CN_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_REMOTE_LID_CN_ENTRY_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_TIMESTAMP_CN_ENTRY_F,
++	IB_CC_CONGESTION_LOG_ENTRY_CA_LAST_F,
++
++	/*
++	 * SwitchCongestionSetting fields
++	 */
++	IB_CC_SWITCH_CONGESTION_SETTING_FIRST_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_CONTROL_MAP_F = IB_CC_SWITCH_CONGESTION_SETTING_FIRST_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_VICTIM_MASK_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_CREDIT_MASK_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_THRESHOLD_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_PACKET_SIZE_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_CS_THRESHOLD_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_CS_RETURN_DELAY_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_MARKING_RATE_F,
++	IB_CC_SWITCH_CONGESTION_SETTING_LAST_F,
++
++	/*
++	 * SwitchPortCongestionSettingElement fields
++	 */
++	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_FIRST_F,
++	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_VALID_F = IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_FIRST_F,
++	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_CONTROL_TYPE_F,
++	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_THRESHOLD_F,
++	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_PACKET_SIZE_F,
++	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_CONG_PARM_MARKING_RATE_F,
++	IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_LAST_F,
++
++	/*
++	 * CACongestionSetting fields
++	 */
++	IB_CC_CA_CONGESTION_SETTING_FIRST_F,
++	IB_CC_CA_CONGESTION_SETTING_PORT_CONTROL_F = IB_CC_CA_CONGESTION_SETTING_FIRST_F,
++	IB_CC_CA_CONGESTION_SETTING_CONTROL_MAP_F,
++	IB_CC_CA_CONGESTION_SETTING_LAST_F,
++
++	/*
++	 * CACongestionEntry fields
++	 */
++	IB_CC_CA_CONGESTION_ENTRY_FIRST_F,
++	IB_CC_CA_CONGESTION_ENTRY_CCTI_TIMER_F = IB_CC_CA_CONGESTION_ENTRY_FIRST_F,
++	IB_CC_CA_CONGESTION_ENTRY_CCTI_INCREASE_F,
++	IB_CC_CA_CONGESTION_ENTRY_TRIGGER_THRESHOLD_F,
++	IB_CC_CA_CONGESTION_ENTRY_CCTI_MIN_F,
++	IB_CC_CA_CONGESTION_ENTRY_LAST_F,
++
++	/*
++	 * CongestionControlTable fields
++	 */
++	IB_CC_CONGESTION_CONTROL_TABLE_FIRST_F,
++	IB_CC_CONGESTION_CONTROL_TABLE_CCTI_LIMIT_F = IB_CC_CONGESTION_CONTROL_TABLE_FIRST_F,
++	IB_CC_CONGESTION_CONTROL_TABLE_LAST_F,
++
++	/*
++	 * CongestionControlTableEntry fields
++	 */
++	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_FIRST_F,
++	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_CCT_SHIFT_F = IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_FIRST_F,
++	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_CCT_MULTIPLIER_F,
++	IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_LAST_F,
++
++	/*
++	 * Timestamp fields
++	 */
++	IB_CC_TIMESTAMP_FIRST_F,
++	IB_CC_TIMESTAMP_F = IB_CC_TIMESTAMP_FIRST_F,
++	IB_CC_TIMESTAMP_LAST_F,
++
++	/*
++	 * Node Record
++	 */
++	IB_SA_NR_FIRST_F,
++	IB_SA_NR_LID_F = IB_SA_NR_FIRST_F,
++	IB_SA_NR_BASEVER_F,
++	IB_SA_NR_CLASSVER_F,
++	IB_SA_NR_TYPE_F,
++	IB_SA_NR_NPORTS_F,
++	IB_SA_NR_SYSTEM_GUID_F,
++	IB_SA_NR_GUID_F,
++	IB_SA_NR_PORT_GUID_F,
++	IB_SA_NR_PARTITION_CAP_F,
++	IB_SA_NR_DEVID_F,
++	IB_SA_NR_REVISION_F,
++	IB_SA_NR_LOCAL_PORT_F,
++	IB_SA_NR_VENDORID_F,
++	IB_SA_NR_NODEDESC_F,
++	IB_SA_NR_LAST_F,
++
++	/*
++	 * PortSamplesResult fields
++	 */
++	IB_PSR_TAG_F,
++	IB_PSR_SAMPLE_STATUS_F,
++	IB_PSR_COUNTER0_F,
++	IB_PSR_COUNTER1_F,
++	IB_PSR_COUNTER2_F,
++	IB_PSR_COUNTER3_F,
++	IB_PSR_COUNTER4_F,
++	IB_PSR_COUNTER5_F,
++	IB_PSR_COUNTER6_F,
++	IB_PSR_COUNTER7_F,
++	IB_PSR_COUNTER8_F,
++	IB_PSR_COUNTER9_F,
++	IB_PSR_COUNTER10_F,
++	IB_PSR_COUNTER11_F,
++	IB_PSR_COUNTER12_F,
++	IB_PSR_COUNTER13_F,
++	IB_PSR_COUNTER14_F,
++	IB_PSR_LAST_F,
++
+ 	IB_FIELD_LAST_		/* must be last */
+ };
+ 
[email protected]@ -974,6 +1459,9 @@
+ 				 ibmad_gid_t srcgid, ibmad_gid_t destgid,
+ 				 ib_portid_t * sm_id, void *buf);
+ 	/* returns lid */
++MAD_EXPORT int ib_node_query_via(const struct ibmad_port *srcport,
++				 uint64_t guid, ib_portid_t * sm_id,
++				 void *buf);
+ 
+ /* resolve.c */
+ MAD_EXPORT int ib_resolve_smlid(ib_portid_t * sm_id, int timeout) DEPRECATED;
[email protected]@ -1036,6 +1524,10 @@
  
  extern MAD_EXPORT int ibdebug;
  
@@ -26,7 +576,7 @@
  #if __BYTE_ORDER == __LITTLE_ENDIAN
  #ifndef ntohll
  static inline uint64_t ntohll(uint64_t x)
[email protected]@ -1063,6 +1067,9 @@
[email protected]@ -1063,6 +1555,9 @@
  }
  #endif
  #endif				/* __BYTE_ORDER == __BIG_ENDIAN */
@@ -36,7 +586,7 @@
  
  /* Misc. macros: */
  /** align value \a l to \a size (ceil) */
[email protected]@ -1069,14 +1076,14 @@
[email protected]@ -1069,14 +1564,14 @@
  #define ALIGN(l, size) (((l) + ((size) - 1)) / (size) * (size))
  
  /** printf style warning MACRO, includes name of function and pid */
@@ -91,7 +641,7 @@
  }
 diff -r -u /tmp/libibmad-1.3.7/src/mad.c libibmad-1.3.7/src/mad.c
 --- /tmp/libibmad-1.3.7/src/mad.c	Wed Feb 16 02:12:53 2011
-+++ libibmad-1.3.7/src/mad.c	Mon Nov 12 09:27:48 2012
++++ libibmad-1.3.7/src/mad.c	Mon Apr  1 15:14:16 2013
 @@ -61,6 +61,7 @@
  		trid = random();
  	}
@@ -102,7 +652,7 @@
  
 diff -r -u /tmp/libibmad-1.3.7/src/resolve.c libibmad-1.3.7/src/resolve.c
 --- /tmp/libibmad-1.3.7/src/resolve.c	Wed Feb 16 02:12:53 2011
-+++ libibmad-1.3.7/src/resolve.c	Mon Oct  1 01:41:17 2012
++++ libibmad-1.3.7/src/resolve.c	Wed Jan  9 09:41:48 2013
 @@ -40,6 +40,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -280,7 +830,7 @@
  		snprintf(buf, bufsz, "%06x", *(uint32_t *) val & 0xffffff);
 diff -r -u /tmp/libibmad-1.3.7/src/sa.c libibmad-1.3.7/src/sa.c
 --- /tmp/libibmad-1.3.7/src/sa.c	Wed Feb 16 02:12:53 2011
-+++ libibmad-1.3.7/src/sa.c	Mon Oct  1 01:41:19 2012
++++ libibmad-1.3.7/src/sa.c	Mon Oct  8 01:46:30 2012
 @@ -38,6 +38,7 @@
  #include <stdio.h>
  #include <stdlib.h>
@@ -297,6 +847,66 @@
  		return NULL;
  	}
  
[email protected]@ -144,4 +146,48 @@
+ 		  void *buf)
+ {
+ 	return ib_path_query_via(ibmp, srcgid, destgid, sm_id, buf);
++}
++
++/* NodeRecord */
++#define IB_NR_COMPMASK_LID				(1ull<<0)
++#define IB_NR_COMPMASK_RESERVED1			(1ull<<1)
++#define IB_NR_COMPMASK_BASEVERSION			(1ull<<2)
++#define IB_NR_COMPMASK_CLASSVERSION			(1ull<<3)
++#define IB_NR_COMPMASK_NODETYPE				(1ull<<4)
++#define IB_NR_COMPMASK_NUMPORTS				(1ull<<5)
++#define IB_NR_COMPMASK_SYSIMAGEGUID			(1ull<<6)
++#define IB_NR_COMPMASK_NODEGUID				(1ull<<7)
++#define IB_NR_COMPMASK_PORTGUID				(1ull<<8)
++#define IB_NR_COMPMASK_PARTCAP				(1ull<<9)
++#define IB_NR_COMPMASK_DEVID				(1ull<<10)
++#define IB_NR_COMPMASK_REV				(1ull<<11)
++#define IB_NR_COMPMASK_PORTNUM				(1ull<<12)
++#define IB_NR_COMPMASK_VENDID				(1ull<<13)
++#define IB_NR_COMPMASK_NODEDESC				(1ull<<14)
++
++#define IB_NR_DEF_MASK IB_NR_COMPMASK_PORTGUID
++
++int ib_node_query_via(const struct ibmad_port *srcport, uint64_t guid,
++		      ib_portid_t * sm_id, void *buf)
++{
++	ib_sa_call_t sa = { 0 };
++	uint8_t *p;
++
++	memset(&sa, 0, sizeof sa);
++	sa.method = IB_MAD_METHOD_GET;
++	sa.attrid = IB_SA_ATTR_NODERECORD;
++	sa.mask = IB_NR_DEF_MASK;
++	sa.trid = mad_trid();
++
++	memset(buf, 0, IB_SA_NR_RECSZ);
++
++	mad_encode_field(buf, IB_SA_NR_PORT_GUID_F, &guid);
++
++	p = sa_rpc_call(srcport, buf, sm_id, &sa, 0);
++	if (!p) {
++		IBWARN("sa call node_query failed");
++		return -1;
++	}
++
++	return 0;
+ }
+diff -r -u /tmp/libibmad-1.3.7/src/libibmad.map libibmad-1.3.7/src/libibmad.map
+--- /tmp/libibmad-1.3.7/src/libibmad.map	Wed Feb 16 02:12:53 2011
++++ libibmad-1.3.7/src/libibmad.map	Tue Apr  2 12:13:01 2013
[email protected]@ -102,6 +102,7 @@
+ 		ib_vendor_call_via;
+ 		smp_query_via;
+ 		smp_set_via;
++		ib_node_query_via;
+ 		ib_path_query_via;
+ 		ib_resolve_smlid_via;
+ 		ib_resolve_guid_via;
 diff -r -u /tmp/libibmad-1.3.7/src/rpc.c libibmad-1.3.7/src/rpc.c
 --- /tmp/libibmad-1.3.7/src/rpc.c	Wed Feb 16 02:12:53 2011
 +++ libibmad-1.3.7/src/rpc.c	Thu Feb 24 11:27:14 2011