mlxutils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 GetPciAddressPrefix(pciAddress string) string

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

func ParseMstconfigOutput

func ParseMstconfigOutput(mstOutput string, attributes []string) (fwCurrent, fwNext map[string]string)

Types

type BlueFieldMode

type BlueFieldMode int

BlueField mode representation

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

type MlxNic

type MlxNic struct {
	EnableSriov bool
	TotalVfs    int
	LinkTypeP1  string
	LinkTypeP2  string
}

Directories

Path Synopsis
Package mock_mlxutils is a generated GoMock package.
Package mock_mlxutils is a generated GoMock package.

Jump to

Keyboard shortcuts

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