Documentation ¶
Index ¶
Constants ¶
const ( VhostVdpaDriver = "vhost_vdpa" VirtioVdpaDriver = "virtio_vdpa" )
Exported constants
const ( VdpaCmdUnspec uint8 = iota VdpaCmdMgmtDevNew VdpaCmdMgmtDevGet /* can dump */ VdpaCmdDevNew VdpaCmdDevDel VdpaCmdDevGet /* can dump */ VdpaCmdDevConfigGet /* can dump */ )
VDPA Netlink Commands
const ( VdpaAttrUnspec = iota /* bus name (optional) + dev name together make the parent device handle */ VdpaAttrMgmtDevBusName /* string */ VdpaAttrMgmtDevDevName /* string */ VdpaAttrMgmtDevSupportedClasses /* u64 */ VdpaAttrDevName /* string */ VdpaAttrDevID /* u32 */ VdpaAttrDevVendorID /* u32 */ VdpaAttrDevMaxVqs /* u32 */ VdpaAttrDevMaxVqSize /* u16 */ VdpaAttrDevMinVqSize /* u16 */ VdpaAttrDevNetCfgMacAddr /* binary */ VdpaAttrDevNetStatus /* u8 */ VdpaAttrDevNetCfgMaxVqp /* u16 */ VdpaAttrGetNetCfgMTU /* u16 */ /* new attributes must be added above here */ VdpaAttrMax )
VDPA Netlink Attributes
const (
VdpaGenlName = "vdpa"
)
Vdpa Netlink Name
Variables ¶
This section is empty.
Functions ¶
func AddVdpaDevice ¶ added in v0.1.4
AddVdpaDevice adds a new vdpa device to the given management device
func DeleteVdpaDevice ¶ added in v0.1.4
DeleteVdpaDevice deletes a vdpa device
func SetNetlinkOps ¶ added in v0.1.4
func SetNetlinkOps(mockInst NetlinkOps)
SetNetlinkOps method would be used by unit tests
Types ¶
type MgmtDev ¶ added in v0.1.4
type MgmtDev interface { BusName() string // Optional DevName() string // Name() string // The MgmtDevName is BusName/DevName }
MgmtDev represents a Vdpa Management Device
func GetVdpaMgmtDevices ¶ added in v0.1.4
GetVdpaMgmtDevices returns a MgmtDev based on a busName and deviceName
func ListVdpaMgmtDevices ¶ added in v0.1.4
ListVdpaMgmtDevices returns the list of all available MgmtDevs
type NetlinkOps ¶ added in v0.1.4
type NetlinkOps interface { RunVdpaNetlinkCmd(command uint8, flags int, data []*nl.RtAttr) ([][]byte, error) NewAttribute(attrType int, data interface{}) (*nl.RtAttr, error) }
NetlinkOps defines the Netlink Operations
func GetNetlinkOps ¶ added in v0.1.4
func GetNetlinkOps() NetlinkOps
GetNetlinkOps will be invoked by functions in other packages that would need access to the sriovnet library methods.
type VdpaDevice ¶
type VdpaDevice interface { Driver() string Name() string MgmtDev() MgmtDev VirtioNet() VirtioNet VhostVdpa() VhostVdpa ParentDevicePath() (string, error) }
VdpaDevice contains information about a Vdpa Device
func GetVdpaDevice ¶ added in v0.1.4
func GetVdpaDevice(name string) (VdpaDevice, error)
GetVdpaDevice returns the vdpa device information by a vdpa device name
func GetVdpaDevicesByMgmtDev ¶ added in v0.1.4
func GetVdpaDevicesByMgmtDev(busName, devName string) ([]VdpaDevice, error)
GetVdpaDevicesByMgmtDev returns the VdpaDevice objects whose MgmtDev has the given bus and device names.
func GetVdpaDevicesByPciAddress ¶ added in v0.1.4
func GetVdpaDevicesByPciAddress(pciAddress string) ([]VdpaDevice, error)
GetVdpaDevicesByPciAddress returns the VdpaDevice objects for the given pciAddress
The pciAddress must have one of the following formats: - MgmtBusName/MgmtDevName - MgmtDevName
func ListVdpaDevices ¶ added in v0.1.4
func ListVdpaDevices() ([]VdpaDevice, error)
ListVdpaDevices returns a list of all available vdpa devices
type VhostVdpa ¶ added in v0.1.4
VhostVdpa is the vhost-vdpa device information
func GetVhostVdpaDevInPath ¶ added in v0.1.4
GetVhostVdpaDevInPath returns the VhostVdpa found in the provided parent device's path
type VirtioNet ¶ added in v0.1.4
VirtioNet is the virtio-net device information
func GetVirtioNetInPath ¶ added in v0.1.4
GetVirtioNetInPath returns the VirtioNet found in the provided parent device's path