infiniband

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

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

View Source
const (
	PMA_TIMEOUT = 0

	IB_NODE_SWITCH = C.IB_NODE_SWITCH
)
View Source
const (
	SMINFO_NOTACT uint8 = iota
	SMINFO_DISCOVER
	SMINFO_STANDBY
	SMINFO_MASTER
)
View Source
const DEFAULT_NODE_NAME_MAP = "/etc/opensm/ib-node-name-map"
View Source
const (
	SYS_INFINIBAND = "/sys/class/infiniband"
)

Variables

View Source
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).

View Source
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

func LinkSpeedExtToStr(speed uint) string

LinkSpeedExtToStr converts an InfiniBand extended link speed enum to a human-readable string. cf. IBTA spec v1.3, PortInfo, table 155.

func LinkSpeedToStr

func LinkSpeedToStr(speed uint) string

LinkSpeedToStr converts an InfiniBand link speed enum to a human-readable string. cf. IBTA spec v1.3, PortInfo, table 155.

func LinkWidthToStr

func LinkWidthToStr(width uint) string

LinkWidthToStr converts an InfiniBand link width enum to a human-readable string. cf. IBTA spec v1.3, PortInfo, table 155.

func PortPhysStateToStr

func PortPhysStateToStr(state uint) string

PortPhysStateToStr converts an InfiniBand physical port state enum to a human-readable string.

func PortStateToStr

func PortStateToStr(state uint) string

PortStateToStr converts an InfiniBand port state enum to a human-readable string.

func UmadDone

func UmadDone()

UmadDone simply wraps the libibumad umad_done() function.

func UmadInit

func UmadInit() int

UmadInit simply wraps the libibumad umad_init() function.

Types

type Counter

type Counter struct {
	Name   string
	Limit  uint64
	Select uint32 // CounterSelect (bits 0-15), CounterSelect2 (bits 16-23)
}

type Fabric

type Fabric struct {
	Hostname   string
	CAName     string
	SourcePort int
	Nodes      []Node
}

type HCA

type HCA struct {
	Name string
	// contains filtered or unexported fields
}

func GetCAs

func GetCAs() []HCA

func (*HCA) NetDiscover

func (h *HCA) NetDiscover(output chan Fabric, mkey uint64, resetThreshold uint)

func (*HCA) Release

func (h *HCA) Release()

type Node

type Node struct {
	GUID     uint64
	NodeType int
	NodeDesc string
	VendorID uint
	DeviceID uint
	Ports    []Port
}

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.

type Port

type Port struct {
	GUID           uint64
	RemoteGUID     uint64
	RemoteNodeDesc string
	LinkWidth      string // link width, e.g., 1X, 4X, 8X, 12X
	LinkSpeed      string // link speed, e.g., SDR, DDR, QDR, FDR, FDR10, EDR
	Counters       map[uint32]interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL