Documentation
¶
Index ¶
- type ECPFConfig
- type FileSystem
- type OSFileSystem
- func (OSFileSystem) MkdirAll(path string, perm os.FileMode) error
- func (OSFileSystem) Open(name string) (*os.File, error)
- func (OSFileSystem) ReadDir(name string) ([]os.DirEntry, error)
- func (OSFileSystem) ReadFile(name string) ([]byte, error)
- func (OSFileSystem) Stat(name string) (os.FileInfo, error)
- func (OSFileSystem) WriteFile(name string, data []byte, perm os.FileMode) error
- type VFConfig
- type VFMAC
- type VFMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ECPFConfig ¶
ECPFConfig holds VFConfig for VFs and PF of a specific ECPF keyed by VF+index/PF e.g "vf0", "vf1", "pf".
type FileSystem ¶
type FileSystem interface {
Stat(name string) (os.FileInfo, error)
ReadFile(name string) ([]byte, error)
WriteFile(name string, data []byte, perm os.FileMode) error
Open(name string) (*os.File, error)
MkdirAll(path string, perm os.FileMode) error
ReadDir(name string) ([]os.DirEntry, error)
}
FileSystem abstracts file and OS operations for testability.
type OSFileSystem ¶
type OSFileSystem struct{}
OSFileSystem is the default implementation of FileSystem using the os package.
type VFConfig ¶
type VFConfig struct {
MAC string `toml:"mac"`
}
VFConfig holds the MAC address for a VF.
type VFMAC ¶
type VFMAC struct {
// contains filtered or unexported fields
}
VFMAC manages virtual function (VF) MAC addresses.
func NewVFMAC ¶
func NewVFMAC(fs FileSystem, networkhelper networkhelper.NetworkHelper, log logr.Logger, configDir, configFile string, allowedPCIAddresses []string) (*VFMAC, error)
NewVFMAC creates a new VFMAC instance with the given configuration. allowedPCIAddresses restricts discovery to physical devlink ports owned by those PCI devices. An empty allow-list allows all ports.
func (*VFMAC) LoadIfaceMACAddressMapping ¶
LoadIfaceMACAddressMapping walks sysfs to build a ECPF/VF → MAC mapping.
func (*VFMAC) ProcessVFs ¶
ProcessVFs processes all virtual functions (VFs) for configured physical interfaces.
type VFMapping ¶
type VFMapping map[string]ECPFConfig
VFMapping holds ECPFConfigs keyed by ECPF netdev name.
func (VFMapping) GetPFMacAddress ¶
GetPFMacAddress retrieves the MAC address from an ECPF (specified by its netdev name) of a PF interface from the VF MAC mapping.