Documentation ¶
Overview ¶
Package ethdev contains bindings of DPDK Ethernet device.
Index ¶
- Variables
- type Config
- type EthDev
- func (port EthDev) DevInfo() (info DevInfo)
- func (port EthDev) ID() int
- func (port EthDev) IsDown() bool
- func (port EthDev) MTU() int
- func (port EthDev) MacAddr() (a net.HardwareAddr)
- func (port EthDev) Name() string
- func (port EthDev) NumaSocket() (socket eal.NumaSocket)
- func (port EthDev) ResetStats()
- func (port EthDev) RxQueues() (list []RxQueue)
- func (port EthDev) Start(cfg Config) error
- func (port EthDev) Stats() (stats Stats)
- func (port EthDev) Stop(mode StopMode) error
- func (port EthDev) String() string
- func (port EthDev) TxQueues() (list []TxQueue)
- func (port EthDev) Valid() bool
- type Pair
- type PairConfig
- type RxQueue
- type RxQueueConfig
- type StopMode
- type TxQueue
- type TxQueueConfig
- type VNet
- type VNetConfig
Constants ¶
This section is empty.
Variables ¶
var ( GqlEthDevNodeType *gqlserver.NodeType GqlEthDevType *graphql.Object )
GraphQL types.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { RxQueues []RxQueueConfig TxQueues []TxQueueConfig MTU int // if non-zero, change MTU Promisc bool // promiscuous mode Conf unsafe.Pointer // pointer to rte_eth_conf, nil means default }
Config contains EthDev configuration.
func (*Config) AddRxQueues ¶
func (cfg *Config) AddRxQueues(count int, qcfg RxQueueConfig)
AddRxQueues adds RxQueueConfig for several queues
func (*Config) AddTxQueues ¶
func (cfg *Config) AddTxQueues(count int, qcfg TxQueueConfig)
AddTxQueues adds TxQueueConfig for several queues
type EthDev ¶
type EthDev struct {
// contains filtered or unexported fields
}
EthDev represents an Ethernet adapter.
func (EthDev) DevInfo ¶
func (port EthDev) DevInfo() (info DevInfo)
DevInfo retrieves information about the hardware device.
func (EthDev) MacAddr ¶
func (port EthDev) MacAddr() (a net.HardwareAddr)
MacAddr retrieves MAC address of this EthDev. If the underlying EthDev returns an invalid MAC address, a random MAC address is returned instead.
func (EthDev) NumaSocket ¶
func (port EthDev) NumaSocket() (socket eal.NumaSocket)
NumaSocket returns the NUMA socket where this EthDev is located.
func (EthDev) Stop ¶
Stop stops this EthDev. If mode is StopDetach, this EthDev cannot be restarted. Otherwise, it may be re-configured and started again.
type Pair ¶
Pair represents a pair of EthDevs connected via ring-based PMD.
func NewPair ¶
func NewPair(cfg PairConfig) (pair *Pair)
NewPair creates a pair of connected EthDevs.
func (*Pair) EthDevConfig ¶
EthDevConfig returns Config that can be used to start a port.
type PairConfig ¶
type PairConfig struct { NQueues int // number of queues on EthDev RingCapacity int // ring capacity connecting pair of EthDevs QueueCapacity int // queue capacity in each EthDev Socket eal.NumaSocket // where to allocate data structures RxPool *pktmbuf.Pool // mempool for packet reception }
PairConfig contains configuration for Pair.
type RxQueue ¶
type RxQueue struct {
// contains filtered or unexported fields
}
RxQueue represents an RX queue.
type RxQueueConfig ¶
type RxQueueConfig struct { Capacity int // ring capacity Socket eal.NumaSocket // where to allocate the ring RxPool *pktmbuf.Pool // where to store packets Conf unsafe.Pointer // pointer to rte_eth_rxconf }
RxQueueConfig contains EthDev RX queue configuration.
type TxQueue ¶
type TxQueue struct {
// contains filtered or unexported fields
}
TxQueue represents an TX queue.
type TxQueueConfig ¶
type TxQueueConfig struct { Capacity int // ring capacity Socket eal.NumaSocket // where to allocate the ring Conf unsafe.Pointer // pointer to rte_eth_txconf }
TxQueueConfig contains EthDev TX queue configuration.
type VNet ¶
type VNet struct { ealthread.Thread // bridge thread Ports []EthDev NDrops int // contains filtered or unexported fields }
VNet represents a virtual Ethernet subnet.
func (*VNet) ThreadRole ¶
ThreadRole returns "VNETBRIDGE" used in lcore allocator.
type VNetConfig ¶
type VNetConfig struct { PairConfig NNodes int BurstSize int LossProbability float64 Shuffle bool }
VNetConfig contains VNet configuration.