rdmanl

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package rdmanl provides a client for RDMA netlink (NETLINK_RDMA) in pure Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindQPReq

type BindQPReq struct {
	DevIndex  uint32
	PortIndex uint32
	LQPN      uint32
	CounterID *uint32
}

A BindQPReq binds the QP LQPN of a port to the counter CounterID, or to a new counter if CounterID is nil.

type CMID

type CMID struct {
	// Port, or 0 until the ID is bound to one
	Port uint32
	ID   uint32
	// Port space, enum rdma_ucm_port_space, and state, enum rdma_cm_state
	PortSpace uint32
	State     uint8
	// Its QP, if it has one: number and type, enum ib_qp_type
	QPN    *uint32
	QPType *uint8
	// Source and destination addresses, for IPv4 and IPv6
	Src netip.AddrPort
	Dst netip.AddrPort
	// Process of a user ID, or the module of a kernel ID
	PID      uint32
	KernName string
	Driver   []Driver
}

A CMID is an RDMA CM ID.

type CMIDReq

type CMIDReq struct {
	DevIndex uint32
	// The port: a filter for CMIDs, if not 0; required for CMID
	PortIndex uint32
	CMIDN     uint32
	// Whether to include RDMA CM IDs only drivers use
	DriverDetails bool
}

A CMIDReq asks for the RDMA CM IDs of a device, or for one RDMA CM ID by its number: CMIDs uses DriverDetails, CMID uses CMIDN.

type CQ

type CQ struct {
	ID uint32
	// Number of entries
	CQE uint32
	// Number of QPs and other objects using it
	Users uint64
	// Whether it uses adaptive moderation (DIM)
	Dim bool
	// How a kernel CQ is polled, enum ib_poll_context
	PollCtx *uint8
	// User context of a user CQ
	CtxN *uint32
	// Process of a user CQ, or the module of a kernel CQ
	PID      uint32
	KernName string
	Driver   []Driver
}

A CQ is a completion queue.

type CQReq

type CQReq struct {
	DevIndex uint32
	CQN      uint32
	// Whether to include CQs only drivers use
	DriverDetails bool
}

A CQReq asks for the CQs of a device, or for one CQ by its number: CQs uses DriverDetails, CQ uses CQN.

type Chardev

type Chardev struct {
	// Name under /dev/infiniband, such as "uverbs0"
	Name string
	// ABI revision
	ABI uint64
	// Device number (dev_t)
	Dev uint64
	// Driver of the device, enum rdma_driver_id; only for "uverbs"
	DriverID uint32
}

A Chardev is a character device of a device, such as its uverbs device.

type ChardevReq

type ChardevReq struct {
	DevIndex *uint32
	// The port, from 1, or 0 for the device itself
	PortIndex   uint32
	ChardevType string
}

A ChardevReq asks for the character device of the type ChardevType, such as "uverbs", "umad" or "rdma_cm": of the device DevIndex, of its port PortIndex, or of no device if DevIndex is nil.

type Config

type Config struct {
	// NetNS is the network namespace to operate in. If 0, the current
	// network namespace is used.
	NetNS int
}

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

A Conn is a connection to RDMA netlink.

func Open

func Open(config *Config) (*Conn, error)

Open opens a connection to RDMA netlink. config may be nil.

func (*Conn) BindQP

func (c *Conn) BindQP(req BindQPReq) (uint32, error)

BindQP binds a QP to a counter and returns the counter's ID, like "rdma statistic qp bind".

func (*Conn) CMID

func (c *Conn) CMID(req CMIDReq) (CMID, error)

CMID returns a RDMA CM ID of a device.

func (*Conn) CMIDs

func (c *Conn) CMIDs(req CMIDReq) ([]CMID, error)

CMIDs returns the RDMA CM IDs of a device, like "rdma resource show cm_id".

func (*Conn) CQ

func (c *Conn) CQ(req CQReq) (CQ, error)

CQ returns a CQ of a device.

func (*Conn) CQs

func (c *Conn) CQs(req CQReq) ([]CQ, error)

CQs returns the CQs of a device, like "rdma resource show cq".

