Dataplane Configuration

For the majority of cases the default dataplane configuration is sufficient, but certain cases may require adjustments. These are often covered in more detail throughout the documentation, and relevant sections will be linked where appropriate.

These commands are all available in config mode (Configuration Mode).

Warning

The dataplane service requires a restart to enable configuration changes described in this section. After making changes, restart the dataplane from config mode using the following command:

tnsr# configure
tnsr(config)# service dataplane restart

CPU Workers and Affinity

The dataplane has a variety of commands to fine-tune how it uses available CPU resources on the host. These commands control CPU cores TNSR will use, both the number of cores and specific cores.

Worker Configuration

dataplane cpu corelist-workers <n>

Defines a specific list of CPU cores to be used by the dataplane. Run the command multiple times with different core numbers to define the list of cores to utilize. When removing items with no, the command accepts a specific core to remove from the list.

dataplane cpu coremask-workers <mask>

Similar to corelist-workers, but the cores are defined as a hexadecimal mask instead of a list. For example, 0x0000000000C0000C

dataplane cpu main-core <n>

Assigns the main dataplane process to a specific CPU core.

dataplane cpu scheduler-policy (batch|fifo|idle|other|rr)

Defines a specific scheduler policy for worker thread processor usage allocation

batch

Scheduling batch processes. Uses dynamic priorities based on nice values in the host OS, but always gives the thread a small scheduling penalty so that other processes take precedence.

fifo

First in-first out scheduling. Will preempt other types of threads and threads with a lower priority.

idle

Scheduling very low priority jobs.

other

Default Linux time-sharing scheduling. Uses dynamic priorities based on nice values in the host OS, similar to batch but without the built-in penalty.

rr

Round-robin scheduling. Similar to fifo but each thread is time-limited

dataplane cpu scheduler-priority <n>

For the fifo and rr scheduler policies, this number sets the priority of processes for the dataplane. It can be any number between 1 (low) and 99 (high).

dataplane cpu skip-cores <n>

Defines the number of cores to skip when creating additional worker threads, in the range of 1` to the highest available core number. The first <n> cores will not be used by worker threads.

Note

This does not affect the core used by the main thread, which is set by dataplane cpu main-core <n>.

dataplane cpu workers <n>

Defines the number of worker threads to create for the dataplane.

Note

The number of worker threads is in addition to the main process. For example, with a worker count of 4, the dataplane will use one main process with four worker threads, for a total of five threads.

Worker Example

This example sets four additional worker threads, and instructs the dataplane to skip one core when assigning worker threads to cores:

tnsr(config)# dataplane cpu workers 4
tnsr(config)# dataplane cpu skip-cores 1
tnsr(config)# service dataplane restart

Worker Status

The show dataplane cpu threads command displays the current dataplane process list, including the core usage and process IDs. This output corresponds to the example above:

tnsr(config)# show dataplane cpu threads
ID Name     Type    PID  LCore Core Socket
-- -------- ------- ---- ----- ---- ------
 0 vpp_main         2330     1    0      0
 1 vpp_wk_0 workers 2346     2    2      0
 2 vpp_wk_1 workers 2347     3    3      0
 3 vpp_wk_2 workers 2348     4    4      0
 4 vpp_wk_3 workers 2349     5    5      0

The output includes the following columns:

id

Dataplane thread ID.

name

Name of the dataplane process.

type

The type of thread, which will be blank for the main process.

pid

The host OS process ID for each thread.

LCore

The logical core used by the process.

Core

The CPU core used by the process.

Socket

The CPU socket associated with the core used by the process.

DPDK Configuration

Commands in this section configure hardware settings for DPDK devices.

dataplane dpdk dev <pci-id> (crypto|network) [num-rx-queues [<r>]] [num-tx-queues [<t>]]

Configures a specific device for use by TNSR. For network devices, see Setup NICs in Dataplane. For cryptographic devices, see Setup QAT Compatible Hardware.

dataplane dpdk no-tx-checksum-offload

Disables transmit checksum offloading for network devices.

dataplane dpdk no-multi-seg

Disables multi-segment buffers for network devices. Can improve performance, but disables jumbo MTU support. Recommended for Mellanox devices.

dataplane dpdk uio-driver [<driver-name>]

Configures the UIO driver for interfaces. See Setup NICs in Dataplane.

dataplane dpdk vdev <sw-dev-type>

Defines a software device to be used by the dataplane, such as:

aesni_gcm

AESNI GCM cryptodev

aesni_mb

AESNI multibuffer cryptodev

Memory

Commands in this section configure memory allocation for the dataplane.

dataplane (ip|ip6) heap-size [<size>]

Defines the amount of memory to be allocated for the dataplane FIB. The default is 32MB. For more information, see Working with Large BGP Tables.

Note

When tuning this value, also consider increasing the Statistics Segment heap-size.

dataplane ip6 hash-buckets [<size>]

Defines the number of IPv6 forwarding table hash buckets. The default is 65536.

NAT

Commands in this section configure dataplane NAT behavior.

dataplane nat dslite-ce

Enables DS-Lite CE mode.

dataplane nat max-translations-per-user <n>

Defines the number of NAT translation entries to allow for each IP address. The default value is 100. The ideal value depends entirely on the environment and number of sessions per IP address involved in NAT. This includes traffic sourced from TNSR itself address as well, not only internal source IP addresses.

dataplane nat mode (deterministic|endpoint-dependent|simple)

Configures the operating NAT mode. See Dataplane NAT Modes.

dataplane nat mode-options simple (out2in-dpo|static-mapping-only)

Configures options for the NAT mode. See Dataplane NAT Modes.

Statistics Segment

These commands configure the statistics segment parameters for the dataplane. This feature enables local access to dataplane statistics via shared memory.

See also

For more information on how to make use of this feature, see the VPP documentation for the example stat_client.

dataplane statseg heap-size <heap-size>[kKmMgG]

Size of shared memory allocation for stats segment, in bytes. This value can be suffixed with K (kilobytes), M (megabytes), or G (gigabytes) in upper or lowercase. Default value is 96M.

Note

This value may need to be increased to accommodate large amounts of routes in routing tables. The default value of 96M can safely accommodate approximately one million routes.

dataplane statseg per-node-counters enable

Enables per-graph-node performance statistics.

dataplane statseg socket-name <socket-name>

Absolute path to UNIX domain socket for stats segment. The default path is /run/vpp/stats.sock.