Documentation ¶
Overview ¶
Package ethdev contains bindings of DPDK Ethernet device.
Index ¶
- Constants
- Variables
- func OnClose(dev EthDev, cb func()) (cancel func())
- type BurstModeInfo
- type Config
- type DdpProfile
- type DevInfo
- type EthDev
- func FromHardwareAddr(a net.HardwareAddr) EthDev
- func FromID(id int) EthDev
- func FromName(name string) EthDev
- func FromPCI(addr pciaddr.PCIAddress) EthDev
- func List() (list []EthDev)
- func NewMemif(loc memiftransport.Locator) (EthDev, error)
- func NewTap(ifname string, local net.HardwareAddr) (EthDev, error)
- func NewVDev(name string, args map[string]any, socket eal.NumaSocket) (EthDev, error)
- func ProbePCI(addr pciaddr.PCIAddress, args map[string]any) (EthDev, error)
- type RxQueue
- type RxQueueConfig
- type RxqInfo
- type Stats
- type TxQueue
- type TxQueueConfig
- type TxqInfo
Constants ¶
const ( DriverAfPacket = "net_af_packet" DriverI40e = "net_i40e" DriverMemif = "net_memif" DriverMlx5 = "net_mlx5" DriverRing = "net_ring" DriverTAP = "net_tap" DriverXDP = "net_af_xdp" )
Driver names.
const MaxEthDevs = C.RTE_MAX_ETHPORTS
MaxEthDevs is maximum number of EthDevs.
Variables ¶
var (
GqlEthDevType *gqlserver.NodeType[EthDev]
)
GraphQL types.
Functions ¶
Types ¶
type BurstModeInfo ¶
BurstModeInfo describes queue burst mode.
type Config ¶
type Config struct { RxQueues []RxQueueConfig TxQueues []TxQueueConfig MTU int // if non-zero, change MTU Promisc bool // promiscuous mode }
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 DdpProfile ¶
type DdpProfile struct {
// contains filtered or unexported fields
}
DdpProfile represents a Dynamic Device Personalization profile.
func OpenDdpProfile ¶
func OpenDdpProfile(name string) (dp *DdpProfile, e error)
OpenDdpProfile opens a DDP profile from /lib/firmware/intel/i40e/ddp/{}.pkg .
type DevInfo ¶
type DevInfo struct {
DevInfoC
}
DevInfo provides contextual information of an Ethernet port.
func (DevInfo) HasTxChecksumOffload ¶
HasTxChecksumOffload determines whether device can compute IPv4 and UDP checksum upon transmission.
func (DevInfo) HasTxMultiSegOffload ¶
HasTxMultiSegOffload determines whether device can transmit multi-segment packets.
func (DevInfo) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (DevInfo) PrefersFlowItemGTP ¶
PrefersFlowItemGTP indicates the device prefers RTE_FLOW_ITEM_TYPE_GTP to RTE_FLOW_ITEM_TYPE_GTPU.
https://doc.dpdk.org/guides/nics/overview.html rte_flow items availability in networking drivers
type EthDev ¶
type EthDev interface { eal.WithNumaSocket fmt.Stringer io.Closer // ID returns DPDK ethdev ID. ID() int // ZapField returns a zap.Field for logging. ZapField(key string) zap.Field // Name returns port name. Name() string // DevInfo returns information about the hardware device. DevInfo() DevInfo // HardwareAddr returns the device MAC address. HardwareAddr() net.HardwareAddr // MTU returns MTU of this EthDev. MTU() int // IsDown determines whether this device is down. IsDown() bool // Start configures and starts this device. Start(cfg Config) error // RxQueues returns RX queues of a running port. RxQueues() []RxQueue // TxQueues returns TX queues of a running port. TxQueues() []TxQueue // Stats retrieves hardware statistics. Stats() Stats // ResetStats clears hardware statistics. ResetStats() error }
EthDev represents an Ethernet adapter.
func FromHardwareAddr ¶
func FromHardwareAddr(a net.HardwareAddr) EthDev
FromHardwareAddr returns the first EthDev with specified MAC address.
func FromPCI ¶
func FromPCI(addr pciaddr.PCIAddress) EthDev
FromPCI finds an EthDev from PCI address.
func NewMemif ¶
func NewMemif(loc memiftransport.Locator) (EthDev, error)
NewMemif creates a net_memif device.
func NewTap ¶
func NewTap(ifname string, local net.HardwareAddr) (EthDev, error)
NewTap creates a net_tap device.
type RxQueue ¶
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 RxqInfo ¶
type RxqInfo struct { RxqInfoC // contains filtered or unexported fields }
RxqInfo provides contextual information of an RX queue.
func (RxqInfo) BurstMode ¶
func (info RxqInfo) BurstMode() BurstModeInfo
BurstMode retrieves queue burst mode.
func (RxqInfo) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
type Stats ¶
type Stats struct { StatsBasic // contains filtered or unexported fields }
Stats contains statistics for an Ethernet port.
func (Stats) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
type TxQueue ¶
TxQueue represents a 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 TxqInfo ¶
type TxqInfo struct { TxqInfoC // contains filtered or unexported fields }
TxqInfo provides contextual information of a TX queue.
func (TxqInfo) BurstMode ¶
func (info TxqInfo) BurstMode() BurstModeInfo
BurstMode retrieves queue burst mode.
func (TxqInfo) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ethnetif manages DPDK Ethernet devices associated with kernel network interfaces.
|
Package ethnetif manages DPDK Ethernet devices associated with kernel network interfaces. |
Package ethringdev contains bindings of DPDK net_eth_ring driver.
|
Package ethringdev contains bindings of DPDK net_eth_ring driver. |