Documentation ¶
Index ¶
- Variables
- func CleanCachedNetConf(cRefPath string) error
- func CreateTmpSysFs() error
- func GetPciAddress(ifName string, vf int) (string, error)
- func GetPfName(vf string) (string, error)
- func GetSharedPF(ifName string) (string, error)
- func GetSriovNumVfs(ifName string) (int, error)
- func GetVFLinkNames(pciAddr string) (string, error)
- func GetVFLinkNamesFromVFID(pfName string, vfID int) ([]string, error)
- func GetVfid(addr string, pfName string) (int, error)
- func HasDpdkDriver(pciAddr string) (bool, error)
- func ReadScratchNetConf(cRefPath string) ([]byte, error)
- func RemoveTmpSysFs() error
- func SaveNetConf(cid, dataDir, podIfName string, conf interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( // NetDirectory sysfs net directory NetDirectory = "/sys/class/net" // SysBusPci is sysfs pci device directory SysBusPci = "/sys/bus/pci/devices" // UserspaceDrivers is a list of driver names that don't have netlink representation for their devices UserspaceDrivers = []string{"vfio-pci", "uio_pci_generic", "igb_uio"} )
Functions ¶
func CleanCachedNetConf ¶
CleanCachedNetConf removed cached NetConf from disk
func CreateTmpSysFs ¶ added in v1.1.0
func CreateTmpSysFs() error
CreateTmpSysFs create mock sysfs for testing
func GetPciAddress ¶
GetPciAddress takes in a interface(ifName) and VF id and returns returns its pci addr as string
func GetSharedPF ¶
GetSharedPF takes in VF name(ifName) as string and returns the other VF name that shares same PCI address as string
func GetSriovNumVfs ¶
GetSriovNumVfs takes in a PF name(ifName) as string and returns number of VF configured as int
func GetVFLinkNames ¶
GetVFLinkNames returns VF's network interface name given it's PCI addr
func GetVFLinkNamesFromVFID ¶
GetVFLinkNamesFromVFID returns VF's network interface name given it's PF name as string and VF id as int
func GetVfid ¶
GetVfid takes in VF's PCI address(addr) and pfName as string and returns VF's ID as int
func HasDpdkDriver ¶
HasDpdkDriver checks if a device is attached to dpdk supported driver
func ReadScratchNetConf ¶
ReadScratchNetConf takes in container ID, Pod interface name and data dir as string and returns a pointer to Conf
func RemoveTmpSysFs ¶ added in v1.1.0
func RemoveTmpSysFs() error
RemoveTmpSysFs removes mocked sysfs
func SaveNetConf ¶
SaveNetConf takes in container ID, data dir and Pod interface name as string and a json encoded struct Conf and save this Conf in data dir
Types ¶
This section is empty.