ixygo

package
v0.0.0-...-8cc07ee Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufConfig = []int{128, 256, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768}

BufConfig defines the shape of the vectorised view used to read packets from the NIC.

Functions

func New

func New(opts *Options) (tcpip.LinkEndpointID, error)

New creates a new ixy.go based endpoint CreateNIC(id, LinkID) creates exactly one NIC with ixy as its LinkEndpoint (LinkID returned from New)

Types

type InjectableEndpoint

type InjectableEndpoint struct {
	// contains filtered or unexported fields
}

InjectableEndpoint is an injectable ixy-based endpoint. The endpoint writes to the ixy device, but does not read from it. All reads come from injected packets.

func NewInjectable

func NewInjectable(dev driver.IxyInterface, rxQueues, txQueues uint16, mtu uint32, capabilities stack.LinkEndpointCapabilities) (tcpip.LinkEndpointID, *InjectableEndpoint)

NewInjectable creates a new fd-based InjectableEndpoint.

func (*InjectableEndpoint) Attach

func (e *InjectableEndpoint) Attach(dispatcher stack.NetworkDispatcher)

Attach saves the stack network-layer dispatcher for use later when packets are injected.

func (*InjectableEndpoint) Capabilities

func (e *InjectableEndpoint) Capabilities() stack.LinkEndpointCapabilities

Capabilities implements stack.LinkEndpoint.Capabilities.

func (*InjectableEndpoint) GSOMaxSize

func (e *InjectableEndpoint) GSOMaxSize() uint32

GSOMaxSize returns the maximum GSO packet size.

func (*InjectableEndpoint) Inject

Inject injects an inbound packet.

func (*InjectableEndpoint) IsAttached

func (e *InjectableEndpoint) IsAttached() bool

IsAttached implements stack.LinkEndpoint.IsAttached.

func (*InjectableEndpoint) LinkAddress

func (e *InjectableEndpoint) LinkAddress() tcpip.LinkAddress

LinkAddress returns the link address of this endpoint.

func (*InjectableEndpoint) MTU

func (e *InjectableEndpoint) MTU() uint32

MTU implements stack.LinkEndpoint.MTU. It returns the value initialized during construction.

func (*InjectableEndpoint) MaxHeaderLength

func (e *InjectableEndpoint) MaxHeaderLength() uint16

MaxHeaderLength returns the maximum size of the link-layer header.

func (*InjectableEndpoint) WritePacket

func (e *InjectableEndpoint) WritePacket(r *stack.Route, gso *stack.GSO, hdr buffer.Prependable, payload buffer.VectorisedView, protocol tcpip.NetworkProtocolNumber) *tcpip.Error

WritePacket writes outbound packets to the ixgbe NIC. If it is not currently writable, the packet is dropped.

func (*InjectableEndpoint) WriteRawPacket

func (e *InjectableEndpoint) WriteRawPacket(dest tcpip.Address, packet []byte) *tcpip.Error

WriteRawPacket writes a raw packet directly to the file descriptor.

type Options

type Options struct {
	// ixy.go device
	Dev driver.IxyInterface

	// Number of buffers per TX queue
	TxEntries uint32

	// MTU is the mtu to use for this endpoint.
	MTU uint32

	// EthernetHeader if true, indicates that the endpoint should read/write
	// ethernet frames instead of IP packets.
	EthernetHeader bool

	// ClosedFunc is a function to be called when an endpoint's peer (if
	// any) closes its end of the communication pipe.
	ClosedFunc func(*tcpip.Error)

	// Address is the link address for this endpoint. Only used if
	// EthernetHeader is true.
	Address tcpip.LinkAddress

	// SaveRestore if true, indicates that this NIC capability set should
	// include CapabilitySaveRestore
	SaveRestore bool

	// DisconnectOk if true, indicates that this NIC capability set should
	// include CapabilityDisconnectOk.
	DisconnectOk bool

	// GSOMaxSize is the maximum GSO packet size. It is zero if GSO is
	// disabled.
	// GSO = generic segmentation offload. ixgbe has TSO but ixy.go doesn't implement it
	// ixy.go currently does not implement GSO, always set so zero
	GSOMaxSize uint32

	// DropTx controls RX behaviour:
	// false: every packet will be sent out -> can accumulate latency in case of high loads
	// true: drop packets that can't be sent out immediately
	DropTx bool

	// BatchSize controls the size of the RX and TX batches. Only use with powers of 2
	BatchSize int
}

Options to configure ixy device

Jump to

Keyboard shortcuts

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