Documentation ¶
Index ¶
- Constants
- func BindVf(handle *PfNetdevHandle, vf *VfObj) error
- func ConfigVfs(handle *PfNetdevHandle, privileged bool) error
- func DisableSriov(pfNetdevName string) error
- func EnableSriov(pfNetdevName string) error
- func FreeVf(handle *PfNetdevHandle, vf *VfObj)
- func FreeVfByNetdevName(handle *PfNetdevHandle, vfIndex int) error
- func GetAllRdmaSriovSupportedDevices() (devices []string)
- func GetAllSriovEnabledDevices() (devices []string)
- func GetCurrentVfCount(pfNetdevName string) (int, error)
- func GetNetDevicesFromPci(pciAddress string) ([]string, error)
- func GetPfMaxSendingRate(pfNetdevName string) (rate uint, err error)
- func GetUplinkRepresentor(vfPciAddress string) (string, error)
- func GetVfDefaultMacAddr(vfNetdevName string) (string, error)
- func GetVfIndexByPciAddress(vfPciAddress string) (int, error)
- func GetVfNetdevName(handle *PfNetdevHandle, vf *VfObj) string
- func GetVfPciDevList(pfNetdevName string) ([]string, error)
- func GetVfRepresentor(uplink string, vfIndex int) (string, error)
- func IsSriovEnabled(netdevName string) bool
- func IsSriovSupported(netdevName string) bool
- func SetPFLinkUp(pfNetdevName string) error
- func SetVfDefaultGUID(handle *PfNetdevHandle, vf *VfObj) error
- func SetVfDefaultMacAddress(handle *PfNetdevHandle, vf *VfObj) error
- func SetVfPrivileged(handle *PfNetdevHandle, vf *VfObj, privileged bool) error
- func SetVfVlan(handle *PfNetdevHandle, vf *VfObj, vlan int) error
- func UnbindVf(handle *PfNetdevHandle, vf *VfObj) error
- type PfNetdevHandle
- type VfObj
- type VfObject
Constants ¶
const ( NetSysDir = "/sys/class/net" PciSysDir = "/sys/bus/pci/devices" )
Variables ¶
This section is empty.
Functions ¶
func BindVf ¶
func BindVf(handle *PfNetdevHandle, vf *VfObj) error
func ConfigVfs ¶
func ConfigVfs(handle *PfNetdevHandle, privileged bool) error
func DisableSriov ¶
func EnableSriov ¶
func FreeVf ¶
func FreeVf(handle *PfNetdevHandle, vf *VfObj)
func FreeVfByNetdevName ¶
func FreeVfByNetdevName(handle *PfNetdevHandle, vfIndex int) error
func GetAllRdmaSriovSupportedDevices ¶
func GetAllRdmaSriovSupportedDevices() (devices []string)
GetAllRdmaSriovSupportedDevices returns a list of devices on a physical computer that have SRIOV enabled and the current VF count > 0. Also the infiniband directory must exist.
func GetAllSriovEnabledDevices ¶
func GetAllSriovEnabledDevices() (devices []string)
GetAllSriovEnabledDevices returns a list of devices on a physical computer that have SRIOV enabled and the current VF count > 0. Note: this scans all the directories in NetSysDir variable, this should be used sparingly!!
func GetCurrentVfCount ¶
GetCurrentVfCount is a wrapper for the internal function
func GetNetDevicesFromPci ¶
GetNetDevicesFromPci gets a PCI address (e.g '0000:03:00.1') and returns the correlate list of netdevices
func GetPfMaxSendingRate ¶
GetPfMaxSendingRate gets the maximum sending rate of a given PF device name the rate returned is in Mb/second
func GetUplinkRepresentor ¶
GetUplinkRepresentor gets a VF PCI address (e.g '0000:03:00.4') and returns the uplink represntor netdev name for that VF.
func GetVfDefaultMacAddr ¶
func GetVfIndexByPciAddress ¶
GetVfIndexByPciAddress gets a VF PCI address (e.g '0000:03:00.4') and returns the correlate VF index.
func GetVfNetdevName ¶
func GetVfNetdevName(handle *PfNetdevHandle, vf *VfObj) string
func GetVfPciDevList ¶
func IsSriovEnabled ¶
func IsSriovSupported ¶
func SetPFLinkUp ¶
func SetVfDefaultGUID ¶
func SetVfDefaultGUID(handle *PfNetdevHandle, vf *VfObj) error
func SetVfDefaultMacAddress ¶
func SetVfDefaultMacAddress(handle *PfNetdevHandle, vf *VfObj) error
func SetVfPrivileged ¶
func SetVfPrivileged(handle *PfNetdevHandle, vf *VfObj, privileged bool) error
func UnbindVf ¶
func UnbindVf(handle *PfNetdevHandle, vf *VfObj) error
Types ¶
type PfNetdevHandle ¶
type PfNetdevHandle struct { PfNetdevName string List []*VfObj // contains filtered or unexported fields }
func GetPfNetdevHandle ¶
func GetPfNetdevHandle(pfNetdevName string) (*PfNetdevHandle, error)
type VfObj ¶
func AllocateVf ¶
func AllocateVf(handle *PfNetdevHandle) (*VfObj, error)
func AllocateVfByMacAddress ¶
func AllocateVfByMacAddress(handle *PfNetdevHandle, vfMacAddress string) (*VfObj, error)