Documentation ¶
Index ¶
- Variables
- func CleanCachedConf(cRefPath string) error
- func GetBridgeUplinkNameByDeviceID(deviceID string) ([]string, error)
- func GetNetRepresentor(deviceID string) (string, error)
- func GetVFLinkName(pciAddr string) (string, error)
- func HasUserspaceDriver(pciAddr string) (bool, error)
- func IsOvsHardwareOffloadEnabled(deviceID string) bool
- func LoadHostIFNameFromCache(args *skel.CmdArgs) (string, string, error)
- func ReleaseVF(args *skel.CmdArgs, origIfName string) error
- func ResetVF(args *skel.CmdArgs, deviceID, origIfName string) error
- func SaveConf(cid, podIfName string, conf interface{}) error
- func SetupSriovInterface(contNetns ns.NetNS, containerID, ifName, mac string, mtu int, deviceID string, ...) (*current.Interface, *current.Interface, error)
Constants ¶
This section is empty.
Variables ¶
var ( // SysBusPci is sysfs pci device directory SysBusPci = "/sys/bus/pci/devices" UserspaceDrivers = []string{"vfio-pci", "uio_pci_generic", "igb_uio"} )
var (
// DefaultCNIDir used for caching hostIFName
DefaultCNIDir = "/var/lib/cni/ovs"
)
Functions ¶
func CleanCachedConf ¶
CleanCachedConf removed cached Conf from disk
func GetBridgeUplinkNameByDeviceID ¶ added in v0.33.0
GetBridgeUplinkNameByDeviceID tries to automatically resolve uplink interface name for provided VF deviceID by following the sequence: VF pci address > PF pci address > Bond (optional, if PF is part of a bond) return list of candidate names
func GetNetRepresentor ¶
GetNetRepresentor retrieves network representor device for smartvf
func GetVFLinkName ¶
GetVFLinkName retrives interface name for given pci address
func HasUserspaceDriver ¶ added in v0.35.0
HasUserspaceDriver checks if a device is attached to userspace driver This method is copied from https://github.com/k8snetworkplumbingwg/sriov-cni/blob/8af83a33b2cac8e2df0bd6276b76658eb7c790ab/pkg/utils/utils.go#L222
func IsOvsHardwareOffloadEnabled ¶
IsOvsHardwareOffloadEnabled when device id is set, then ovs hardware offload is enabled.
func LoadHostIFNameFromCache ¶
LoadHostIFNameFromCache retrieves cached Conf returns it along with a handle for removal
func ResetVF ¶
ResetVF reset the VF which accidently moved into default network namespace by a container failure
func SaveConf ¶
SaveConf 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
func SetupSriovInterface ¶
func SetupSriovInterface(contNetns ns.NetNS, containerID, ifName, mac string, mtu int, deviceID string, userspaceMode bool) (*current.Interface, *current.Interface, error)
SetupSriovInterface configures smartVF and returns VF's representor device as host interface and VF's netdevice as container interface
Types ¶
This section is empty.