sriov

package
v0.0.0-...-a6598b8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NicLinuxPath     = "/sys/class/net/"
	NumVfsDevicePath = "/device/sriov_numvfs"
	VfCountFieldName = "sriov-vf-count"
	MaxVfCount       = 255
)

constants for Linux paths for devices

Variables

This section is empty.

Functions

func AsyncGetVF

func AsyncGetVF(ctx context.Context, device string, expectedVfCount uint8) chan *VFList

AsyncGetVF returns Vf for given PF asynchronously

func CreateVF

func CreateVF(device string, vfCount uint8) error

CreateVF creates Virtual Functions of given count for given Physical Function

func GetVfIfaceName

func GetVfIfaceName(index uint8, ifname string) string

GetVfIfaceName returns formatted VF name

func ParseVfIfaceName

func ParseVfIfaceName(ifname string) (uint8, string, error)

ParseVfIfaceName returns index of VF and its PF from name

func SetupVfHardwareAddr

func SetupVfHardwareAddr(iface string, mac string, index uint8) error

SetupVfHardwareAddr sets up MAC address for the given VF of the given PF

func SetupVfVlan

func SetupVfVlan(iface string, index uint8, vlanID uint16) error

SetupVfVlan setups VLANID for the given VF of the given PF

Types

type EthVF

type EthVF struct {
	Index   uint8
	PciLong string // BFD notation
	Mac     string
	VlanID  uint16
}

EthVF must match EthVF structure in devcommon.proto

type VFList

type VFList struct {
	Count uint8
	Data  []EthVF
}

VFList is list of VF for given PF (Eth device)

func GetVf

func GetVf(device string) (*VFList, error)

GetVf retrieve information about VFs for NIC given

func GetVfByTimeout

func GetVfByTimeout(timeout time.Duration, device string, expectedVfCount uint8) (*VFList, error)

GetVfByTimeout returns Vf for given PF by timeout

func (*VFList) GetInfo

func (vfl *VFList) GetInfo(idx uint8) *EthVF

GetInfo get information on VF for given VF

Jump to

Keyboard shortcuts

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