resource

package
v1.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package resource provides a resource pool for SR-IOV PCI virtual functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool manages host SR-IOV state WARNING: it is thread unsafe - if you want to use it concurrently, use some synchronization outside

func NewPool

func NewPool(tokenPool TokenPool, cfg *config.Config) *Pool

NewPool returns a new Pool

func (*Pool) Free

func (p *Pool) Free(vfPCIAddr string) error

Free marks given virtual function as "free" and binds it to the "NoDriver" driver type

func (*Pool) Select

func (p *Pool) Select(tokenID string, driverType sriov.DriverType) (string, error)

Select selects a virtual function for the given driver type and marks it as "in-use"

type TokenPool

type TokenPool interface {
	Find(id string) (string, error)
	Use(id string, names []string) error
	StopUsing(id string) error
}

TokenPool is a token.Pool interface

Jump to

Keyboard shortcuts

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