sriov

package
v0.26.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultCNIDir used for caching hostIFName
	DefaultCNIDir = "/var/lib/cni/ovs"
)
View Source
var (
	// SysBusPci is sysfs pci device directory
	SysBusPci = "/sys/bus/pci/devices"
)

Functions

func CleanCachedConf

func CleanCachedConf(cRefPath string) error

CleanCachedConf removed cached Conf from disk

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 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 string, mtu int, deviceID string) (*current.Interface, *current.Interface, error)

SetupSriovInterface moves smartVF into container namespace, rename it with ifName and also returns host interface with VF's representor device

Types

This section is empty.

Jump to

Keyboard shortcuts

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