func (*Conn) Chardev

func (c *Conn) Chardev(req ChardevReq) (Chardev, error)

Chardev returns a character device.

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Context

func (c *Conn) Context(req ContextReq) (Context, error)

Context returns a user context of a device.

func (*Conn) Contexts

func (c *Conn) Contexts(req ContextReq) ([]Context, error)

Contexts returns the user contexts of a device, like "rdma resource show ctx".

func (*Conn) CounterMode

func (c *Conn) CounterMode(req CounterModeReq) (CounterConfig, error)

CounterMode returns how the QPs of a port are bound to counters, like "rdma statistic qp mode".

func (*Conn) CounterStatus

func (c *Conn) CounterStatus(req CounterStatusReq) ([]CounterStatus, error)

CounterStatus returns the status of the counters of a port, like "rdma statistic mode supported".

func (*Conn) Counters

func (c *Conn) Counters(req CountersReq) ([]Counter, error)

Counters returns the counters of a port, like "rdma statistic show".

func (*Conn) DelDev

func (c *Conn) DelDev(req DelDevReq) error

DelDev deletes a sub-device, like "rdma dev delete".

func (c *Conn) DelLink(req DelLinkReq) error

DelLink deletes a software device, like "rdma link delete".

func (*Conn) Device

func (c *Conn) Device(req DeviceReq) (Device, error)

Device returns a device.

func (*Conn) Devices

func (c *Conn) Devices() ([]Device, error)

Devices returns the RDMA devices of the connection's network namespace.

func (*Conn) EnableCounters

func (c *Conn) EnableCounters(req EnableCountersReq) error

EnableCounters enables optional counters, like "rdma statistic set".

func (*Conn) FRMRPools

func (c *Conn) FRMRPools(req FRMRPoolsReq) ([]FRMRPool, error)

FRMRPools returns the FRMR pools of a device.

func (*Conn) MR

func (c *Conn) MR(req MRReq) (MR, error)

MR returns an MR of a device.

func (*Conn) MRCounter

func (c *Conn) MRCounter(req MRCounterReq) (MRCounters, error)

MRCounter returns the counters of an MR.

func (*Conn) MRCounters

func (c *Conn) MRCounters(req MRCounterReq) ([]MRCounters, error)

MRCounters returns the counters of the MRs of a device, like "rdma statistic mr show".

func (*Conn) MRs

func (c *Conn) MRs(req MRReq) ([]MR, error)

MRs returns the MRs of a device, like "rdma resource show mr".

func (*Conn) Monitor

func (c *Conn) Monitor() (*Monitor, error)

Monitor starts receiving events, on a socket of its own. No event after Monitor returns is missed.

func (*Conn) NewDev

func (c *Conn) NewDev(req NewDevReq) error

NewDev adds a sub-device, like "rdma dev add".

func (c *Conn) NewLink(req NewLinkReq) error

NewLink adds a software device, like "rdma link add".

func (*Conn) PD

func (c *Conn) PD(req PDReq) (PD, error)

PD returns a PD of a device.

func (*Conn) PDs

func (c *Conn) PDs(req PDReq) ([]PD, error)

PDs returns the PDs of a device, like "rdma resource show pd".

func (*Conn) Port

func (c *Conn) Port(req PortReq) (Port, error)

Port returns a port of a device.

func (*Conn) Ports

func (c *Conn) Ports(req PortReq) ([]Port, error)

Ports returns the ports of a device.

func (*Conn) QP

func (c *Conn) QP(req QPReq) (QP, error)

QP returns a QP of a device.

func (*Conn) QPCounter

func (c *Conn) QPCounter(req QPCounterReq) (QPCounter, error)

QPCounter returns a counter QPs are bound to.

func (*Conn) QPCounters

func (c *Conn) QPCounters(req QPCounterReq) ([]QPCounter, error)

QPCounters returns the counters QPs of a device are bound to, like "rdma statistic qp show".

func (*Conn) QPs

func (c *Conn) QPs(req QPReq) ([]QP, error)

QPs returns the QPs of a device, like "rdma resource show qp".

func (*Conn) RawCQ

