deviceplugins

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PCIResourcePrefix = "PCI_RESOURCE"
)

Variables

This section is empty.

Functions

func IsChanClosed

func IsChanClosed(ch <-chan struct{}) bool

func SocketPath

func SocketPath(deviceName string) string

Types

type DeviceHandler

type DeviceHandler interface {
	GetDeviceIOMMUGroup(basepath string, pciAddress string) (string, error)
	GetDeviceDriver(basepath string, pciAddress string) (string, error)
	GetDeviceNumaNode(basepath string, pciAddress string) (numaNode int)
	GetDevicePCIID(basepath string, pciAddress string) (string, error)
}
var Handler DeviceHandler

type DeviceStarter

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

type DeviceUtilsHandler

type DeviceUtilsHandler struct{}

func (*DeviceUtilsHandler) GetDeviceDriver

func (h *DeviceUtilsHandler) GetDeviceDriver(basepath string, pciAddress string) (string, error)

gets device driver

func (*DeviceUtilsHandler) GetDeviceIOMMUGroup

func (h *DeviceUtilsHandler) GetDeviceIOMMUGroup(basepath string, pciAddress string) (string, error)

getDeviceIOMMUGroup gets devices iommu_group e.g. /sys/bus/pci/devices/0000\:65\:00.0/iommu_group -> ../../../../../kernel/iommu_groups/45

func (*DeviceUtilsHandler) GetDeviceNumaNode

func (h *DeviceUtilsHandler) GetDeviceNumaNode(basepath string, pciAddress string) (numaNode int)

func (*DeviceUtilsHandler) GetDevicePCIID

func (h *DeviceUtilsHandler) GetDevicePCIID(basepath string, pciAddress string) (string, error)

type PCIDevice

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

func (*PCIDevice) GetID

func (d *PCIDevice) GetID() string

type PCIDevicePlugin

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

func Create

func Create(ctx context.Context,
	resourceName string,
	pciAddressInitial string,
	pdsWithSameResourceName []*v1beta1.PCIDevice,
) *PCIDevicePlugin

Creates a new PCIDevicePlugin with that resourceName, and returns it

func Find

func Find(
	resourceName string,
	dps map[string]*PCIDevicePlugin,
) *PCIDevicePlugin

Looks for a PCIDevicePlugin with that resourceName, and returns it, or an error if it doesn't exist

func NewPCIDevicePlugin

func NewPCIDevicePlugin(ctx context.Context, pciDevices []*PCIDevice, resourceName string) *PCIDevicePlugin

func (*PCIDevicePlugin) AddDevice

func (dp *PCIDevicePlugin) AddDevice(pd *v1beta1.PCIDevice, pdc *v1beta1.PCIDeviceClaim) error

This function adds the PCIDevice to the device plugin, or creates the device plugin if it doesn't exist

func (*PCIDevicePlugin) Allocate

func (*PCIDevicePlugin) GetCount

func (dp *PCIDevicePlugin) GetCount() int

Not adding more data to the struct, it's big enough already

func (*PCIDevicePlugin) GetDeviceName

func (dp *PCIDevicePlugin) GetDeviceName() string

func (*PCIDevicePlugin) GetDevicePath

func (dp *PCIDevicePlugin) GetDevicePath() string

func (*PCIDevicePlugin) GetDevicePluginOptions

func (dp *PCIDevicePlugin) GetDevicePluginOptions(_ context.Context, _ *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)

func (*PCIDevicePlugin) GetInitialized

func (dp *PCIDevicePlugin) GetInitialized() bool

func (*PCIDevicePlugin) GetPCIDevices

func (dp *PCIDevicePlugin) GetPCIDevices() []*PCIDevice

func (*PCIDevicePlugin) ListAndWatch

func (*PCIDevicePlugin) MarkPCIDeviceAsHealthy

func (dp *PCIDevicePlugin) MarkPCIDeviceAsHealthy(_ string, pciAddress string)

func (*PCIDevicePlugin) MarkPCIDeviceAsUnhealthy

func (dp *PCIDevicePlugin) MarkPCIDeviceAsUnhealthy(pciAddress string)

func (*PCIDevicePlugin) RemoveDevice

func (dp *PCIDevicePlugin) RemoveDevice(pd *v1beta1.PCIDevice, pdc *v1beta1.PCIDeviceClaim) error

This function adds the PCIDevice to the device plugin, or creates the device plugin if it doesn't exist

func (*PCIDevicePlugin) SetStarted

func (dp *PCIDevicePlugin) SetStarted(stop chan struct{})

Set Started is used after a call to Start. It's purpose is to set the private starter properly

func (*PCIDevicePlugin) Start

func (dp *PCIDevicePlugin) Start(stop <-chan struct{}) (err error)

Start starts the device plugin

func (*PCIDevicePlugin) Started

func (dp *PCIDevicePlugin) Started() bool

func (*PCIDevicePlugin) Stop

func (dp *PCIDevicePlugin) Stop() error

Jump to

Keyboard shortcuts

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