MoonGen
 All Files Functions Variables Pages
dpdk.lua File Reference

DPDK ... More...

Go to the source code of this file.

Functions

function mod init ()
 Inits DPDK. Called by MoonGen on startup.
 
function task wait ()
 Wait for a task and return any arguments returned by the task.
 
function mod launchLuaOnCore (core,...)
 Launch a LuaJIT VM on a core with the given arguments. More...
 
function mod launchLua (...)
 launches the lua file on the first free core
 
function mod waitForSlaves ()
 waits until all slave cores have finished their jobs
 
function mod getCycles ()
 get the CPU's TSC
 
function mod getCyclesFrequency ()
 get the TSC frequency
 
function mod getTime ()
 gets the time in seconds
 
function mod setRuntime (time)
 set total run time of the test (to be called from master core on startup, shared between all cores)
 
function mod running (extraTime)
 Returns false once the app receives SIGTERM or SIGINT, the time set via setRuntime expires, or when a thread calls dpdk.stop().
 
function mod stop ()
 request all tasks to exit
 
function mod sleepMillis (t)
 Delay by t milliseconds. More...
 
function mod sleepMicros (t)
 Delay by t microseconds. More...
 
function mod sleepMillisIdle (t)
 Sleep by t milliseconds by calling usleep().
 
function mod sleepMicrosIdle (t)
 Sleep by t microseconds by calling usleep().
 
function mod getCore ()
 Get the core and socket id for the current thread.
 

Variables

local mod = {}
 high-level dpdk wrapper
 

Detailed Description

DPDK ...

Todo:
TODO docu

Definition in file dpdk.lua.

Function Documentation

function mod launchLuaOnCore ( core  ,
  ... 
)

Launch a LuaJIT VM on a core with the given arguments.

TODO: use proper serialization and only pass strings

function mod sleepMicros ( )

Delay by t microseconds.

Note that this does not sleep the actual thread; the time is spent in a busy wait loop by DPDK. This means that this sleep is somewhat more accurate than relying on the OS.

function mod sleepMillis ( )

Delay by t milliseconds.

Note that this does not sleep the actual thread; the time is spent in a busy wait loop by DPDK.

Examples:
l2-poisson-load-latency.lua, and quality-of-service-test.lua.