func (c *Conn) RawCQ(req CQReq) ([]byte, error)

RawCQ returns a CQ of a device in the driver's format.

func (*Conn) RawCQs

func (c *Conn) RawCQs(req CQReq) ([][]byte, error)

RawCQs returns the CQs of a device in the driver's format, for drivers that have one, such as mlx5.

func (*Conn) RawMR

func (c *Conn) RawMR(req MRReq) ([]byte, error)

RawMR returns an MR of a device in the driver's format.

func (*Conn) RawMRs

func (c *Conn) RawMRs(req MRReq) ([][]byte, error)

RawMRs returns the MRs of a device in the driver's format, for drivers that have one, such as mlx5.

func (*Conn) RawQP

func (c *Conn) RawQP(req QPReq) ([]byte, error)

RawQP returns a QP of a device in the driver's format.

func (*Conn) RawQPs

func (c *Conn) RawQPs(req QPReq) ([][]byte, error)

RawQPs returns the QPs of a device in the driver's format, for drivers that have one, such as mlx5.

func (*Conn) RawSRQ

func (c *Conn) RawSRQ(req SRQReq) ([]byte, error)

RawSRQ returns an SRQ of a device in the driver's format.

func (*Conn) RawSRQs

func (c *Conn) RawSRQs(req SRQReq) ([][]byte, error)

RawSRQs returns the SRQs of a device in the driver's format, for drivers that have one, such as mlx5.

func (*Conn) Rename

func (c *Conn) Rename(req RenameReq) error

Rename renames a device, like "rdma dev set name".

func (*Conn) Resources

func (c *Conn) Resources(req ResourcesReq) ([]ResourceCount, error)

Resources returns how many objects of each kind a device has, like "rdma resource show".

func (*Conn) SRQ

func (c *Conn) SRQ(req SRQReq) (SRQ, error)

SRQ returns an SRQ of a device.

func (*Conn) SRQs

func (c *Conn) SRQs(req SRQReq) ([]SRQ, error)

SRQs returns the SRQs of a device, like "rdma resource show srq".

func (*Conn) SetAutoCounterMode

func (c *Conn) SetAutoCounterMode(req SetAutoCounterModeReq) error

SetAutoCounterMode sets the automatic counter mode, like "rdma statistic qp set link auto".

func (*Conn) SetDim

func (c *Conn) SetDim(req SetDimReq) error

SetDim turns adaptive moderation on or off, like "rdma dev set adaptive-moderation".

func (*Conn) SetFRMRAgingPeriod

func (c *Conn) SetFRMRAgingPeriod(req SetFRMRAgingPeriodReq) error

SetFRMRAgingPeriod sets the aging period of a device's FRMR pools.

func (*Conn) SetFRMRPinnedHandles

func (c *Conn) SetFRMRPinnedHandles(req SetFRMRPinnedHandlesReq) error

SetFRMRPinnedHandles pins handles in an FRMR pool.

func (*Conn) SetNetNS

func (c *Conn) SetNetNS(req SetNetNSReq) error

SetNetNS moves a device to another network namespace, like "rdma dev set netns". It needs the exclusive network namespace mode.

func (*Conn) SetNetNSMode

func (c *Conn) SetNetNSMode(req SetNetNSModeReq) error

SetNetNSMode sets the network namespace mode, like "rdma system set netns".

func (*Conn) SetPrivilegedQKeyMode

func (c *Conn) SetPrivilegedQKeyMode(req SetPrivilegedQKeyModeReq) error

SetPrivilegedQKeyMode sets the privileged Q_Key mode, like "rdma system set privileged-qkey".

func (*Conn) Sys

func (c *Conn) Sys() (Sys, error)

Sys returns the settings of the RDMA subsystem, like "rdma system show".

func (*Conn) UnbindQP

func (c *Conn) UnbindQP(req UnbindQPReq) error

UnbindQP unbinds a QP from a counter, like "rdma statistic qp unbind".

type Context

type Context struct {
	ID       uint32
	PID      uint32
	KernName string
}

A Context is the user context of a process that opened a device.

type ContextReq

