ipuplugin

package
v0.0.0-...-d47497b Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PHY_PORT0_INTF_INDEX = 4
	PHY_PORT1_INTF_INDEX = 5
	NF_IN_PR_INTF_INDEX  = 9
	NF_OUT_PR_INTF_INDEX = 10
)

Reserved ACC interfaces(using vport_id or last digit of interface name, like 4 represents-> enp0s1f0d4)

View Source
const (
	ACC_VM_PR_IP = "192.168.100.252/24"
)
View Source
const (
	ApfNumber = 16
)

Variables

View Source
var AccApfMacList []string
View Source
var AccIntfNames = [ApfNumber]string{"enp0s1f0", "enp0s1f0d1", "enp0s1f0d2", "enp0s1f0d3", "enp0s1f0d4", "enp0s1f0d5", "enp0s1f0d6",
	"enp0s1f0d7", "enp0s1f0d8", "enp0s1f0d9", "enp0s1f0d10", "enp0s1f0d11", "enp0s1f0d12", "enp0s1f0d13", "enp0s1f0d14", "enp0s1f0d15"}

TODO: GetFilteredPFs can be used to fill the array.

View Source
var InitAccApfMacs = false
View Source
var PeerToPeerP4RulesAdded = false

Functions

func CheckAndAddPeerToPeerP4Rules

func CheckAndAddPeerToPeerP4Rules(p4rtbin string)

If ipu-plugin's Init function gets invoked on ACC, prior to getting invoked on x86, then host VFs will not be setup yet. In that case, peer2peer rules will get added in CreateBridgePort or CreateNetworkFunction.

func FindInterfaceForGivenMac

func FindInterfaceForGivenMac(macAddr string) (string, error)

func GetFilteredPFs

func GetFilteredPFs(pfList *[]netlink.Link) error

TODO: Can we cache 2 PF lists for host and ACC, to avoid repeated calls to GetFilteredPFs

func GetMacforNetworkInterface

func GetMacforNetworkInterface(intf string, linkList []netlink.Link) (string, error)

func GetVFList

func GetVFList(pf string) (vfList []string, err error)

Note: This function below was taken from open-source sriov plugin, which is also under the same apache license, with few additional changes. Returns a List containing PCI addr for all VF discovered in a given PF

func GetVfDeviceCount

func GetVfDeviceCount(pciAddr string) (int, error)

func InitHandlers

func InitHandlers()

func NewIpuPlugin

func NewIpuPlugin(port int, brCtlr types.BridgeController, p4rtbin string,
	p4Client types.P4RTClient, servingAddr, servingProto, bridge, intf, p4cpInstall, mode, daemonHostIp, daemonIpuIp string, daemonPort int) types.Runnable

func NewLinuxBridgeController

func NewLinuxBridgeController(bridge string) types.BridgeController

func NewOvsBridgeController

func NewOvsBridgeController(bridgeName, ovsCliDir string, ovsDbPath string) types.BridgeController

func SetNumSriovVfs

func SetNumSriovVfs(mode string, pciAddr string, vfCnt int32) error

func SetNumVfs

func SetNumVfs(mode string, numVfs int32) (int32, error)

Types

type DevicePluginService

type DevicePluginService struct {
	pb.UnimplementedDeviceServiceServer
	// contains filtered or unexported fields
}

func NewDevicePluginService

func NewDevicePluginService(mode string) *DevicePluginService

func (*DevicePluginService) GetDevices

func (*DevicePluginService) SetNumVfs

func (s *DevicePluginService) SetNumVfs(ctx context.Context, vfCountReq *pb.VfCount) (*pb.VfCount, error)

type ExecutableHandler

type ExecutableHandler interface {
	SetupAccApfs() error
	// contains filtered or unexported methods
}
var ExecutableHandlerGlobal ExecutableHandler

type ExecutableHandlerImpl

type ExecutableHandlerImpl struct{}

func (*ExecutableHandlerImpl) SetupAccApfs

func (e *ExecutableHandlerImpl) SetupAccApfs() error

type FXPHandler

type FXPHandler interface {
	// contains filtered or unexported methods
}

type FXPHandlerImpl

type FXPHandlerImpl struct{}

type FileSystemHandler

type FileSystemHandler interface {
	GetDevice(iface string) ([]byte, error)
	GetVendor(iface string) ([]byte, error)
}

type FileSystemHandlerImpl

type FileSystemHandlerImpl struct{}

func (*FileSystemHandlerImpl) GetDevice

func (fs *FileSystemHandlerImpl) GetDevice(iface string) ([]byte, error)

func (*FileSystemHandlerImpl) GetVendor

func (fs *FileSystemHandlerImpl) GetVendor(iface string) ([]byte, error)

type LifeCycleServiceServer

type LifeCycleServiceServer struct {
	pb.UnimplementedLifeCycleServiceServer
	// contains filtered or unexported fields
}

func NewLifeCycleService

func NewLifeCycleService(daemonHostIp, daemonIpuIp string, daemonPort int, mode string, p4rtbin string, brCtlr types.BridgeController) *LifeCycleServiceServer

func (*LifeCycleServiceServer) Init

type NetworkFunctionServiceServer

type NetworkFunctionServiceServer struct {
	pb.UnimplementedNetworkFunctionServiceServer
	Ports map[string]*types.BridgePortInfo
	// contains filtered or unexported fields
}

func NewNetworkFunctionService

func NewNetworkFunctionService(ports map[string]*types.BridgePortInfo, brCtlr types.BridgeController, p4Client types.P4RTClient, p4rtbin string) *NetworkFunctionServiceServer

func (*NetworkFunctionServiceServer) CreateNetworkFunction

func (s *NetworkFunctionServiceServer) CreateNetworkFunction(ctx context.Context, in *pb.NFRequest) (*pb.Empty, error)

func (*NetworkFunctionServiceServer) DeleteNetworkFunction

func (s *NetworkFunctionServiceServer) DeleteNetworkFunction(ctx context.Context, in *pb.NFRequest) (*pb.Empty, error)

type NetworkHandler

type NetworkHandler interface {
	AddrAdd(link netlink.Link, addr *netlink.Addr) error
	AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
	LinkList() ([]netlink.Link, error)
}

type NetworkHandlerImpl

type NetworkHandlerImpl struct{}

func (*NetworkHandlerImpl) AddrAdd

func (h *NetworkHandlerImpl) AddrAdd(link netlink.Link, addr *netlink.Addr) error

func (*NetworkHandlerImpl) AddrList

func (h *NetworkHandlerImpl) AddrList(link netlink.Link, family int) ([]netlink.Addr, error)
func (h *NetworkHandlerImpl) LinkList() ([]netlink.Link, error)

type SSHHandler

type SSHHandler interface {
	// contains filtered or unexported methods
}

type SSHHandlerImpl

type SSHHandlerImpl struct{}

Jump to

Keyboard shortcuts

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