Documentation ¶
Overview ¶
Package ethport implements faces using DPDK Ethernet device as transport.
Index ¶
Constants ¶
const ( DefaultRxQueueSize = 4096 DefaultTxQueueSize = 4096 )
Limits and defaults.
const UDPPortVXLAN = C.RTE_VXLAN_DEFAULT_PORT
UDPPortVXLAN is the default UDP destination port for VXLAN.
Variables ¶
var ( GqlRxGroupInterface *gqlserver.Interface GqlRxgFlowType *graphql.Object GqlRxgTableType *graphql.Object )
GraphQL types.
Functions ¶
func CheckLocatorCoexist ¶
CheckLocatorCoexist determines whether two locators can coexist on the same port.
func RxTablePtrFromPort ¶
RxTablePtrFromPort extracts *C.RxTable pointer from Port.
Types ¶
type Config ¶
type Config struct { // ethnetif.Config specifies how to find or create EthDev. ethnetif.Config // EthDev specifies EthDev. It overrides ethnetif.Config. EthDev ethdev.EthDev `json:"-"` // AutoClose indicates that EthDev should be closed when the last face is closed. AutoClose bool `json:"-"` RxQueueSize int `json:"rxQueueSize,omitempty" gqldesc:"Hardware RX queue capacity."` TxQueueSize int `json:"txQueueSize,omitempty" gqldesc:"Hardware TX queue capacity."` MTU int `json:"mtu,omitempty" gqldesc:"Change interface MTU (excluding Ethernet/VLAN headers)."` RxFlowQueues int `json:"rxFlowQueues,omitempty" gqldesc:"Enable RxFlow and set maximum queue count."` }
Config contains Port creation arguments.
type FaceConfig ¶
type FaceConfig struct { iface.Config // EthDev causes the face to be created on a specific Ethernet adapter. // This allows setting a local MAC address that differs from the physical MAC address. // // If omitted, local MAC address is used to find the Ethernet adapter. // // In either case, a Port must be created on the Ethernet adapter before creating faces. EthDev ethdev.EthDev `json:"-"` // Port is GraphQL ID of the EthDev. // This field has the same semantics as EthDev. // If both EthDev and Port are specified, EthDev takes priority. Port string `json:"port,omitempty"` // NRxQueues is the number of RX queues for this face. // It is meaningful only if the port is using RxFlow. // For most DPDK drivers, it is effective in improving performance on VXLAN face only. // // Default is 1. NRxQueues int `json:"nRxQueues,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 ethface.EtherLocator.
func (FaceConfig) EthFaceConfig ¶
func (cfg FaceConfig) EthFaceConfig() FaceConfig
EthFaceConfig implements Locator interface.
func (FaceConfig) FindPort ¶
func (cfg FaceConfig) FindPort(local net.HardwareAddr) (port *Port, e error)
FindPort finds an existing Port from cfg.EthDev, cfg.Port, or local MAC address.
func (*FaceConfig) HideFaceConfigFromJSON ¶
func (cfg *FaceConfig) HideFaceConfigFromJSON()
HideFaceConfigFromJSON hides FaceConfig fields from JSON marshaling.
type Locator ¶
type Locator interface { iface.Locator EthLocatorC() LocatorC EthFaceConfig() FaceConfig }
Locator is an Ethernet-based face locator.
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 Port ¶
type Port struct {
// contains filtered or unexported fields
}
Port organizes EthFaces on an EthDev.
type RxMatch ¶
type RxMatch C.EthRxMatch
RxMatch contains prepared buffer to match incoming packets with a locator.
func NewRxMatch ¶
NewRxMatch creates RxMatch from a locator.
type TxHdr ¶
TxHdr contains prepare buffer to prepend headers to outgoing packets.
func (TxHdr) Prepend ¶
Prepend prepends headers to an outgoing packet.
newBurst: whether pkt is the first packet in a burst. It increments UDP source port in VXLAN headers. If NDN network layer packet is fragmented, only the first fragment might start a new burst, so that all fragments have the same UDP source port.