devbind

package module
v0.0.0-...-236bfc1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkGroup  string = "NetworkGroup"
	CryptoGroup   string = "CryptoGroup"
	DMAGroup      string = "DMAGroup"
	EventdevGroup string = "EventdevGroup"
	MempoolGroup  string = "MempoolGroup"
	CompressGroup string = "CompressGroup"
)

Group constant strings

Variables

View Source
var DeviceClassNames = map[DevClassID]string{
	UnclassifiedDevice:               "UnclassifiedDevice",
	MassStorageController:            "MassStorageController",
	NetworkController:                "NetworkController",
	DisplayController:                "DisplayController",
	MultimediaController:             "MultimediaController",
	MemoryController:                 "MemoryController",
	BridgeController:                 "BridgeController",
	CommunicationController:          "CommunicationController",
	GenericSystemPeripheral:          "GenericSystemPeripheral",
	InputDeviceController:            "InputDeviceController",
	DockingStation:                   "DockingStation",
	ProcessorClass:                   "ProcessorClass",
	SerialBusController:              "SerialBusController",
	WirelessController:               "WirelessController",
	IntelligentController:            "IntelligentController",
	SatelliteCommunicationController: "SatelliteCommunicationController",
	EncryptionController:             "EncryptionController",
	SignalProcessingController:       "SignalProcessingController",
	ProcessingAccelerators:           "ProcessingAccelerators",
	NonEssentialInstrumentation:      "NonEssentialInstrumentation",
	Coprocessor:                      "Coprocessor",
}

DeviceClassNames in string format

View Source
var UioModules = []string{"igb_uio", "vfio-pci", "uio_pci_generic"}

UioModules supported

ValidGroups currently allowed

Functions

func LoadDeviceFile

func LoadDeviceFile(files string) (DevConfigs, DevGroups, error)

LoadDeviceFile and create the config and groups

func ValidateDeviceFile

func ValidateDeviceFile(file string) (DevConfigs, DevGroups, error)

ValidateDeviceFile is a valid TOML file for devbind

Types

type BindInfo

type BindInfo struct {
	Devices    DeviceList
	CfgDevices DevConfigs
	Groups     DevGroups
}

BindInfo - Device Binding information

func New

func New(devFile ...string) *BindInfo

New - create a new DevBindInfo structure

func (*BindInfo) FindDevicesByDeviceClass

func (db *BindInfo) FindDevicesByDeviceClass(name string, devClasses []*DeviceConfig) map[string]*DeviceClass

FindDevicesByDeviceClass all devices matching the given device class

type DevClassID

type DevClassID string

DevClassID value

const (
	UnclassifiedDevice               DevClassID = "00"
	MassStorageController            DevClassID = "01"
	NetworkController                DevClassID = "02"
	DisplayController                DevClassID = "03"
	MultimediaController             DevClassID = "04"
	MemoryController                 DevClassID = "05"
	BridgeController                 DevClassID = "06"
	CommunicationController          DevClassID = "07"
	GenericSystemPeripheral          DevClassID = "08"
	InputDeviceController            DevClassID = "09"
	DockingStation                   DevClassID = "0a"
	ProcessorClass                   DevClassID = "0b"
	SerialBusController              DevClassID = "0c"
	WirelessController               DevClassID = "0d"
	IntelligentController            DevClassID = "0e"
	SatelliteCommunicationController DevClassID = "0f"
	EncryptionController             DevClassID = "10"
	SignalProcessingController       DevClassID = "11"
	ProcessingAccelerators           DevClassID = "12"
	NonEssentialInstrumentation      DevClassID = "13"
	Coprocessor                      DevClassID = "40"
)

PCI Device class values

type DevConfigs

type DevConfigs map[string]*DeviceConfig

DevConfigs is list of devices in devices.toml

type DevGroups

type DevGroups map[string][]*DeviceConfig

DevGroups is the map of devices to a group name

type DevSubClassID

type DevSubClassID string

DevSubClassID value

type DeviceClass

type DeviceClass struct {
	Slot  string
	Class struct {
		ID  DevClassID
		Sub DevSubClassID
		Str string
	}
	Vendor struct {
		ID  VendorID
		Str string
	}
	Device struct {
		ID  DeviceID
		Str string
	}
	SVendor struct {
		ID  SVendorID
		Str string
	}
	SDevice struct {
		ID  SDeviceID
		Str string
	}
	Rev       string
	Driver    string
	Module    string
	Unused    string
	Interface string
	NumaNode  string
	SSHIf     string
	Active    bool
}

DeviceClass - Network Class information

type DeviceConfig

type DeviceConfig struct {
	Group string `toml:"group"`
	Desc  string `toml:"desc"`
	Class struct {
		ID  DevClassID    `toml:"devclass"`
		Sub DevSubClassID `toml:"subclass"`
	} `toml:"class"`
	Vendor  VendorID  `toml:"vendor_id"`
	Device  DeviceID  `toml:"device_id"`
	SVendor SVendorID `toml:"svendor_id"`
	SDevice SDeviceID `toml:"sdevice_id"`
}

DeviceConfig - Network Class information

type DeviceID

type DeviceID string

DeviceID type

type DeviceList

type DeviceList map[string]*DeviceClass

DeviceList is a list of all devices found in system

type SDeviceID

type SDeviceID string

SDeviceID type

type SVendorID

type SVendorID string

SVendorID type

type VendorID

type VendorID string

VendorID type

const (
	IntelVendorID  VendorID = "8086"
	CaviumVendorID VendorID = "177d"
	RedHatVendorID VendorID = "1af4"
)

VendorID values

Jump to

Keyboard shortcuts

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