config

package
v0.18.1-calicov3.21.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataInterfaceSwIfIndex = uint32(1) // Assumption: the VPP config ensures this is true
	VppConfigFile          = "/etc/vpp/startup.conf"
	VppConfigExecFile      = "/etc/vpp/startup.exec"
	VppManagerStatusFile   = "/var/run/vpp/vppmanagerstatus"
	VppManagerTapIdxFile   = "/var/run/vpp/vppmanagertap0"
	VppManagerLinuxMtu     = "/var/run/vpp/vppmanagerlinuxmtu"
	VppApiSocket           = "/var/run/vpp/vpp-api.sock"
	CalicoVppPidFile       = "/var/run/vpp/calico_vpp.pid"
	VppPath                = "/usr/bin/vpp"
	VppNetnsName           = "calico-vpp-ns"
	VppSigKillTimeout      = 2
	DefaultEncapSize       = 60 // Used to lower the MTU of the routes to the cluster
)
View Source
const (
	DRIVER_UIO_PCI_GENERIC = "uio_pci_generic"
	DRIVER_VFIO_PCI        = "vfio-pci"
	DRIVER_VIRTIO_PCI      = "virtio-pci"
	DRIVER_I40E            = "i40e"
	DRIVER_MLX5_CORE       = "mlx5_core"
	DRIVER_VMXNET3         = "vmxnet3"
)

Variables

This section is empty.

Functions

func GetUplinkMtu

func GetUplinkMtu(params *VppManagerParams, conf *LinuxInterfaceState, includeEncap bool) int

func TemplateScriptReplace

func TemplateScriptReplace(input string, params *VppManagerParams, conf []*LinuxInterfaceState) (template string)

Types

type InterfaceSpec

type InterfaceSpec struct {
	IsMain          bool
	InterfaceName   string `json:"interface"`
	VppIpConfSource string `json:"vppIpConfSource"`
	NativeDriver    string `json:"nativeDriver"`
	NewDriverName   string `json:"newDriver"`
	NumRxQueues     int    `json:"rx"`
	NumTxQueues     int    `json:"tx"`
	SwIfIndex       uint32
}

type KernelVersion

type KernelVersion struct {
	Kernel int
	Major  int
	Minor  int
	Patch  int
}

func (*KernelVersion) IsAtLeast

func (ver *KernelVersion) IsAtLeast(other *KernelVersion) bool

func (*KernelVersion) String

func (ver *KernelVersion) String() string

type LinuxInterfaceState

type LinuxInterfaceState struct {
	PciId         string
	Driver        string
	IsUp          bool
	Addresses     []netlink.Addr
	Routes        []netlink.Route
	HardwareAddr  net.HardwareAddr
	PromiscOn     bool
	NumTxQueues   int
	NumRxQueues   int
	DoSwapDriver  bool
	Hasv4         bool
	Hasv6         bool
	NodeIP4       string
	NodeIP6       string
	Mtu           int
	InterfaceName string
}

func (*LinuxInterfaceState) AddressString

func (c *LinuxInterfaceState) AddressString() string

func (*LinuxInterfaceState) RouteString

func (c *LinuxInterfaceState) RouteString() string

func (*LinuxInterfaceState) SortRoutes

func (c *LinuxInterfaceState) SortRoutes()

SortRoutes sorts the route slice by dependency order, so we can then add them in the order of the slice without issues

type VppManagerParams

type VppManagerParams struct {
	VppStartupSleepSeconds   int
	InterfacesSpecs          []InterfaceSpec
	ConfigExecTemplate       string
	ConfigTemplate           string
	NodeName                 string
	CorePattern              string
	RxMode                   types.RxMode
	TapRxMode                types.RxMode
	ServiceCIDRs             []net.IPNet
	ExtraAddrCount           int
	TapRxQueueSize           int
	TapTxQueueSize           int
	RxQueueSize              int
	TxQueueSize              int
	UserSpecifiedMtu         int
	DefaultGWs               []net.IP
	IfConfigSavePath         string
	EnableGSO                bool
	IpsecNbAsyncCryptoThread int
	/* Capabilities */
	LoadedDrivers      map[string]bool
	KernelVersion      *KernelVersion
	AvailableHugePages int
	VfioUnsafeiommu    bool
}

Jump to

Keyboard shortcuts

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