From e95ac9237474537aeb3428d877975c326c25bb43 Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Sun, 14 May 2017 17:26:42 +0000 Subject: [PATCH] Documentation / comments --- README.md | 18 ++++++++++++++++++ main.go | 7 ++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5ed0b23..9635a47 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,21 @@ FabricMon's web interface, based on the d3.js graph library, and displayed as an SVG force graph. This project is a work in progress, in the early stages of development. + +Building FabricMon +------------------ +To build FabricMon, you will require the following development libraries +(Debian package names shown): + +* libibmad-dev +* libibumad-dev +* libibnetdisc-dev + +The corresponding runtime libraries will be required on the target system +unless you build the FabricMon binary with static linking. + +InfiniBand Counters +------------------- +Note that counters that represent data (e.g. PortXmitData and PortRcvData) are +divided by four (lanes). See https://community.mellanox.com/docs/DOC-2572 for +more information. diff --git a/main.go b/main.go index 9065ae9..3bb909f 100644 --- a/main.go +++ b/main.go @@ -184,6 +184,10 @@ func iterateSwitches(f *Fabric, nnMap *NodeNameMap, conf influxdbConf) { capMask := nativeEndian.Uint16(buf[2:4]) fmt.Printf("Cap Mask: %#02x\n", ntohs(capMask)) + // Note: In PortCounters, PortCountersExtended, PortXmitDataSL, and + // PortRcvDataSL, components that represent Data (e.g. PortXmitData and + // PortRcvData) indicate octets divided by 4 rather than just octets. + // Fetch standard (32 bit, some 16 bit) counters pmaBuf = C.pma_query_via(unsafe.Pointer(&buf), &portid, C.int(portNum), PMA_TIMEOUT, C.IB_GSI_PORT_COUNTERS, f.ibmadPort) @@ -215,9 +219,6 @@ func iterateSwitches(f *Fabric, nnMap *NodeNameMap, conf influxdbConf) { pmaBuf = C.pma_query_via(unsafe.Pointer(&buf), &portid, C.int(portNum), PMA_TIMEOUT, C.IB_GSI_PORT_COUNTERS_EXT, f.ibmadPort) if pmaBuf != nil { - // Note: In PortCounters, PortCountersExtended, PortXmitDataSL, and - // PortRcvDataSL, components that represent Data (e.g. PortXmitData and - // PortRcvData) indicate octets divided by 4 rather than just octets. for counter, displayName := range extCounterMap { tags["counter"] = displayName fields["value"] = getCounterUint32(pmaBuf, counter)