Documentation ¶
Index ¶
- Variables
- func New(opts *Options) (tcpip.LinkEndpointID, error)
- type InjectableEndpoint
- func (e *InjectableEndpoint) Attach(dispatcher stack.NetworkDispatcher)
- func (e *InjectableEndpoint) Capabilities() stack.LinkEndpointCapabilities
- func (e *InjectableEndpoint) GSOMaxSize() uint32
- func (e *InjectableEndpoint) Inject(protocol tcpip.NetworkProtocolNumber, vv buffer.VectorisedView)
- func (e *InjectableEndpoint) IsAttached() bool
- func (e *InjectableEndpoint) LinkAddress() tcpip.LinkAddress
- func (e *InjectableEndpoint) MTU() uint32
- func (e *InjectableEndpoint) MaxHeaderLength() uint16
- func (e *InjectableEndpoint) WritePacket(r *stack.Route, gso *stack.GSO, hdr buffer.Prependable, ...) *tcpip.Error
- func (e *InjectableEndpoint) WriteRawPacket(dest tcpip.Address, packet []byte) *tcpip.Error
- type Options
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
func (e *InjectableEndpoint) Inject(protocol tcpip.NetworkProtocolNumber, vv buffer.VectorisedView)
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.
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