Documentation ¶
Index ¶
- Constants
- func GetPciAddressPrefix(pciAddress string) string
- func HandleEnableSriov(totalVfs int, fwCurrent, fwNext, attrs *MlxNic) (needReboot, changeWithoutReboot bool)
- func HandleLinkType(pciPrefix string, fwData, attr *MlxNic, ...) (bool, error)
- func HandleTotalVfs(fwCurrent, fwNext, attrs *MlxNic, ifaceSpec sriovnetworkv1.Interface, ...) (totalVfs int, needReboot, changeWithoutReboot bool)
- func HasMellanoxInterfacesInSpec(ifaceStatuses sriovnetworkv1.InterfaceExts, ...) bool
- func IsDualPort(pciAddress string, ...) bool
- func ParseMstconfigOutput(mstOutput string, attributes []string) (fwCurrent, fwNext map[string]string)
- type BlueFieldMode
- type MellanoxInterface
- type MlxNic
Constants ¶
View Source
const ( BluefieldDpu BlueFieldMode = iota BluefieldConnectXMode VendorMellanox = "15b3" DeviceBF2 = "a2d6" DeviceBF3 = "a2dc" PreconfiguredLinkType = "Preconfigured" UknownLinkType = "Uknown" TotalVfs = "NUM_OF_VFS" EnableSriov = "SRIOV_EN" LinkTypeP1 = "LINK_TYPE_P1" LinkTypeP2 = "LINK_TYPE_P2" MellanoxVendorID = "15b3" )
Variables ¶
This section is empty.
Functions ¶
func GetPciAddressPrefix ¶
func HandleEnableSriov ¶
func HandleEnableSriov(totalVfs int, fwCurrent, fwNext, attrs *MlxNic) (needReboot, changeWithoutReboot bool)
handleEnableSriov based on totalVfs it decide to disable (totalVfs=0) or enable (totalVfs changed from 0) sriov and need reboot if enableSriov will change
func HandleLinkType ¶
func HandleLinkType(pciPrefix string, fwData, attr *MlxNic, mellanoxNicsSpec map[string]sriovnetworkv1.Interface, mellanoxNicsStatus map[string]map[string]sriovnetworkv1.InterfaceExt) (bool, error)
handleLinkType based on existing linkType and requested link
func HandleTotalVfs ¶
func HandleTotalVfs(fwCurrent, fwNext, attrs *MlxNic, ifaceSpec sriovnetworkv1.Interface, isDualPort bool, mellanoxNicsSpec map[string]sriovnetworkv1.Interface) ( totalVfs int, needReboot, changeWithoutReboot bool)
handleTotalVfs return required total VFs or max (required VFs for dual port NIC) and needReboot if totalVfs will change
func HasMellanoxInterfacesInSpec ¶
func HasMellanoxInterfacesInSpec(ifaceStatuses sriovnetworkv1.InterfaceExts, ifaceSpecs sriovnetworkv1.Interfaces) bool
func IsDualPort ¶
func IsDualPort(pciAddress string, mellanoxNicsStatus map[string]map[string]sriovnetworkv1.InterfaceExt) bool
Types ¶
type MellanoxInterface ¶
type MellanoxInterface interface { MstConfigReadData(string) (string, string, error) GetMellanoxBlueFieldMode(string) (BlueFieldMode, error) GetMlxNicFwData(pciAddress string) (current, next *MlxNic, err error) MlxConfigFW(attributesToChange map[string]MlxNic) error MlxResetFW(pciAddresses []string) error }
func New ¶
func New(utilsHelper utils.CmdInterface) MellanoxInterface
Click to show internal directories.
Click to hide internal directories.