sriov

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SysBusPci is sysfs pci device directory
	SysBusPci        = "/sys/bus/pci/devices"
	UserspaceDrivers = []string{"vfio-pci", "uio_pci_generic", "igb_uio"}
)
View Source
var (
	// DefaultCNIDir used for caching hostIFName
	DefaultCNIDir = "/var/lib/cni/ovs"
)

Functions

func CleanCachedConf

func CleanCachedConf(cRefPath string) error

CleanCachedConf removed cached Conf from disk

func GetBridgeUplinkNameByDeviceID added in v0.33.0

func GetBridgeUplinkNameByDeviceID(deviceID string) ([]string, error)

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

func GetNetRepresentor(deviceID string) (string, error)

GetNetRepresentor retrieves network representor device for smartvf

func GetVFLinkName

func GetVFLinkName(pciAddr string) (string, error)

GetVFLinkName retrives interface name for given pci address

func HasUserspaceDriver added in v0.35.0

func HasUserspaceDriver(pciAddr string) (bool, error)

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

func IsOvsHardwareOffloadEnabled(deviceID string) bool

IsOvsHardwareOffloadEnabled when device id is set, then ovs hardware offload is enabled.

func LoadHostIFNameFromCache

func LoadHostIFNameFromCache(args *skel.CmdArgs) (string, string, error)

LoadHostIFNameFromCache retrieves cached Conf returns it along with a handle for removal

func ReleaseVF

func ReleaseVF(args *skel.CmdArgs, origIfName string) error

ReleaseVF release the VF from container namespace into host namespace

func ResetVF

func ResetVF(args *skel.CmdArgs, deviceID, origIfName string) error

ResetVF reset the VF which accidently moved into default network namespace by a container failure

func SaveConf

func SaveConf(cid, podIfName string, conf interface{}) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL