utils

package
v3.25.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindVFtoDriver

func BindVFtoDriver(pciId string, driver string) error

func BroadcastAddr

func BroadcastAddr(n *net.IPNet) net.IP

BroadcastAddr returns the last address in the given network, or the broadcast address.

func CleanupCoreFiles added in v3.25.1

func CleanupCoreFiles(corePattern string, maxCoreFiles int) error

func ClearVppManagerFiles

func ClearVppManagerFiles() error

func CreateInterfaceVF

func CreateInterfaceVF(pciId string) error
func CreateVppLink() (vpp *vpplink.VppLink, err error)

func CycleHardwareAddr

func CycleHardwareAddr(hwAddr net.HardwareAddr, n uint8) net.HardwareAddr

func DecrementIP

func DecrementIP(ip net.IP) (result net.IP)

DecrementIP returns the given IP + 1

func DeleteInterfaceVF

func DeleteInterfaceVF(pciId string) (err error)

func FetchNodeAnnotations

func FetchNodeAnnotations(nodeName string) map[string]string

func FormatIPNetSlice

func FormatIPNetSlice(lst []net.IPNet) string

func GetDriverNameFromPci

func GetDriverNameFromPci(pciId string) (string, error)

func GetInterfaceNameFromPci

func GetInterfaceNameFromPci(pciId string) (string, error)

func GetInterfaceNumVFs

func GetInterfaceNumVFs(pciId string) (int, error)

func GetInterfacePciId

func GetInterfacePciId(interfaceName string) (string, error)

func GetInterfaceVFPciId

func GetInterfaceVFPciId(pciId string) (vfPciId string, err error)

func GetMaxCIDRLen

func GetMaxCIDRLen(isv6 bool) int

func GetMaxCIDRMask

func GetMaxCIDRMask(addr net.IP) net.IPMask

func GetNrHugepages

func GetNrHugepages() (int, error)

func GetOsKernelVersion

func GetOsKernelVersion() (ver *config.KernelVersion, err error)

func GetnetnsPath

func GetnetnsPath(nsName string) string

func IncrementIP

func IncrementIP(ip net.IP) (result net.IP)

IncrementIP returns the given IP + 1

func IsDriverLoaded

func IsDriverLoaded(driver string) (bool, error)

func IsVfioUnsafeiommu

func IsVfioUnsafeiommu() (bool, error)

func NetworkAddr

func NetworkAddr(n *net.IPNet) net.IP

NetworkAddr returns the first address in the given network, or the network address.

func NewNS

func NewNS(nsName string) (ns.NetNS, error)

*

  • This function was copied from the following repo [0]
  • as we depend on pkg/ns, but it doesnot support netns creation
  • [0] github.com/containernetworking/plugins.git:pkg/testutils/netns_linux.go

func NormalizeIP

func NormalizeIP(in net.IP) net.IP

func ParseKernelVersion

func ParseKernelVersion(versionStr string) (ver *config.KernelVersion, err error)

func PrintLastBackTrace added in v3.25.1

func PrintLastBackTrace(coreFile string)

func RenameInterface

func RenameInterface(name, newName string) (err error)

func RouteIsIP6

func RouteIsIP6(r *netlink.Route) bool

func RouteIsLinkLocalUnicast

func RouteIsLinkLocalUnicast(r *netlink.Route) bool

func RunBashScript

func RunBashScript(script string) error
func SafeGetLink(interfaceName string) (link netlink.Link, err error)

func SafeSetInterfaceUpByName

func SafeSetInterfaceUpByName(interfaceName string) (link netlink.Link, err error)

func SetCorePattern

func SetCorePattern(corePattern string) error

func SetInterfaceRxQueues

func SetInterfaceRxQueues(ifname string, queues int) error

func SetRLimitMemLock

func SetRLimitMemLock() error

func SetVFSpoofTrust

func SetVFSpoofTrust(ifName string, vf int, spoof bool, trust bool) error

func SetVfioUnsafeiommu

func SetVfioUnsafeiommu(iommu bool) (err error)

func SwapDriver

func SwapDriver(pciDevice, newDriver string, addId bool) error

func WriteFile

func WriteFile(state string, path string) error

func WriteInfoFile

func WriteInfoFile() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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