xarxa-driver

Crates

git

Versions

default

Flavors

Skip to main content

Module config

Module config 

Source
Expand description

Compile-time configuration.

The sizes of the packet pool and of the buffers in it are set at compile time. They can be set in two ways:

  • With a cargo feature named <name>-<value>, lowercase and with dashes instead of underscores. For example packet-buf-count-32. Only the values listed in Cargo.toml can be set this way.
  • With an environment variable named XARXA_<NAME> at build time. For example XARXA_PACKET_BUF_COUNT=32 cargo build. They can also be set in the [env] section of .cargo/config.toml. Any value can be set this way.

Environment variables win over cargo features. Enabling two cargo features for the same setting with different values fails the build.

The xarxa crate forwards the features of the same name to this crate, and has its own knobs in xarxa::config.

Constantsยง

PACKET_BUF_ALIGN
Alignment of the buffer in a PacketBuf, in bytes.
PACKET_BUF_COUNT
Number of buffers in the packet pool.
PACKET_BUF_SIZE
Size of the buffer in a PacketBuf, in bytes.