NVIDIA DOCA NVMe-oF RDMA Target Reference Application Guide
Instructions: Please replace all labels/tags such as
All the text that is marked in RED should be replaced with actual content for the specific guide.
This document provides a <application name> implementation on top of the NVIDIA® BlueField® DPU.
A storage target is any application that can access data storage. This includes hard drives, SSDs, network-attached storage (NAS), and cloud storage services.
It serves storage access requests from local or remote initiators.
To allow the storage target to receive remote requests (over the network), the NVMe ( Non-Volatile Memory Express ) over fabrics (NVMeOF) protocol was introduced.
NVMe over Fabrics (NVMe-oF) is a protocol specification designed to extend the capabilities of NVMe storage across network fabrics (for example, RoCEv1/IB RDMA and NVMeTCP).
NVMe-oF extends the concept of storage targets by enabling NVMe commands to be executed over a network, rather than being limited to direct-attached storage.
Storage target application that supports NVMe-oF is a heavy application that consumes a substantial number of CPU cores.
To improve latency, free CPU resources and save power, an offload solution is required. Starting from BF3, the target application shall be offloaded on the DPA.
To abstract the communication between the target offload application (in our case SPDK) integration with the underlying offload accelerator and to ease the integration,
a new DOCA library is introduced (DOCA_STA). The library shall expose a public API that shall be used by the target application (DOCA application) for control-plane and data-plane handling.
While a software-based storage target accesses the NVMe drives directly over the PCIe, the DPA storage target offload accelerator accesses the NVMe drives
over PCIe-P2P (peer-to-peer) topology. To allow such access special kernel configuration is required.
The file compression application client runs on the host and the server runs on the DPU.
The file compression application runs on top of the DOCA Comm Channel API to send and receive the file from the host and to the DPU.
Connection is established on both sides by DOCA Comm Channel API.
Client compresses the data:
When compress engine is available – submits compress job with DOCA Compress API and sends the result to the server
When compress engine is unavailable – compresses the data in software
Client sends the number of messages needed to send the compressed content of the file.
Client sends data segments in size of up to 4080 bytes.
Server saves the received data in a buffer and submits a decompress job.
Server sends an ACK message to the client when all parts of the file are received successfully.
Server compares the received checksum to the calculated checksum.
Server writes the decompressed data to an output file.
This application leverages the following DOCA libraries:
For additional information about the used DOCA libraries, please refer to the respective programming guides.
NVIDIA BlueField-3 DPU is required.
Ubuntu 18.04/20.04/22.04 hosts (x86)
Open MPI version 4.1.5rc2 or greater (included in DOCA's installation)
Please refer to the NVIDIA DOCA Installation Guide for Linux for details on how to install BlueField-related software.
The installation of DOCA's reference applications contains the sources of the applications, alongside the matching compilation instructions. This allows for compiling the applications "as-is" and provides the ability to modify the sources, then compile a new version of the application.
For more information about the applications as well as development and compilation tips, refer to the DOCA Reference Applications page.
The sources of the application can be found under the application's directory: /opt/mellanox/doca/applications/file_compression/
.
Compiling All Applications
All DOCA applications are defined under a single meson project. So, by default, the compilation includes all of them.
To build all the applications together, run:
cd /opt/mellanox/doca/applications/
meson /tmp/build
ninja -C /tmp/build
doca_file_compression
is created under /tmp/build/file_compression/
.
Compiling Only the Current Application
To directly build only the file compression application: (REPLACE WITH FLAG FOR YOUR APP)
cd /opt/mellanox/doca/applications/ meson /tmp/build -Denable_all_applications=
false
-Denable_file_compression=true
ninja -C /tmp/buildInfodoca_file_compression
is created under/tmp/build/file_compression/
.Alternatively, one can set the desired flags in the
meson_options.txt
file instead of providing them in the compilation command line:Edit the following flags in
/opt/mellanox/doca/applications/meson_options.txt
:Set
enable_all_applications
tofalse
Set
enable_file_compression
totrue
The same compilation commands should be used, as were shown in the previous section:
cd /opt/mellanox/doca/applications/ meson /tmp/build ninja -C /tmp/build
Infodoca_file_compression
is created under/tmp/build/file_compression/
.
Troubleshooting
Please refer to the NVIDIA DOCA Troubleshooting for any issue you may encounter with the compilation of the DOCA applications.
Prerequisites
<huge pages and stuff are declared here>
The IPsec security gateway application is based on DOCA Flow. Therefore, the user is required to allocate huge pages.
$ echo
'1024'
| sudo tee -a /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages $ sudo mkdir /mnt/huge $ sudo mount -t hugetlbfs -o pagesize=2M nodev /mnt/huge
Application Execution
The file compression application is provided in source form, hence a compilation is required before the application can be executed.
Application usage instructions (REPLACE WITH REAL HELP AS PRINTED FROM YOUR APP) :
Usage: doca_file_compression [DOCA Flags] [Program Flags] DOCA Flags: -h, --help Print a help synopsis -v, --version Print program version information -l, --log-level Set the (numeric) log level
for
the program <10
=DISABLE,20
=CRITICAL,30
=ERROR,40
=WARNING,50
=INFO,60
=DEBUG,70
=TRACE> --sdk-log-level Set the SDK (numeric) log levelfor
the program <10
=DISABLE,20
=CRITICAL,30
=ERROR,40
=WARNING,50
=INFO,60
=DEBUG,70
=TRACE> -j, --json <path> Parse all command flags from an input json file Program Flags: -p, --pci-addr DOCA Comm Channel device PCI address -r, --rep-pci DOCA Comm Channel device representor PCI address -f, --file File to send by the client / File to write by the server -t, --timeout Application timeoutfor
receiving file content messages,default
is5
secFor additional information, please refer to the Command Line Flags section below.
NoteThe above usage printout can be printed to the command line using the
-h
(or--help
) options: (REPLACE WITH REAL PATH OF YOUR APP)./doca_file_compression -h
CLI example for running the application on BlueField: (REPLACE WITH REAL PATH & COMMAND OF YOUR APP)
./doca_file_compression -p
03
:00.0
-r 3b:00.0
-f received.txtNoteBoth the DOCA Comm Channel device PCI address (
03:00.0
) and the DOCA Comm Channel device representor PCI address (3b:00.0
) should match the addresses of the desired PCI devices.CLI example for running the application on the host: (REPLACE WITH REAL PATH & COMMAND OF YOUR APP)
./doca_file_compression -p 3b:
00.0
-f send.txtNoteThe DOCA Comm Channel device PCI address (
3b:00.0
) should match the address of the desired PCI device.The application also supports a JSON-based deployment mode, in which all command-line arguments are provided through a JSON file:
./doca_file_compression --json [json_file]
For example: (REPLACE WITH REAL PATH & COMMAND OF YOUR APP)
./doca_file_compression --json ./file_compression_params.json
NoteBefore execution, please ensure that the used JSON file contains the correct configuration parameters, and especially the desired PCI addresses needed for the deployment.
Command Line Flags
Flag Type |
Short Flag |
Long Flag/JSON Key |
Description |
JSON Content |
General flags |
|
|
Prints a help synopsis |
N/A |
|
|
Prints program version information |
N/A |
|
|
|
Set the log level for the application:
|
|
|
N/A |
|
Sets the log level for the program:
|
|
|
|
|
Parse all command flags from an input json file |
N/A |
|
Program flags |
|
|
For client – path to the file to be sent For server – path to write the file into Note
This is a mandatory flag.
|
|
|
|
Comm Channel DOCA device PCIe address Note
This is a mandatory flag.
|
|
|
|
|
Comm Channel DOCA device representor PCIe address Note
This flag is mandatory only on the DPU.
|
|
Refer to DOCA Arg Parser for more information regarding the supported flags and execution modes.
Troubleshooting
Please refer to the NVIDIA DOCA Troubleshooting for any issue you may encounter with the installation or execution of the DOCA applications.
Parse application argument.
Initialize arg parser resources and register DOCA general parameters.
doca_argp_init();
Register file compression application parameters.
register_file_compression_params();
Parse the arguments.
doca_argp_start();
Parse app parameters.
Set endpoint attributes.
set_endpoint_properties();
Set maximum message size of 4080 bytes.
Set maximum number of messages allowed.
Create comm channel endpoint.
doca_comm_channel_ep_create();
Create endpoint for client/server.
Run client/server main logic.
file_compression_client/server();
Clean up the file compression application.
file_compression_cleanup();
Free all application resources.
Arg parser destroy.
doca_argp_destroy()
/opt/mellanox/doca/applications/file_compression/
/opt/mellanox/doca/applications/file_compression/file_compression_params.json