Documentation ¶
Index ¶
- func DetectPluginWatchMode(sockDir string) bool
- func GetDriverName(pciAddr string) (string, error)
- func GetNetNames(pciAddr string) ([]string, error)
- func GetPciAddrFromVFID(pf string, vf int) (pciAddr string, err error)
- func GetPfAddr(pciAddr string) (string, error)
- func GetPfName(pciAddr string) (string, error)
- func GetSriovVFcapacity(pf string) int
- func GetUIODeviceFile(dev string) (devFile string, err error)
- func GetVFIODeviceFile(dev string) (devFile string, err error)
- func GetVFList(pf string) (vfList []string, err error)
- func GetVFconfigured(pf string) int
- func IsNetlinkStatusUp(dev string) bool
- func IsSriovPF(pciAddr string) bool
- func IsSriovVF(pciAddr string) bool
- func SriovConfigured(addr string) bool
- func ValidPciAddr(addr string) (string, error)
- func ValidResourceName(name string) bool
- type FakeFilesystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectPluginWatchMode ¶
DetectPluginWatchMode returns true if plugins registry directory exist
func GetDriverName ¶
GetDriverName returns current driver attached to a pci device from its pci address
func GetNetNames ¶
GetNetNames returns host net interface names as string for a PCI device from its pci address
func GetPciAddrFromVFID ¶
GetPciAddrFromVFID returns PCI address for VF ID
func GetPfAddr ¶
GetPfAddr returns SRIOV PF pci address if a device is VF given its pci address. If device it not VF then this will return its own address as PF
func GetPfName ¶
GetPfName returns SRIOV PF name for the given VF If device is not VF then it will return its own ifname if exist else empty string
func GetSriovVFcapacity ¶
GetSriovVFcapacity returns SRIOV VF capacity
func GetUIODeviceFile ¶
GetUIODeviceFile returns a vfio device files for vfio-pci bound PCI device's PCI address
func GetVFIODeviceFile ¶
GetVFIODeviceFile returns a vfio device files for vfio-pci bound PCI device's PCI address
func GetVFList ¶
GetVFList returns a List containing PCI addr for all VF discovered in a given PF
func GetVFconfigured ¶
GetVFconfigured returns number of VF configured for a PF
func IsNetlinkStatusUp ¶
IsNetlinkStatusUp returns 'false' if 'operstate' is not "up" for a Linux network device. This function will only return 'false' if the 'operstate' file of the device is readable and holds value anything other than "up". Or else we assume link is up.
func IsSriovPF ¶
IsSriovPF check if a pci device SRIOV capable given its pci address
func IsSriovVF ¶
IsSriovVF check if a pci device has link to a PF
func SriovConfigured ¶
SriovConfigured returns true if sriov_numvfs reads > 0 else false
func ValidPciAddr ¶
ValidPciAddr validates PciAddr given as string with host system
Types ¶
type FakeFilesystem ¶
type FakeFilesystem struct { RootDir string Dirs []string Files map[string][]byte Symlinks map[string]string }
FakeFilesystem allows to setup isolated fake files structure used for the tests.
func (*FakeFilesystem) Use ¶
func (fs *FakeFilesystem) Use() func()
Use function creates entire files structure and returns a function to tear it down. Example usage: defer fs.Use()()