Documentation
¶
Index ¶
Constants ¶
View Source
const ( // KernelIfNameLabel contains the interface name // assigned by the kernel. KernelIfNameLabel = "kernelIfName" // IfNameLabel contains the name of the device // as assigned by the device managers. // must be unique across all devices on the node. IfNameLabel = "ifName" // DeviceManagerLabel identifies which Device Manager // published the device. DeviceManagerLabel = "deviceManager" // PoolNameLabel is the pool name. PoolNameLabel = "pool" // PCIBusIDLabel contains the PCI bus address for // the device. Only applicable to PCI based devices. PCIBusIDLabel = deviceattribute.StandardDeviceAttributePrefix + "pciBusID" // PFNameLabel contains the kernel ifname for the // PF on a VF device. Only applicable to sr-iov // VF devices. PFNameLabel = "pfName" // VendorLabel identifies the vendor of this device // same as /sys/bus/pci/devices/<pciAddr>/vendor VendorLabel = "vendor" // DeviceIDLabel contains a device's device id // same as /sys/bus/pci/devices/<pciAddr>/device DeviceIDLabel = "deviceID" // DriverLabel identifies a device's driver. DriverLabel = "driver" )
The labels below are used by the device managers to tag their devices for advertising ResourceSlices. These attributes may be used to filter and match devices on a resource claim.
View Source
const (
// MaxInterfaceNameLength is the maximum length for a Linux interface name (IFNAMSIZ - 1)
MaxInterfaceNameLength = 15
)
Interface name validation constants
Variables ¶
This section is empty.
Functions ¶
func ValidateInterfaceName ¶
ValidateInterfaceName validates an interface name according to Linux rules
Types ¶
type Device ¶
type Device interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
GetAttrs() map[resourceapi.QualifiedName]resourceapi.DeviceAttribute
Setup(cfg DeviceConfig) error
Free(cfg DeviceConfig) error
Match(filter v2alpha1.CiliumNetworkDriverDeviceFilter) bool
IfName() string
KernelIfName() string
Merge(Device)
}
type DeviceConfig ¶
type DeviceConfig struct {
PodIfName string `json:"podIfName,omitempty"` // Custom interface name for the pod namespace
Vlan int32 `json:"vlan,omitempty"` // VLAN ID to assign to the device (0 = untagged / no change)
}
func (*DeviceConfig) Empty ¶
func (d *DeviceConfig) Empty() bool
type DeviceManager ¶
type DeviceManager interface {
Type() DeviceManagerType
// Run publishes the current device set by calling publish, then blocks
// until ctx is cancelled. Implementations must call publish at least once
// before returning so the driver knows what devices are available.
// On any change to the device set, Run calls publish again with the full
// updated set.
Run(ctx context.Context, publish func([]Device)) error
RestoreDevice([]byte) (Device, error)
}
type DeviceManagerType ¶
type DeviceManagerType int
const ( // DeviceManagerTypeMock is a sentinel used by unit tests. // It is intentionally kept in the types package so that test files in // the networkdriver package can reference it without importing a real // device-manager package. DeviceManagerTypeMock DeviceManagerType = iota DeviceManagerTypeDummy DeviceManagerTypeSRIOV DeviceManagerTypeUnknown )
func (DeviceManagerType) MarshalText ¶
func (d DeviceManagerType) MarshalText() (text []byte, err error)
func (DeviceManagerType) String ¶
func (d DeviceManagerType) String() string
func (*DeviceManagerType) UnmarshalText ¶
func (d *DeviceManagerType) UnmarshalText(text []byte) error
type SerializedDevice ¶
type SerializedDevice struct {
Manager DeviceManagerType
Dev json.RawMessage
Config DeviceConfig
}
Click to show internal directories.
Click to hide internal directories.