type ContextReq struct {
	DevIndex uint32
	CtxN     uint32
	// Whether to include user contexts only drivers use
	DriverDetails bool
}

A ContextReq asks for the user contexts of a device, or for one user context by its number: Contexts uses DriverDetails, Context uses CtxN.

type Counter

type Counter struct {
	Name  string
	Value uint64
}

A Counter is a hardware counter.

type CounterConfig

type CounterConfig struct {
	Mode CounterMode
	// With CounterModeAuto: the criteria, and whether per-opcode counters
	// are on
	Mask       CounterMask
	Opcounters bool
}

A CounterConfig is how the QPs of a port are bound to counters.

type CounterMask

type CounterMask uint32

CounterMask is the criteria by which CounterModeAuto groups QPs.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L649

const (
	CounterMaskQPType CounterMask = 1 << 0 // RDMA_COUNTER_MASK_QP_TYPE
	CounterMaskPID    CounterMask = 1 << 1 // RDMA_COUNTER_MASK_PID
)

type CounterMode

type CounterMode uint32

CounterMode is how QPs are bound to counters.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L624

const (
	CounterModeNone   CounterMode = 0 // RDMA_COUNTER_MODE_NONE
	CounterModeAuto   CounterMode = 1 // RDMA_COUNTER_MODE_AUTO
	CounterModeManual CounterMode = 2 // RDMA_COUNTER_MODE_MANUAL
)

type CounterModeReq

type CounterModeReq struct {
	DevIndex  uint32
	PortIndex uint32
}

A CounterModeReq asks how the QPs of a port are bound to counters.

type CounterStatus

type CounterStatus struct {
	Name string
	// Index, for EnableCounters
	Index    uint32
	Optional bool
	Enabled  bool
}

A CounterStatus tells whether a counter of a port is optional, and enabled.

type CounterStatusReq

type CounterStatusReq struct {
	DevIndex  uint32
	PortIndex uint32
}

A CounterStatusReq asks which counters of a port are optional, and enabled.

type CountersReq

type CountersReq struct {
	DevIndex  uint32
	PortIndex uint32
}

A CountersReq asks for the counters of a port.

type DelDevReq

type DelDevReq struct {
	DevIndex uint32
}

A DelDevReq deletes a sub-device.

type DelLinkReq

type DelLinkReq struct {
	DevIndex uint32
}

A DelLinkReq deletes a software device.

type DevType

type DevType uint8

DevType is the type of a sub-device.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L655

const (
	// A sub-device for subnet management (QP0) of its parent.
	DevTypeSMI DevType = 1 // RDMA_DEVICE_TYPE_SMI
)

type Device

type Device struct {
	Index uint32
	// Name, such as "mlx5_0" or "rxe0"
	Name string
	// Number of ports; they are numbered from 1
	Ports uint32
	// Capabilities, enum ib_device_cap_flags
	CapFlags uint64
	// Firmware version, if the device has firmware
	FWVersion string
	// Node and system image GUIDs, in host byte order
	NodeGUID     uint64
	SysImageGUID uint64
	// Node type, enum rdma_node_type
	NodeType uint8
	// Whether CQs use adaptive moderation (DIM)
	Dim bool
	// Protocol, such as "ib", "roce", "iw" or "opa"
	Protocol string
	// Type and parent of a sub-device; zero for other devices
	Type       DevType
	ParentName string
	// How the device got its name
	NameAssignType NameAssignType
}

A Device is an RDMA device.

type DeviceReq

type DeviceReq struct {
	DevIndex uint32
}

A DeviceReq asks for a device.

type Driver

type Driver struct {
	Name      string
	PrintType *PrintType
	String    *string
	S32       *int32
	U32       *uint32
	S64       *int64
	U64       *uint64
}

A Driver is a driver-specific attribute of an object, such as the hardware number of an mlx5 QP: a name, and a value of one of the types.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L482

type EnableCountersReq

type EnableCountersReq struct {
	DevIndex  uint32
	PortIndex uint32
	Indices   []uint32
}

An EnableCountersReq enables the optional counters of a port with the indices Indices, and disables the others. The kernel takes a list of indices, not of counters; an empty list disables them all.

