ealconfig

package
v0.0.0-...-6c4fd92 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: NIST-PD-fallback Imports: 8 Imported by: 0

Documentation

Overview

Package ealconfig prepares EAL parameters.

Index

Constants

This section is empty.

Variables

View Source
var PmdPath string

PmdPath is the location of DPDK drivers. This is assigned to C.RTE_EAL_PMD_PATH by ealinit package.

Functions

This section is empty.

Types

type Config

type Config struct {
	LCoreConfig
	MemoryConfig
	DeviceConfig

	// ExtraFlags is additional flags passed to DPDK.
	ExtraFlags string `json:"extraFlags,omitempty"`

	// Flags is all flags passed to DPDK.
	// This replaces all other options.
	Flags string `json:"flags,omitempty"`
}

Config contains EAL configuration.

func (Config) Args

func (cfg Config) Args(hwInfo hwinfo.Provider) (args []string, e error)

Args validates the configuration and constructs EAL arguments.

type DeviceConfig

type DeviceConfig struct {
	// IovaMode selects IO Virtual Addresses mode.
	// Possible values are "PA" and "VA".
	// Default is letting DPDK decide automatically based on loaded drivers and kernel options.
	//
	// Some DPDK drivers may require a particular mode, and will not work in the other mode.
	// Read "Memory in DPDK Part 2: Deep Dive into IOVA" for how to choose a mode:
	// https://www.intel.com/content/www/us/en/developer/articles/technical/memory-in-dpdk-part-2-deep-dive-into-iova.html
	IovaMode string `json:"iovaMode,omitempty"`

	// Drivers is a list of shared object files or directories containing them.
	// Default is to include all DPDK drivers.
	//
	// If this is overridden, you must include these drivers:
	// - librte_crypto_openssl.so
	// - librte_mempool_ring.so
	// - librte_net_af_packet.so
	// - librte_net_memif.so
	// Not loading these drivers will likely cause NDN-DPDK activation failure.
	Drivers []string `json:"drivers,omitempty"`

	// DisablePCI disables the PCI bus.
	DisablePCI bool `json:"disablePCI,omitempty"`

	// DeviceFlags is device-related flags passed to DPDK.
	// This replaces all other options.
	DeviceFlags string `json:"deviceFlags,omitempty"`
}

DeviceConfig contains device related configuration.

type LCoreConfig

type LCoreConfig struct {
	// Cores is the list of processors (hardware cores) available to DPDK.
	// Note that Go code is not restricted to these cores.
	//
	// The default is allowing all cores, subject to CPU affinity configured in systemd or Docker.
	// If this list contains a non-existent core, it is skipped.
	Cores []int `json:"cores,omitempty"`

	// CoresPerNuma maps from NUMA socket ID to the number of cores available to DPDK.
	// This is ignored if Cores is specified.
	//
	// Example:
	//  CoresPerNuma[0] = 10     allows up to 10 cores on socket 0.
	//  CoresPerNuma[1] = -2     allows all but 2 cores on socket 1.
	//  CoresPerNuma[2] = 0      disallows all cores on socket 2.
	//  Omitting CoresPerNuma[3] allows all cores on socket 3.
	//
	// If this map contains a non-existent NUMA socket, it is skipped.
	CoresPerNuma map[int]int `json:"coresPerNuma,omitempty"`

	// LCoresPerNuma maps from NUMA socket ID to the number of lcores created in DPDK.
	//
	// This should be specified only if there aren't enough processors to activate and use NDN-DPDK.
	// For each NUMA socket, the specified number of lcores are created as threads, floating among
	// all available processors on that NUMA socket.
	// These lcores are numbered from 0 consecutively starting from the lowest numbered NUMA socket.
	// Note that using threads can lead to suboptimal performance.
	//
	// Example:
	//  - There are two NUMA sockets with these available processors: { 0: [2,3], 1: [5,6,7] }
	//  - LCoresPerNuma is specified as: { 0: 4, 1: 6 }
	//  - This would create these LCores on NUMA sockets: { 0: [0,1,2,3], 1: [4,5,6,7,8,9] }
	//
	// If there are already enough processors, this should be left empty.
	LCoresPerNuma map[int]int `json:"lcoresPerNuma,omitempty"`

	// LCoreMain is the DPDK main lcore ID.
	LCoreMain *int `json:"lcoreMain,omitempty"`

	// LCoreFlags is lcore-related flags passed to DPDK.
	// This replaces all other options.
	LCoreFlags string `json:"lcoreFlags,omitempty"`
}

LCoreConfig contains CPU and logical core related configuration.

type MemoryConfig

type MemoryConfig struct {
	// MemChannels is the number of memory channels.
	// Omitting or setting an incorrect value may result in suboptimal performance.
	MemChannels int `json:"memChannels,omitempty"`

	// MemPerNuma maps from NUMA socket ID to the amount of memory (MiB).
	// Hugepages must be configured prior to starting NDN-DPDK.
	//
	// Example:
	//  MemPerNuma[0] = 16384  limits up to 16384MB on socket 0.
	//  Omitting MemPerNuma[1] places no memory limit on socket 1.
	//  MemPerNuma[2] = 0      limits up to 1MB on socket 2; DPDK does not support a zero limit.
	//
	// It's not recommended to set a low limit (<1024MB) on NUMA socket 0 and each NUMA socket where
	// you have PCI device(s) that you want to use. Otherwise, you may run into memory allocation
	// errors in DPDK drivers.
	MemPerNuma map[int]int `json:"memPerNuma,omitempty"`

	// PreallocateMem preallocates memory up to the limit on each NUMA socket.
	// If a NUMA socket has no limit (MemPerNuma[socket] is omitted), this preallocates 1MB.
	PreallocateMem bool `json:"preallocateMem,omitempty"`

	// FilePrefix is shared data file prefix.
	// Each independent instance of NDN-DPDK must have different FilePrefix.
	FilePrefix string `json:"filePrefix,omitempty"`

	// MemFlags is memory-related flags passed to DPDK.
	// This replaces all other options.
	MemFlags string `json:"memFlags,omitempty"`
}

MemoryConfig contains memory related configuration.

Jump to

Keyboard shortcuts

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