vfio

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 10

Documentation

Overview

Package vfio provides a Mechanism for using vfio devices.

Index

Constants

View Source
const (
	// MECHANISM string
	MECHANISM = "VFIO"

	// CgroupDirKey is a client on host cgroup directory property key
	CgroupDirKey = "cgroupDir"

	// IommuGroupKey is a IOMMU group id property key
	IommuGroupKey = "iommuGroup"

	// PCIAddressKey is a PCI address property key
	PCIAddressKey = common.PCIAddressKey

	// DeviceTokenIDKey is a device token ID property key
	DeviceTokenIDKey = common.DeviceTokenIDKey

	// VfioMajorKey is a /dev/vfio major number property key
	VfioMajorKey = "vfioMajor"

	// VfioMinorKey is a /dev/vfio minor number property key
	VfioMinorKey = "vfioMinor"

	// DeviceMajorKey is a /dev/${IOMMU group id} major number property key
	DeviceMajorKey = "deviceMajor"

	// DeviceMinorKey is a /dev/${IOMMU group id} minor number property key
	DeviceMinorKey = "deviceMinor"
)

Variables

This section is empty.

Functions

func New

func New(cgroupDir string) *networkservice.Mechanism

New returns *networkservice.Mechanism of type vfio with the given cgroupDir

Types

type Mechanism

type Mechanism struct {
	*networkservice.Mechanism
}

Mechanism is a vfio mechanism helper

func ToMechanism

func ToMechanism(m *networkservice.Mechanism) *Mechanism

ToMechanism converts unified mechanism to helper

func (*Mechanism) GetCgroupDir

func (m *Mechanism) GetCgroupDir() string

GetCgroupDir returns client on host cgroup directory

func (*Mechanism) GetDeviceMajor

func (m *Mechanism) GetDeviceMajor() uint32

GetDeviceMajor returns /dev/${iommuGroup} major number

func (*Mechanism) GetDeviceMinor

func (m *Mechanism) GetDeviceMinor() uint32

GetDeviceMinor returns /dev/${iommuGroup} minor number

func (*Mechanism) GetDeviceTokenID added in v1.1.0

func (m *Mechanism) GetDeviceTokenID() string

GetDeviceTokenID returns device token ID

func (*Mechanism) GetIommuGroup

func (m *Mechanism) GetIommuGroup() uint

GetIommuGroup returns IOMMU group id

func (*Mechanism) GetPCIAddress

func (m *Mechanism) GetPCIAddress() string

GetPCIAddress returns PCI address

func (*Mechanism) GetParameters

func (m *Mechanism) GetParameters() map[string]string

GetParameters returns the map of all parameters to the mechanism

func (*Mechanism) GetVfioMajor

func (m *Mechanism) GetVfioMajor() uint32

GetVfioMajor returns /dev/vfio major number

func (*Mechanism) GetVfioMinor

func (m *Mechanism) GetVfioMinor() uint32

GetVfioMinor returns /dev/vfio minor number

func (*Mechanism) SetCgroupDir

func (m *Mechanism) SetCgroupDir(cgroupDir string)

SetCgroupDir sets client on host cgroup directory

func (*Mechanism) SetDeviceMajor

func (m *Mechanism) SetDeviceMajor(deviceMajor uint32)

SetDeviceMajor sets /dev/${iommuGroup} major number

func (*Mechanism) SetDeviceMinor

func (m *Mechanism) SetDeviceMinor(deviceMinor uint32)

SetDeviceMinor sets /dev/${iommuGroup} minor number

func (*Mechanism) SetDeviceTokenID added in v1.1.0

func (m *Mechanism) SetDeviceTokenID(tokenID string)

SetDeviceTokenID sets device token ID

func (*Mechanism) SetIommuGroup

func (m *Mechanism) SetIommuGroup(iommuGroup uint)

SetIommuGroup sets IOMMU group id

func (*Mechanism) SetPCIAddress

func (m *Mechanism) SetPCIAddress(pciAddress string)

SetPCIAddress sets PCI address

func (*Mechanism) SetVfioMajor

func (m *Mechanism) SetVfioMajor(vfioMajor uint32)

SetVfioMajor sets /dev/vfio major number

func (*Mechanism) SetVfioMinor

func (m *Mechanism) SetVfioMinor(vfioMinor uint32)

SetVfioMinor sets /dev/vfio minor number

Jump to

Keyboard shortcuts

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