type Event

type Event struct {
	Type EventType
	// The device: for every event but EventNetdevRename
	DevIndex uint32
	DevName  string
	// The port and its netdev: for netdev events
	Port      uint32
	NdevIndex uint32
	NdevName  string
}

An Event is a change to the devices of a network namespace.

type EventType

type EventType uint8

EventType is the kind of a monitoring event.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L668

const (
	EventRegister     EventType = 0 // RDMA_REGISTER_EVENT: a device was added
	EventUnregister   EventType = 1 // RDMA_UNREGISTER_EVENT: a device was removed
	EventNetdevAttach EventType = 2 // RDMA_NETDEV_ATTACH_EVENT: a netdev was attached to a port
	EventNetdevDetach EventType = 3 // RDMA_NETDEV_DETACH_EVENT: a netdev was detached from a port
	EventRename       EventType = 4 // RDMA_RENAME_EVENT: a device was renamed
	EventNetdevRename EventType = 5 // RDMA_NETDEV_RENAME_EVENT: the netdev of a port was renamed
)

type FRMRKey

type FRMRKey struct {
	ATS          bool
	AccessFlags  uint32
	VendorKey    uint64
	NumDMABlocks uint64
	// Set for pools the kernel uses internally; it can't be set in
	// SetFRMRPinnedHandles
	KernelVendorKey uint64
}

An FRMRKey identifies a pool of fast-registration MRs: the kind of MRs it holds.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L596

type FRMRPool

type FRMRPool struct {
	Key FRMRKey
	// Handles in the pool
	QueueHandles uint32
	// The most handles in use at once, and those in use now
	MaxInUse uint64
	InUse    uint64
	// Handles kept from aging out
	PinnedHandles uint32
}

An FRMRPool is a pool of fast-registration MRs the kernel keeps for a device.

type FRMRPoolsReq

type FRMRPoolsReq struct {
	DevIndex uint32
	// Whether to include the pools of keys only the kernel uses
	DriverDetails bool
}

An FRMRPoolsReq asks for the FRMR pools of a device.

type MR

type MR struct {
	ID uint32
	// Length in bytes
	Length uint64
	// Keys, for privileged connections (CAP_NET_ADMIN) only
	RKey *uint32
	LKey *uint32
	// PD of a user MR
	PDN *uint32
	// Process of a user MR, or the module of a kernel MR
	PID      uint32
	KernName string
	Driver   []Driver
}

An MR is a memory region.

type MRCounterReq

type MRCounterReq struct {
	DevIndex uint32
	MRN      uint32
	// Whether to include MRs only drivers use
	DriverDetails bool
}

An MRCounterReq asks for the counters of the MRs of a device, or of one MR: MRCounters uses DriverDetails, MRCounter uses MRN.

type MRCounters

type MRCounters struct {
	ID       uint32
	Counters []Counter
}

MRCounters are the counters of an MR, for drivers that count per MR.

type MRReq

type MRReq struct {
	DevIndex uint32
	MRN      uint32
	// Whether to include MRs only drivers use
	DriverDetails bool
}

An MRReq asks for the MRs of a device, or for one MR by its number: MRs uses DriverDetails, MR uses MRN.

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

A Monitor receives the events of the devices of a network namespace, like "rdma monitor".

func (*Monitor) Close

func (m *Monitor) Close() error

Close stops receiving events. A waiting Receive returns an error.

func (*Monitor) Receive

func (m *Monitor) Receive() (Event, error)

Receive waits for the next event, until the deadline, if one is set, or until Close. It returns one event per call.

func (*Monitor) SetDeadline

func (m *Monitor) SetDeadline(t time.Time) error

SetDeadline sets when a waiting Receive gives up. The zero time means never.

type NameAssignType

type NameAssignType uint8

NameAssignType tells how a device got its name.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L660

const (
	NameAssignTypeUnknown NameAssignType = 0 // RDMA_NAME_ASSIGN_TYPE_UNKNOWN
	NameAssignTypeUser    NameAssignType = 1 // RDMA_NAME_ASSIGN_TYPE_USER
)

