Documentation ¶
Index ¶
- func DetectPluginWatchMode(sockDir string) bool
- func GetDDPProfiles(dev string) (string, error)
- func GetDevNode(pciAddr string) int
- func GetDriverName(pciAddr string) (string, error)
- func GetLinkAttrs(ifName string) (*nl.LinkAttrs, 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 GetVFID(pciAddr string) (vfID int, err error)
- func GetVFIODeviceFile(dev string) (devFileHost, devFileContainer 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 UseFakeLinks() func()
- func ValidPciAddr(addr string) (string, error)
- func ValidResourceName(name string) bool
- type DDPInfo
- type DDPInventory
- type DDPpackage
- type FakeFilesystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectPluginWatchMode ¶
DetectPluginWatchMode returns true if plugins registry directory exist
func GetDDPProfiles ¶
GetDDPProfiles returns running DDP profile name if available
func GetDevNode ¶
GetDevNode returns the numa node of a PCI device, -1 if none is specified or error.
func GetDriverName ¶
GetDriverName returns current driver attached to a pci device from its pci address
func GetLinkAttrs ¶
GetLinkAttrs returns a net device's link attributes.
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 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 SriovConfigured ¶
SriovConfigured returns true if sriov_numvfs reads > 0 else false
func UseFakeLinks ¶
func UseFakeLinks() func()
UseFakeLinks causes GetLinkByName to retrieve fake netlink Link object return value intended to be used in unit-tests as deffered method to restore GetLinkByName to be the actual netlink implementation.
func ValidPciAddr ¶
ValidPciAddr validates PciAddr given as string with host system
func ValidResourceName ¶
ValidResourceName returns true if it contains permitted characters otherwise false
Types ¶
type DDPInfo ¶
type DDPInfo struct {
DDPInventory DDPInventory `json:"DDPInventory"`
}
DDPInfo is the toplevel container of DDPInventory
type DDPInventory ¶
type DDPInventory struct { Device string `json:"device"` Address string `json:"address"` Name string `json:"name"` Display string `json:"display"` DDPpackage DDPpackage `json:"DDPpackage"` }
DDPInventory holds a device's DDP information
type DDPpackage ¶
type DDPpackage struct { TrackID string `json:"track_id"` Version string `json:"version"` Name string `json:"name"` }
DDPpackage holds information about DDP profile itself
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()()