Documentation ¶
Overview ¶
Package vfio provides a Mechanism for using vfio devices.
Index ¶
- Constants
- func New(cgroupDir string) *networkservice.Mechanism
- type Mechanism
- func (m *Mechanism) GetCgroupDir() string
- func (m *Mechanism) GetDeviceMajor() uint32
- func (m *Mechanism) GetDeviceMinor() uint32
- func (m *Mechanism) GetDeviceTokenID() string
- func (m *Mechanism) GetIommuGroup() uint
- func (m *Mechanism) GetPCIAddress() string
- func (m *Mechanism) GetParameters() map[string]string
- func (m *Mechanism) GetVfioMajor() uint32
- func (m *Mechanism) GetVfioMinor() uint32
- func (m *Mechanism) SetCgroupDir(cgroupDir string)
- func (m *Mechanism) SetDeviceMajor(deviceMajor uint32)
- func (m *Mechanism) SetDeviceMinor(deviceMinor uint32)
- func (m *Mechanism) SetDeviceTokenID(tokenID string)
- func (m *Mechanism) SetIommuGroup(iommuGroup uint)
- func (m *Mechanism) SetPCIAddress(pciAddress string)
- func (m *Mechanism) SetVfioMajor(vfioMajor uint32)
- func (m *Mechanism) SetVfioMinor(vfioMinor uint32)
Constants ¶
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 ¶
GetCgroupDir returns client on host cgroup directory
func (*Mechanism) GetDeviceMajor ¶
GetDeviceMajor returns /dev/${iommuGroup} major number
func (*Mechanism) GetDeviceMinor ¶
GetDeviceMinor returns /dev/${iommuGroup} minor number
func (*Mechanism) GetDeviceTokenID ¶ added in v1.1.0
GetDeviceTokenID returns device token ID
func (*Mechanism) GetIommuGroup ¶
GetIommuGroup returns IOMMU group id
func (*Mechanism) GetPCIAddress ¶
GetPCIAddress returns PCI address
func (*Mechanism) GetParameters ¶
GetParameters returns the map of all parameters to the mechanism
func (*Mechanism) GetVfioMajor ¶
GetVfioMajor returns /dev/vfio major number
func (*Mechanism) GetVfioMinor ¶
GetVfioMinor returns /dev/vfio minor number
func (*Mechanism) SetCgroupDir ¶
SetCgroupDir sets client on host cgroup directory
func (*Mechanism) SetDeviceMajor ¶
SetDeviceMajor sets /dev/${iommuGroup} major number
func (*Mechanism) SetDeviceMinor ¶
SetDeviceMinor sets /dev/${iommuGroup} minor number
func (*Mechanism) SetDeviceTokenID ¶ added in v1.1.0
SetDeviceTokenID sets device token ID
func (*Mechanism) SetIommuGroup ¶
SetIommuGroup sets IOMMU group id
func (*Mechanism) SetPCIAddress ¶
SetPCIAddress sets PCI address
func (*Mechanism) SetVfioMajor ¶
SetVfioMajor sets /dev/vfio major number
func (*Mechanism) SetVfioMinor ¶
SetVfioMinor sets /dev/vfio minor number