Documentation ¶
Overview ¶
Package ethface implements Ethernet faces using DPDK Ethernet devices.
Index ¶
Constants ¶
const ( DefaultRxQueueSize = 4096 DefaultTxQueueSize = 4096 )
Limits and defaults.
const ( // MinVXLAN is the minimum VXLAN Network Identifier. MinVXLAN = 0x000000 // MaxVXLAN is the maximum VXLAN Network Identifier. MaxVXLAN = 0xFFFFFF )
Variables ¶
var ( ErrIP = errors.New("invalid IP address") ErrIPFamily = errors.New("different address family in LocalIP and RemoteIP") ErrUnicastIP = errors.New("invalid unicast IP address") ErrUDPPort = errors.New("invalid UDP port") )
Error conditions.
var (
ErrNoPort = errors.New("EthDev not found")
)
Error conditions.
var (
ErrVXLAN = errors.New("invalid VXLAN Network Identifier")
)
Error conditions.
Functions ¶
func LocatorCanCoexist ¶
LocatorCanCoexist determines whether two locators can coexist on the same port.
Types ¶
type EtherLocator ¶
type EtherLocator struct { FaceConfig // packettransport.Locator contains MAC addresses. packettransport.Locator // Port is the EthDev name. // // During face creation: // * If this is empty: // * Face is created on an EthDev whose physical MAC address matches loc.Local. // * Local MAC address of the face is set to loc.Local, i.e. same as the physical MAC address. // * If this is non-empty: // * Face is created on an EthDev whose name matches loc.Port. // * Local MAC address of the face is set to loc.Local, which could differ from the physical MAC address. // * In either case, if no matching EthDev is found, face creation fails. // // When retrieving face information, this reflects the EthDev name. Port string `json:"port,omitempty"` }
EtherLocator describes an Ethernet face.
func (EtherLocator) CreateFace ¶
func (loc EtherLocator) CreateFace() (face iface.Face, e error)
CreateFace creates an Ethernet face.
type FaceConfig ¶
type FaceConfig struct { iface.Config // PortConfig specifies additional configuration for Port activation. // This is only used when creating the first face on an EthDev. PortConfig *PortConfig `json:"portConfig,omitempty"` // MaxRxQueues is the maximum number of RX queues for this face. // It is meaningful only if the face is using RxFlow dispatching. // It is effective in improving performance on VXLAN face only. // // Default is 1. // If this is greater than 1, NDNLPv2 reassembly will not work on this face. MaxRxQueues int `json:"maxRxQueues,omitempty"` // DisableTxMultiSegOffload forces every packet to be copied into a linear buffer in software. DisableTxMultiSegOffload bool `json:"disableTxMultiSegOffload,omitempty"` // DisableTxChecksumOffload disables the usage of IPv4 and UDP checksum offloads. DisableTxChecksumOffload bool `json:"disableTxChecksumOffload,omitempty"` // contains filtered or unexported fields }
FaceConfig contains additional face configuration. They appear as input-only fields of EtherLocator.
type LocatorConflictError ¶
type LocatorConflictError struct {
// contains filtered or unexported fields
}
LocatorConflictError indicates that the locator of a new face conflicts with an existing face.
func (LocatorConflictError) Error ¶
func (e LocatorConflictError) Error() string
type MemifLocator ¶
type MemifLocator struct {
memiftransport.Locator
}
MemifLocator describes a memif face.
func (MemifLocator) CreateFace ¶
func (loc MemifLocator) CreateFace() (iface.Face, error)
CreateFace creates a memif face.
type Port ¶
type Port struct {
// contains filtered or unexported fields
}
Port organizes EthFaces on an EthDev.
func NewPort ¶
func NewPort(dev ethdev.EthDev, cfg PortConfig) (port *Port, e error)
NewPort opens a Port.
type PortConfig ¶
type PortConfig struct { // DisableRxFlow disables RxFlow implementation. DisableRxFlow bool `json:"disableRxFlow,omitempty"` // RxQueueSize is the hardware RX queue capacity. // // If this value is zero, it defaults to DefaultRxQueueSize. // It is also adjusted to satisfy driver requirements. RxQueueSize int `json:"rxQueueSize,omitempty"` // TxQueueSize is the hardware TX queue capacity. // // If this value is zero, it defaults to DefaultTxQueueSize. // It is also adjusted to satisfy driver requirements. TxQueueSize int `json:"txQueueSize,omitempty"` // MTU configures Maximum Transmission Unit (MTU) on the EthDev. // This excludes Ethernet headers, but includes VLAN/IP/UDP/VXLAN headers. // If this value is zero, the EthDev MTU remains unchanged. MTU int `json:"mtu,omitempty"` // DisableSetMTU skips setting MTU on the device. // Set to true only if the EthDev lacks support for setting MTU. DisableSetMTU bool `json:"disableSetMTU,omitempty"` }
PortConfig contains Port creation arguments.
type UDPLocator ¶
type UDPLocator struct { // EtherLocator contains MAC addresses and EthDev specification. // loc.Remote must be a unicast address. EtherLocator // LocalIP is the local IP address. // It may be either IPv4 or IPv6. LocalIP net.IP `json:"localIP"` // RemoteIP is the remote IP address. // It may be either IPv4 or IPv6. RemoteIP net.IP `json:"remoteIP"` // LocalUDP is the local UDP port number. LocalUDP int `json:"localUDP"` // RemoteUDP is the remote UDP port number. RemoteUDP int `json:"remoteUDP"` }
UDPLocator describes a UDP face.
func (UDPLocator) CreateFace ¶
func (loc UDPLocator) CreateFace() (face iface.Face, e error)
CreateFace creates a UDP face.
type VxlanLocator ¶
type VxlanLocator struct { // UDPLocator contains MAC addresses, EthDev specification, and UDP endpoints. // loc.LocalUDP and loc.RemoteUDP are interpreted as destination port numbers. UDPLocator // VXLAN is the VXLAN virtual network identifier. // This must be between MinVXLAN and MaxVXLAN. VXLAN int `json:"vxlan"` // InnerLocal is the inner local MAC address. // This must be a 48-bit unicast address. InnerLocal macaddr.Flag `json:"innerLocal"` // InnerRemote is the inner remote MAC address. // This must be a 48-bit unicast address. InnerRemote macaddr.Flag `json:"innerRemote"` }
VxlanLocator describes an Ethernet VXLAN face.
func (VxlanLocator) CreateFace ¶
func (loc VxlanLocator) CreateFace() (face iface.Face, e error)
CreateFace creates a VXLAN face.
func (VxlanLocator) Validate ¶
func (loc VxlanLocator) Validate() error
Validate checks Locator fields.