type NewDevReq

type NewDevReq struct {
	DevIndex uint32
	DevName  string
	DevType  DevType
}

A NewDevReq adds a sub-device named DevName of the type DevType to the device DevIndex.

type NewLinkReq

type NewLinkReq struct {
	DevName  string
	LinkType string
	NdevName string
}

A NewLinkReq adds a software device named DevName of the link type LinkType, such as "rxe" or "siw", on the netdev NdevName.

type PD

type PD struct {
	ID uint32
	// Number of objects in it
	Users uint64
	// Keys, for privileged connections (CAP_NET_ADMIN) only
	LocalDMALKey     *uint32
	UnsafeGlobalRKey *uint32
	// User context of a user PD
	CtxN *uint32
	// Process of a user PD, or the module of a kernel PD
	PID      uint32
	KernName string
	Driver   []Driver
}

A PD is a protection domain.

type PDReq

type PDReq struct {
	DevIndex uint32
	PDN      uint32
	// Whether to include PDs only drivers use
	DriverDetails bool
}

A PDReq asks for the PDs of a device, or for one PD by its number: PDs uses DriverDetails, PD uses PDN.

type Port

type Port struct {
	DevIndex uint32
	DevName  string
	// Port number, from 1
	Index uint32
	// Logical and physical state, enum ib_port_state and
	// ib_port_phys_state
	State     uint8
	PhysState uint8
	// Netdev of a RoCE or iWARP port, if it has one
	NdevIndex uint32
	NdevName  string
	// InfiniBand ports only: capabilities (CapabilityMask, then
	// CapabilityMask2 above bit 32), subnet prefix in host byte order, LIDs
	// and LID mask control
	CapFlags     uint64
	SubnetPrefix uint64
	LID          uint32
	SMLID        uint32
	LMC          uint8
}

A Port is a port of a device.

type PortReq

type PortReq struct {
	DevIndex  uint32
	PortIndex uint32
}

A PortReq asks for the ports of a device, or for one of them: Ports lists them all, Port uses PortIndex.

type PrintType

type PrintType uint8

PrintType tells how to show the value of a Driver.

https://github.com/torvalds/linux/blob/v7.3/include/uapi/rdma/rdma_netlink.h#L318

const (
	PrintTypeUnspec PrintType = 0
	PrintTypeHex    PrintType = 1
)

type QP

type QP struct {
	// Port, or 0 until the QP is bound to one
	Port uint32
	QPN  uint32
	// Type and state, enum ib_qp_type and ib_qp_state
	Type  uint8
	State uint8
	// RC and UC QPs only: the remote QP number and the receive queue PSN
	RemoteQPN *uint32
	RQPSN     *uint32
	SQPSN     uint32
	// RC, UC and XRC QPs only: path migration state, enum ib_mig_state
	PathMigState *uint8
	// Subtype of a driver QP
	Subtype string
	// PD of a user QP
	PDN *uint32
	// Process of a user QP, or the module of a kernel QP
	PID      uint32
	KernName string
	Driver   []Driver
}

A QP is a queue pair.

type QPCounter

type QPCounter struct {
	Port uint32
	ID   uint32
	Mode CounterMode
	// The QP type and process it counts, with CounterModeAuto
	QPType   *uint8
	PID      uint32
	KernName string
	// The QPs bound to it
	QPs      []uint32
	Counters []Counter
}

A QPCounter is a counter QPs are bound to.

type QPCounterReq

type QPCounterReq struct {
	DevIndex uint32
	// The port: a filter for QPCounters, if not 0; required for QPCounter
	PortIndex uint32
	CounterID uint32
	// Whether to include counters only drivers use
	DriverDetails bool
}

A QPCounterReq asks for the counters QPs of a device are bound to, or for one of them: QPCounters uses DriverDetails, QPCounter uses CounterID.

type QPRange

type QPRange struct {
	Min uint32
	Max uint32
}

A QPRange is the QP numbers from Min to Max.

type QPReq

type QPReq struct {
	DevIndex uint32
	// The port: a filter for QPs, if not 0; required for QP
	PortIndex uint32
	LQPN      uint32
	// Whether to include QPs only drivers use
	DriverDetails bool
}

