..
# Copyright (c) 2022-2025, Arm Limited.
#
# SPDX-License-Identifier: Apache-2.0
##########
User Guide
##########
************
Introduction
************
Welcome to the Dataplane Stack reference solution user guide. This guide provides
the detailed guidelines to end users on how to download, build and execute the
solution on Arm platforms. Guidelines on experimenting with various parameters
that affect performance of the use cases are described in detail. This guide
is intended to describe complex and practical use cases which require complex
test setup.
Users and Essential Skills
==========================
The reference solutions are targeted for a networking software development or
performance analysis engineer who has an in-depth networking knowledge, but does
not know about Arm necessarily.
Familiarity with user-space open-source networking projects,
e.g., DPDK, VPP, ODP, will help gain deeper understanding of this guide
and the reference solutions more easily.
*****
Setup
*****
Most sample applications described in this guide require the following setup.
.. code-block:: none
+---------------+ +-----------+
| | +----| |
| Traffic | Ethernet Connection | N | DUT |
| Generator |<----------------------->| I | |
| | (Port 0)| C | |
| | +----| |
+---------------+ +-----------+
Some will work with only one machine, though use of virtual interfaces.
As shown, the Device Under Test (DUT) should have at least one NIC connected
to the traffic generator on port 0. The user can use any traffic
generator. The DUT is also used to download the solution repository and
build the code. Cross compilation is not supported currently.
****************
Tested Platforms
****************
The sample applications are tested on the following platforms.
DUT
===
- Ampere Altra (Neoverse-N1)
- Ubuntu 22.04.3 LTS (Jammy Jellyfish)
NIC
===
- `Mellanox ConnectX-6 Dx The latest features and bug fixes are made available in the git repository, but may not be
tagged as part of a release. By default, we recommend checking out a tagged release using
to ensure stability. However, if you want to try the most recent changes and bugfixes, you can checkout the main
branch. Please keep in mind that this version may not have been fully tested or officially
validated, and could be unstable. Use it at your own discretion. The NGINX package is installed in setup.sh.
NGINX systemd service will be started automatically,
which spawns some NGINX worker processes. To stop NGINX service, run: To disable the NGINX service from starting automatically
on system boot, run: Hugepages help prevent TLB misses and are commonly used by networking
applications to manage memory. The larger the hugepage, the greater the
performance increase due to fewer TLB misses and fewer page table walks.
1GB hugepages are easiest to reserve at boot time, as reservation during
run time is likely to not be possible. Run time reservation would require
1GB of available contiguous memory, which is typically not available. The combination of the kernel parameters mentioned above ensure that the
CPUs run only the desired application. They never process kernel RCU
callbacks, don't generate scheduling ticks as there is only one process
running on them, and are isolated from running any processes other than
the ones pinned to them (the desired application). If during link time you run into a missing symbols error:
Using other versions of Dataplane Stack
Setup
=====
This solution includes a ``setup.sh`` bash script which installs and upgrades the
required packages. To use it:
.. code-block:: shell
cd $NW_DS_WORKSPACE/dataplane-stack
sudo ./setup.sh
.. raw:: html
How to stop NGINX starting automatically?
Additionally, some platform level parameters are required to run the applications.
These are set by grub at boot time.
To edit them you must edit ``/etc/default/grub`` as root. This file should have a
line specifying the GRUB command line like this:
.. code-block:: none
GRUB_CMDLINE_LINUX=""
This may already contain some parameters or be empty. If it's missing add it.
An example value of GRUB_CMDLINE_LINUX could be:
.. code-block:: none
GRUB_CMDLINE_LINUX="default_hugepagesz=1G hugepagesz=1G hugepages=1 hugepagesz=2M hugepages=512 iommu.passthrough=1 isolcpus=1-4 rcu_nocbs=1-4 nohz_full=1-4 cpufreq.off=1 cpuidle.off=1 kpti=0"
The string specifies the kernel command line parameters. Alter it according to the guide below.
Parameters required by dataplane stack:
- reserve one 1G hugepage (via ``hugepagesz=1G hugepages=1``)
- reserve 512 2M hugepages (via ``hugepagesz=2M hugepages=512``)
- set IOMMU into passthrough mode (via ``iommu.passthrough=1``)
- isolate CPUs 1-4 from the Linux scheduler (via ``isolcpus=1-4``)
Optional parameters for better performance:
- isolate CPUs 1-4 from processing RCU callbacks (via ``rcu_nocbs=1-4``)
- set CPUs 1-4 to omit scheduling clock ticks (via ``nohz_full=1-4``)
- disable cpufreq and cpuidle subsystems (via ``cpufreq.off=1`` and ``cpuidle.off=1``)
- disable control page table isolation of user and kernel address spaces (via ``kpti=0``)
These options might need to be tailored to your specific machine. Make sure
the selection of isolated CPUs is correct. Keep in mind that the isolated CPUs
will not be available for other tasks (like compilation).
.. raw:: html
Why reserve hugepages?
.. raw:: html
Why isolate CPUs?
Reboot
======
After finishing setup, reboot the DUT. This ensures the setup changes are reflected before
running the sample applications. Run:
.. code-block:: none
sudo update-grub
sudo reboot
*****
Build
*****
This solution uses Makefile to build all the components.
To build the Dataplane Stack, run the following on the DUT:
.. code-block:: shell
cd $NW_DS_WORKSPACE/dataplane-stack
make all
It is also possible to compile the components individually by specifying ``make dpdk`` or ``make vpp``.
Run ``make help`` to view a list of all Makefile targets.
The above mentioned ``make`` commands can also be used to rebuild after modifying the code.
.. raw:: html
Troubleshooting
plugin/load [error ]: .[...]/dpdk_plugin.so:
undefined symbol: armv8_dec_aes_cbc_sha1_128
This is fixed by modifying the /components/vpp/build/external/packages/dpdk.mk file
and adding crypto/armv8 to the list of DPDK_DRIVERS_DISABLED.
For example, if enP1p1s0f0 is attached to the traffic generator, then running the command will show the PCIe address (0001:01:00.0).
.. code-block:: none $ sudo lshw -c net -businfo Bus info Device Class Description ==================================================== pci@0001:01:00.0 enP1p1s0f0 network MT27800 Family [ConnectX-5] pci@0001:01:00.1 enP1p1s0f1 network MT27800 Family [ConnectX-5] .. raw:: html