sriov

package
v0.0.0-...-d6bac12 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	SetupVF(conf *sriovtypes.NetConf, podifName string, cid string, netns ns.NetNS) (string, error)
	ReleaseVF(conf *sriovtypes.NetConf, podifName string, cid string, netns ns.NetNS) error
	ResetVFConfig(conf *sriovtypes.NetConf) error
	ApplyVFConfig(conf *sriovtypes.NetConf) error
}

Manager provides interface invoke sriov nic related operations

func NewSriovManager

func NewSriovManager() Manager

NewSriovManager returns an instance of SriovManager

type MyNetlink struct {
	NetlinkManager
}

MyNetlink NetlinkManager

func (*MyNetlink) LinkByName

func (n *MyNetlink) LinkByName(name string) (netlink.Link, error)

LinkByName implements NetlinkManager

func (*MyNetlink) LinkSetDown

func (n *MyNetlink) LinkSetDown(link netlink.Link) error

LinkSetDown using NetlinkManager

func (*MyNetlink) LinkSetHardwareAddr

func (n *MyNetlink) LinkSetHardwareAddr(link netlink.Link, hwaddr net.HardwareAddr) error

LinkSetHardwareAddr using NetlinkManager

func (*MyNetlink) LinkSetName

func (n *MyNetlink) LinkSetName(link netlink.Link, name string) error

LinkSetName using NetlinkManager

func (*MyNetlink) LinkSetNsFd

func (n *MyNetlink) LinkSetNsFd(link netlink.Link, fd int) error

LinkSetNsFd using NetlinkManager

func (*MyNetlink) LinkSetUp

func (n *MyNetlink) LinkSetUp(link netlink.Link) error

LinkSetUp using NetlinkManager

func (*MyNetlink) LinkSetVfHardwareAddr

func (n *MyNetlink) LinkSetVfHardwareAddr(link netlink.Link, vf int, hwaddr net.HardwareAddr) error

LinkSetVfHardwareAddr using NetlinkManager

func (*MyNetlink) LinkSetVfRate

func (n *MyNetlink) LinkSetVfRate(link netlink.Link, vf int, minRate int, maxRate int) error

LinkSetVfRate using NetlinkManager

func (*MyNetlink) LinkSetVfSpoofchk

func (n *MyNetlink) LinkSetVfSpoofchk(link netlink.Link, vf int, check bool) error

LinkSetVfSpoofchk using NetlinkManager

func (*MyNetlink) LinkSetVfState

func (n *MyNetlink) LinkSetVfState(link netlink.Link, vf int, state uint32) error

LinkSetVfState using NetlinkManager

func (*MyNetlink) LinkSetVfTrust

func (n *MyNetlink) LinkSetVfTrust(link netlink.Link, vf int, state bool) error

LinkSetVfTrust using NetlinkManager

func (*MyNetlink) LinkSetVfVlan

func (n *MyNetlink) LinkSetVfVlan(link netlink.Link, vf, vlan int) error

LinkSetVfVlan using NetlinkManager

func (*MyNetlink) LinkSetVfVlanQos

func (n *MyNetlink) LinkSetVfVlanQos(link netlink.Link, vf, vlan, qos int) error

LinkSetVfVlanQos sets VLAN ID and QoS field for given VF using NetlinkManager

type NetlinkManager

type NetlinkManager interface {
	LinkByName(string) (netlink.Link, error)
	LinkSetVfVlan(netlink.Link, int, int) error
	LinkSetVfVlanQos(netlink.Link, int, int, int) error
	LinkSetVfHardwareAddr(netlink.Link, int, net.HardwareAddr) error
	LinkSetHardwareAddr(netlink.Link, net.HardwareAddr) error
	LinkSetUp(netlink.Link) error
	LinkSetDown(netlink.Link) error
	LinkSetNsFd(netlink.Link, int) error
	LinkSetName(netlink.Link, string) error
	LinkSetVfRate(netlink.Link, int, int, int) error
	LinkSetVfSpoofchk(netlink.Link, int, bool) error
	LinkSetVfTrust(netlink.Link, int, bool) error
	LinkSetVfState(netlink.Link, int, uint32) error
}

NetlinkManager is an interface to mock nelink library

Jump to

Keyboard shortcuts

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