Documentation
¶
Overview ¶
Package port wraps RTE Port.
This tool is part of the DPDK Packet Framework tool suite and provides a standard interface to implement different types of packet ports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EthdevRx ¶ added in v0.0.5
type EthdevRx struct {
// Configured Ethernet port and RX queue ID.
PortID, QueueID uint16
}
EthdevRx is an input port built on top of pre-initialized NIC RX queue.
type EthdevTx ¶ added in v0.0.5
type EthdevTx struct {
// Configured Ethernet port and TX queue ID.
PortID, QueueID uint16
// Recommended burst size for NIC TX queue.
TxBurstSize uint32
// If NoDrop set writer makes Retries attempts to write packets to
// NIC TX queue.
NoDrop bool
// If NoDrop set and Retries is 0, number of retries is unlimited.
Retries uint32
}
EthdevTx is an output port built on top of pre-initialized NIC TX queue.
type FdRx ¶ added in v0.0.5
type FdRx struct {
// Pre-initialized buffer pool.
*mempool.Mempool
// File descriptor.
Fd uintptr
// Maximum Transfer Unit (MTU)
MTU uint32
}
FdRx input port built on top of valid non-blocking file descriptor.
type FdTx ¶ added in v0.0.5
type FdTx struct {
// File descriptor.
Fd uintptr
// Recommended write burst size. The actual burst size can be
// bigger or smaller than this value.
//
// Should be power of 2.
BurstSize uint32
// If NoDrop set writer makes Retries attempts to write packets to
// ring.
NoDrop bool
// If NoDrop set and Retries is 0, number of retries is unlimited.
Retries uint32
}
FdTx is an output port built on top of valid non-blocking file descriptor.
type In ¶ added in v0.0.4
type In [0]byte
In is the instantiated input port.
type InOps ¶ added in v0.0.4
type InOps C.struct_rte_port_in_ops
InOps is the function table which implements input port.
type InParams ¶ added in v0.0.9
type InParams interface {
// Returns allocated opaque structure along with its destructor.
// Since InParams describes Go implementation of the port
// configuration this member allocates its C counterpart as stated
// in DPDK rte_port.
common.Transformer
// Returns pointer to associated rte_port_in_ops.
InOps() *InOps
}
InParams describes the input port interface.
type Out ¶ added in v0.0.4
type Out [0]byte
Out is the instantiated output port.
type OutOps ¶ added in v0.0.4
type OutOps C.struct_rte_port_out_ops
OutOps is the function table which implements output port.
type OutParams ¶ added in v0.0.9
type OutParams interface {
// Returns allocated opaque structure argument along with its
// destructor. It is used with ops function table.
common.Transformer
// Returns pointer to associated rte_port_out_ops.
OutOps() *OutOps
}
OutParams describes configuration and behaviour of output port.
type RingRx ¶ added in v0.0.5
type RingRx struct {
// Underlying ring
*ring.Ring
// Set if specified ring is multi consumer.
Multi bool
}
RingRx is an input port built on top of pre-initialized RTE ring.
type RingTx ¶ added in v0.0.5
type RingTx struct {
// Underlying ring
*ring.Ring
// Recommended burst size for ring operations.
TxBurstSize uint32
// Set if specified ring is multi producer.
Multi bool
// If NoDrop set writer makes Retries attempts to write packets to
// ring.
NoDrop bool
// If NoDrop set and Retries is 0, number of retries is unlimited.
Retries uint32
}
RingTx is an output port built on top of pre-initialized single producer ring.
type Sink ¶
type Sink struct {
// The full path of the pcap file to write the packets to.
Filename string
// The maximum number of packets write to the pcap file. If this value is
// 0, the "infinite" write will be carried out.
MaxPackets uint32
}
Sink is an output port that drops all packets written to it.
type Source ¶
type Source struct {
// Pre-initialized buffer pool.
*mempool.Mempool
// The full path of the pcap file to read packets from.
Filename string
// The number of bytes to be read from each packet in the pcap file. If
// this value is 0, the whole packet is read; if it is bigger than packet
// size, the generated packets will contain the whole packet.
BytesPerPacket uint32
}
Source is an input port that can be used to generate packets.