Documentation
¶
Overview ¶
Package sharedmem provides the implemention of data-link layer endpoints backed by shared memory.
Shared memory endpoints can be used in the networking stack by calling New() to create a new endpoint, and then passing it as an argument to Stack.CreateNIC().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(mtu, bufferSize uint32, addr tcpip.LinkAddress, tx, rx QueueConfig) (tcpip.LinkEndpointID, error)
New creates a new shared-memory-based endpoint. Buffers will be broken up into buffers of "bufferSize" bytes.
Types ¶
type QueueConfig ¶
type QueueConfig struct {
// DataFD is a file descriptor for the file that contains the data to
// be transmitted via this queue. Descriptors contain offsets within
// this file.
DataFD int
// EventFD is a file descriptor for the event that is signaled when
// data is becomes available in this queue.
EventFD int
// TxPipeFD is a file descriptor for the tx pipe associated with the
// queue.
TxPipeFD int
// RxPipeFD is a file descriptor for the rx pipe associated with the
// queue.
RxPipeFD int
// state between the two ends of the queue. This data specifies, for
// example, whether EventFD signaling is enabled or disabled.
SharedDataFD int
}
QueueConfig holds all the file descriptors needed to describe a tx or rx queue over shared memory. It is used when creating new shared memory endpoints to describe tx and rx queues.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pipe implements a shared memory ring buffer on which a single reader and a single writer can operate (read/write) concurrently.
|
Package pipe implements a shared memory ring buffer on which a single reader and a single writer can operate (read/write) concurrently. |
|
Package queue provides the implementation of transmit and receive queues based on shared memory ring buffers.
|
Package queue provides the implementation of transmit and receive queues based on shared memory ring buffers. |
Click to show internal directories.
Click to hide internal directories.