ethnetif

package
v0.0.0-...-1e60831 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: NIST-PD-fallback Imports: 21 Imported by: 0

Documentation

Overview

Package ethnetif manages DPDK Ethernet devices associated with kernel network interfaces.

Index

Constants

This section is empty.

Variables

View Source
var (
	GqlDriverKindEnum   *graphql.Enum
	GqlConfigFieldTypes gqlserver.FieldTypes
)

GraphQL types.

View Source
var XDPProgram string

XDPProgram is the absolute path to an XDP program ELF object. This should be assigned by package main.

Functions

func CreateEthDev

func CreateEthDev(cfg Config) (ethdev.EthDev, error)

CreateEthDev creates an Ethernet device.

func XDPDeleteFaceMapEntry

func XDPDeleteFaceMapEntry(dev ethdev.EthDev, key []byte)

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.

func XDPInsertFaceMapEntry

func XDPInsertFaceMapEntry(dev ethdev.EthDev, key []byte, xskQueue int)

XDPInsertFaceMapEntry inserts 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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL