Documentation ¶
Overview ¶
Package ethnetif manages DPDK Ethernet devices associated with kernel network interfaces.
Index ¶
- Variables
- func CreateEthDev(cfg Config) (ethdev.EthDev, error)
- func XDPDeleteFaceMapEntry(dev ethdev.EthDev, key []byte)
- func XDPInsertFaceMapEntry(dev ethdev.EthDev, key []byte, xskQueue int)
- type Config
- type DriverKind
- type NetIntf
- func (n *NetIntf) DisableVLANOffload()
- func (n *NetIntf) EnsureLinkUp(skipBringUp bool) error
- func (n NetIntf) FindDev() (dev ethdev.EthDev)
- func (n NetIntf) NumaSocket() (socket eal.NumaSocket)
- func (n NetIntf) PCIAddr() (a pciaddr.PCIAddress, e error)
- func (n *NetIntf) Refresh()
- func (n *NetIntf) SetOneChannel()
- func (n *NetIntf) UnloadXDP()
- func (n NetIntf) VDevName(drv string) string
Constants ¶
This section is empty.
Variables ¶
var ( GqlDriverKindEnum *graphql.Enum GqlConfigFieldTypes gqlserver.FieldTypes )
GraphQL types.
var XDPProgram string
XDPProgram is the absolute path to an XDP program ELF object. This should be assigned by package main.
Functions ¶
func CreateEthDev ¶
CreateEthDev creates an Ethernet device.
func XDPDeleteFaceMapEntry ¶
XDPDeleteFaceMapEntry deletes an entry in the FaceMap defined in the XDP program attached to the EthDev. If the EthDev is not using XDP driver, this operation has no effect.
Types ¶
type Config ¶
type Config struct { Driver DriverKind `json:"driver" gqldesc:"EthDev driver kind."` Netif string `json:"netif,omitempty" gqldesc:"Network interface name (XDP, AF_PACKET, bifurcated PCI devices)."` PCIAddr *pciaddr.PCIAddress `json:"pciAddr,omitempty" gqldesc:"PCI address (PCI devices)."` DevArgs map[string]any `json:"devargs,omitempty" gqldesc:"DPDK device arguments."` SkipBringUp bool `json:"skipBringUp,omitempty" gqldesc:"Don't attempt to bring up the interface."` SkipEthtool bool `json:"skipEthtool,omitempty" gqldesc:"Don't perform ethtool updates for XDP."` XDPProgram string `json:"-"` // override XDP program }
Config selects a network interface and creates an EthDev.
type DriverKind ¶
type DriverKind string
DriverKind indicates the kind of driver requested for a network interface.
const ( DriverPCI DriverKind = "PCI" DriverXDP DriverKind = "XDP" DriverAfPacket DriverKind = "AF_PACKET" )
type NetIntf ¶
type NetIntf struct { *netlink.LinkAttrs Link netlink.Link // contains filtered or unexported fields }
NetIntf controls a network interface via netlink and ethtool.
func NetIntfByName ¶
NetIntfByName creates netIntf by network interface name. If the network interface does not exist, returns an error.
func (*NetIntf) DisableVLANOffload ¶
func (n *NetIntf) DisableVLANOffload()
DisableVLANOffload modifies the Ethernet device to disable VLAN offload. This helps ensure all traffic goes into the XDP program.
func (*NetIntf) EnsureLinkUp ¶
EnsureLinkUp brings up the link. If skipBringUp is true but the interface is down, returns an error.
func (NetIntf) NumaSocket ¶
func (n NetIntf) NumaSocket() (socket eal.NumaSocket)
NumaSocket determines the NUMA socket of a physical network interface.
func (NetIntf) PCIAddr ¶
func (n NetIntf) PCIAddr() (a pciaddr.PCIAddress, e error)
PCIAddr determines the PCI address of a physical network interface.
func (*NetIntf) Refresh ¶
func (n *NetIntf) Refresh()
Refresh refreshes netlink information stores in this struct.
func (*NetIntf) SetOneChannel ¶
func (n *NetIntf) SetOneChannel()
SetOneChannel modifies the Ethernet device to have only one RX channel. This helps ensure all traffic goes into the XDP program.