netfns

package
v0.3.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClaimNotFound      = errors.New("claim not found")
	ErrClaimAlreadyExists = errors.New("claim already exists")
)
View Source
var (
	ErrNoAddressAvailable = errors.New("no address available")
)

Functions

func CollectTAPFunctions

func CollectTAPFunctions(devices []string) ([]ghw.PCIAddress, error)

func CollectVirtualFunctions

func CollectVirtualFunctions(fs sysfs.FS) ([]ghw.PCIAddress, error)

func GenerateVirtualFunctions added in v0.3.1

func GenerateVirtualFunctions(pfDevice string, numVFs int, offset int) ([]ghw.PCIAddress, error)

Types

type Claim

type Claim struct {
	UID     types.UID
	Address ghw.PCIAddress
}

type ClaimStore

type ClaimStore interface {
	Create(uid types.UID, addr ghw.PCIAddress) error
	Get(uid types.UID) (*ghw.PCIAddress, error)
	Delete(uid types.UID) (*ghw.PCIAddress, error)
	DeleteAll() error
	List() ([]Claim, error)
}

func NewFileClaimStore

func NewFileClaimStore(rootDir string, isTAPStore bool) (ClaimStore, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(store ClaimStore, initAvailable []ghw.PCIAddress) (*Manager, error)

func (*Manager) Get

func (m *Manager) Get(uid types.UID) (*ghw.PCIAddress, error)

func (*Manager) GetOrClaim

func (m *Manager) GetOrClaim(uid types.UID) (*ghw.PCIAddress, error)

func (*Manager) Release

func (m *Manager) Release(uid types.UID) error

func (*Manager) ReleaseAll added in v0.3.1

func (m *Manager) ReleaseAll() error

Jump to

Keyboard shortcuts

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