A QPReq asks for the QPs of a device, or for one QP by its number: QPs uses DriverDetails, QP uses LQPN.

type RenameReq

type RenameReq struct {
	DevIndex uint32
	DevName  string
}

A RenameReq renames a device to DevName.

type ResourceCount

type ResourceCount struct {
	// Kind, such as "qp", "cq", "mr" or "pd"
	Name string
	Curr uint64
	// The most the device supports, or 0 if it has no limit
	Max uint64
}

A ResourceCount is how many objects of one kind a device has.

type ResourcesReq

type ResourcesReq struct {
	DevIndex uint32
	// Whether to count objects only drivers use
	DriverDetails bool
}

A ResourcesReq asks how many objects of each kind a device has.

type SRQ

type SRQ struct {
	ID uint32
	// Type, enum ib_srq_type
	Type uint8
	PDN  uint32
	// CQ of an XRC SRQ
	CQN *uint32
	// QPs using it, as ranges of QP numbers
	QPs []QPRange
	// Process of a user SRQ, or the module of a kernel SRQ
	PID      uint32
	KernName string
	Driver   []Driver
}

An SRQ is a shared receive queue.

type SRQReq

type SRQReq struct {
	DevIndex uint32
	SRQN     uint32
	// Whether to include SRQs only drivers use
	DriverDetails bool
}

An SRQReq asks for the SRQs of a device, or for one SRQ by its number: SRQs uses DriverDetails, SRQ uses SRQN.

type SetAutoCounterModeReq

type SetAutoCounterModeReq struct {
	DevIndex   uint32
	PortIndex  uint32
	Mask       CounterMask
	Opcounters bool
}

A SetAutoCounterModeReq binds new QPs of a port to counters automatically: a counter for each group of QPs with the same criteria of Mask. A Mask of 0 stops it. Opcounters turns per-opcode counters on.

type SetDimReq

type SetDimReq struct {
	DevIndex uint32
	DevDim   bool
}

A SetDimReq turns adaptive moderation (DIM) of a device's CQs on or off.

type SetFRMRAgingPeriodReq

type SetFRMRAgingPeriodReq struct {
	DevIndex    uint32
	AgingPeriod uint32
}

A SetFRMRAgingPeriodReq sets how many seconds an unused FRMR handle of a device stays in its pool.

type SetFRMRPinnedHandlesReq

type SetFRMRPinnedHandlesReq struct {
	DevIndex      uint32
	Key           FRMRKey
	PinnedHandles uint32
}

A SetFRMRPinnedHandlesReq keeps PinnedHandles handles of the pool of Key from aging out.

type SetNetNSModeReq

type SetNetNSModeReq struct {
	NetNSShared bool
}

A SetNetNSModeReq sets whether devices are shared by all network namespaces, rather than each belonging to one.

type SetNetNSReq

type SetNetNSReq struct {
	DevIndex uint32
	NetNSFD  int
	DevName  string
}

A SetNetNSReq moves a device to the network namespace of the file descriptor NetNSFD, and names it DevName there, unless DevName is empty.

type SetPrivilegedQKeyModeReq

type SetPrivilegedQKeyModeReq struct {
	PrivilegedQKey bool
}

A SetPrivilegedQKeyModeReq sets whether only privileged processes may use privileged Q_Keys.

type Sys

type Sys struct {
	// Whether devices are shared by all network namespaces, rather than
	// each belonging to one
	NetNSShared bool
	// Whether only privileged processes may use privileged Q_Keys
	PrivilegedQKey bool
	// Whether the kernel sends monitoring events (see Monitor)
	Monitor bool
	// Whether pinned memory is copied on fork, rather than shared
	CopyOnFork bool
}

Sys is the settings of the RDMA subsystem.

type UnbindQPReq

type UnbindQPReq struct {
	DevIndex  uint32
	PortIndex uint32
	CounterID uint32
	LQPN      uint32
}

An UnbindQPReq unbinds the QP LQPN of a port from the counter CounterID.

Jump to

Keyboard shortcuts

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