Documentation ¶
Overview ¶
Package infiniband wraps the low-level interactions with the C libraries such as libibmad. It handles the fabric discovery and performance counter querying functionality of FabricMon.
Index ¶
- Constants
- Variables
- func LinkSpeedExtToStr(speed uint) string
- func LinkSpeedToStr(speed uint) string
- func LinkWidthToStr(width uint) string
- func PortPhysStateToStr(state uint) string
- func PortStateToStr(state uint) string
- func UmadDone()
- func UmadInit() int
- type Counter
- type Fabric
- type HCA
- type Node
- type NodeNameMap
- type Port
Constants ¶
const ( PMA_TIMEOUT = 0 IB_NODE_SWITCH = C.IB_NODE_SWITCH )
const ( SMINFO_NOTACT uint8 = iota SMINFO_DISCOVER SMINFO_STANDBY SMINFO_MASTER )
const DEFAULT_NODE_NAME_MAP = "/etc/opensm/ib-node-name-map"
const (
SYS_INFINIBAND = "/sys/class/infiniband"
)
Variables ¶
var ExtCounterMap = map[uint32]Counter{ C.IB_PC_EXT_XMT_BYTES_F: {"PortXmitData", 0xffffffffffffffff, 0x1}, C.IB_PC_EXT_RCV_BYTES_F: {"PortRcvData", 0xffffffffffffffff, 0x2}, C.IB_PC_EXT_XMT_PKTS_F: {"PortXmitPkts", 0xffffffffffffffff, 0x4}, C.IB_PC_EXT_RCV_PKTS_F: {"PortRcvPkts", 0xffffffffffffffff, 0x8}, C.IB_PC_EXT_XMT_UPKTS_F: {"PortUnicastXmitPkts", 0xffffffffffffffff, 0x10}, C.IB_PC_EXT_RCV_UPKTS_F: {"PortUnicastRcvPkts", 0xffffffffffffffff, 0x20}, C.IB_PC_EXT_XMT_MPKTS_F: {"PortMulticastXmitPkts", 0xffffffffffffffff, 0x40}, C.IB_PC_EXT_RCV_MPKTS_F: {"PortMulticastRcvPkts", 0xffffffffffffffff, 0x80}, }
Extended (64-bit) counters and their display names. Counter lengths and field selects defined in IBTA spec v1.3, table 260 (PortCountersExtended).
var StdCounterMap = map[uint32]Counter{ C.IB_PC_ERR_SYM_F: {"SymbolErrorCounter", 0xffff, 0x1}, C.IB_PC_LINK_RECOVERS_F: {"LinkErrorRecoveryCounter", 0xff, 0x2}, C.IB_PC_LINK_DOWNED_F: {"LinkDownedCounter", 0xff, 0x4}, C.IB_PC_ERR_RCV_F: {"PortRcvErrors", 0xffff, 0x8}, C.IB_PC_ERR_PHYSRCV_F: {"PortRcvRemotePhysicalErrors", 0xffff, 0x10}, C.IB_PC_ERR_SWITCH_REL_F: {"PortRcvSwitchRelayErrors", 0xffff, 0x20}, C.IB_PC_XMT_DISCARDS_F: {"PortXmitDiscards", 0xffff, 0x40}, C.IB_PC_ERR_XMTCONSTR_F: {"PortXmitConstraintErrors", 0xff, 0x80}, C.IB_PC_ERR_RCVCONSTR_F: {"PortRcvConstraintErrors", 0xff, 0x100}, C.IB_PC_ERR_LOCALINTEG_F: {"LocalLinkIntegrityErrors", 0xf, 0x200}, C.IB_PC_ERR_EXCESS_OVR_F: {"ExcessiveBufferOverrunErrors", 0xf, 0x400}, C.IB_PC_VL15_DROPPED_F: {"VL15Dropped", 0xffff, 0x800}, C.IB_PC_XMT_WAIT_F: {"PortXmitWait", 0xffffffff, 0x10000}, }
Standard (32-bit) counters and their display names. Counter lengths and field selects defined in IBTA spec v1.3, table 247 (PortCounters). Note: Standard data counters are absent from this map (e.g. PortXmitData, PortRcvData, PortXmitPkts, PortRcvPkts).
Functions ¶
func LinkSpeedExtToStr ¶
LinkSpeedExtToStr converts an InfiniBand extended link speed enum to a human-readable string. cf. IBTA spec v1.3, PortInfo, table 155.
func LinkSpeedToStr ¶
LinkSpeedToStr converts an InfiniBand link speed enum to a human-readable string. cf. IBTA spec v1.3, PortInfo, table 155.
func LinkWidthToStr ¶
LinkWidthToStr converts an InfiniBand link width enum to a human-readable string. cf. IBTA spec v1.3, PortInfo, table 155.
func PortPhysStateToStr ¶
PortPhysStateToStr converts an InfiniBand physical port state enum to a human-readable string.
func PortStateToStr ¶
PortStateToStr converts an InfiniBand port state enum to a human-readable string.
Types ¶
type HCA ¶
type HCA struct { Name string // contains filtered or unexported fields }
func (*HCA) NetDiscover ¶
type NodeNameMap ¶
type NodeNameMap struct {
// contains filtered or unexported fields
}
The NodeNameMap type holds a mapping of a 64-bit GUID to an InfiniBand node name / description.
func NewNodeNameMap ¶
func NewNodeNameMap(filePath string) (*NodeNameMap, error)
NewNodeNameMap opens and parses the SM node name map, returning a NodeNameMap of GUIDs and their node descriptions. The format of the node name map file is described in man page ibnetdiscover(8).
func (*NodeNameMap) RemapNodeName ¶
func (n *NodeNameMap) RemapNodeName(guid uint64, nodeDesc string) string
RemapNodeName attempts to map the specified GUID to a node description from the NodeNameMap. If the GUID is not found in the map, the supplied node description is simply returned unmodified.