rdma

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrToolNotInstalled = errors.New("no RDMA tools installed (ibv_devinfo/ibstat)")

ErrToolNotInstalled is returned by Collect when neither ibv_devinfo nor ibstat can be resolved on the host.

Functions

This section is empty.

Types

type Device

type Device struct {
	Name      string
	NodeGUID  string
	FWVersion string
	Ports     []Port
}

Device describes a single RDMA host channel adapter.

func Merge

func Merge(devinfo, ibstat []Device) []Device

Merge combines devinfo (primary) with ibstat, matching devices by Name and ports by Num. devinfo is authoritative; ibstat fills empty fields and contributes devices or ports that devinfo lacked.

func ParseDevinfo

func ParseDevinfo(raw []byte) ([]Device, error)

ParseDevinfo parses `ibv_devinfo -v` output into devices.

func ParseIbstat

func ParseIbstat(raw []byte) ([]Device, error)

ParseIbstat parses `ibstat` output into devices.

type Port

type Port struct {
	Num       int
	State     string // e.g. "PORT_ACTIVE" / "PORT_DOWN" (devinfo) or "Active" (ibstat)
	Rate      string // raw rate number as reported by ibstat, e.g. "200"
	LinkLayer string // "InfiniBand" / "Ethernet"
}

Port describes a single RDMA device port.

type Result

type Result struct {
	Devices []Device
}

Result is the merged RDMA inventory.

func Collect

func Collect(ctx context.Context, runner execRunner) (*Result, error)

Collect resolves and runs ibv_devinfo and ibstat, then merges their output. If neither tool resolves, it returns ErrToolNotInstalled. A tool that resolves but fails to run, or whose output cannot be parsed, surfaces the error rather than being silently swallowed.

Jump to

Keyboard shortcuts

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