Developing Applications with NVIDIA BlueField DPU and NVIDIA DOCA Libraries

The development process for DPUs can get complex. This is where NVIDIA DOCA comes in. With several built-in libraries that allows for plug-n-play and simple…

Anuradha Karuppiah
7 min readintermediate
--
View Original

Overview

This article explores the development of applications using NVIDIA BlueField Data Processing Units (DPUs) and the DOCA libraries, specifically focusing on the creation of the FRR DOCA dataplane plugin. It details the process of offloading Policy-Based Routing (PBR) rules and provides insights into hardware initialization, flow programming, and application development best practices.

What You'll Learn

1

How to link DOCA and DPDK libraries to your application

2

How to initialize hardware using DPDK APIs

3

How to program flows for traffic steering using DOCA flow APIs

Prerequisites & Requirements

  • Understanding of DPDK and DOCA libraries
  • Access to NVIDIA BlueField DPU and DOCA SDK

Key Questions Answered

How do you add the DOCA dataplane plugin to Zebra?
To add the DOCA dataplane plugin to Zebra, you need to link the DPDK and DOCA flow shared libraries in the makefile and configure the FRR service to enable the plugin during startup. This involves using pkg-config to check for the necessary libraries and setting the appropriate flags in the configuration.
What steps are involved in initializing DOCA flow?
DOCA flow initialization involves setting up the doca-flow and doca-flow-port databases after the hardware initialization using rte_eal_init. You must configure the flow settings, including the total sessions and queues, and then start the flow port with the appropriate configuration.
What is the process for programming PBR rules using DOCA flow APIs?
Programming PBR rules with DOCA flow APIs requires defining data structures for match, actions, forward, and monitor attributes. You create a flow pipe and add entries to it, specifying the unique match fields and actions for each PBR rule, allowing for efficient traffic steering.
How can you verify hardware acceleration in FRR?
You can verify hardware acceleration in FRR by checking the flow counters and inspecting the hardware entries using tools like mlx_steering_dump. This allows you to confirm that the PBR rules are being processed by the DPU hardware as expected.

Key Statistics & Figures

Total ports available
6
This statistic reflects the number of ports initialized and available for use in the DPU environment.
Total packets processed
202
This number indicates the packets that were counted by the flow monitoring during the operation of the PBR rules.
Total bytes processed
24644
This statistic shows the total number of bytes that were processed as a result of the PBR rules being applied.

Technologies & Tools

Hardware
Nvidia Bluefield Dpu
Used for offloading networking tasks and enhancing application performance.
Software
Doca
Provides libraries for developing applications that leverage DPU capabilities.
Software
Dpdk
Used for high-performance packet processing and hardware initialization.

Key Actionable Insights

1
Linking DOCA and DPDK libraries is crucial for leveraging hardware acceleration in networking applications.
This step ensures that your application can utilize the advanced features provided by NVIDIA's libraries, which can significantly enhance performance.
2
Proper initialization of hardware using DPDK APIs sets the foundation for successful application development.
Understanding the initialization process is vital as it directly impacts how the application interacts with the hardware and manages resources.
3
Utilizing DOCA flow APIs for programming flows can streamline the process of traffic management.
By effectively managing flows, you can optimize network performance and ensure that packets are routed efficiently, which is essential for high-performance applications.

Common Pitfalls

1
Failing to properly link the necessary libraries can lead to compilation errors or runtime failures.
This often occurs when the pkg-config paths are not correctly set, which can prevent the application from accessing the required DOCA and DPDK functionalities.
2
Neglecting to initialize hardware before programming flows can result in unexpected behavior.
If the hardware is not initialized properly, the application may attempt to interact with unconfigured resources, leading to errors or suboptimal performance.

Related Concepts

Nvidia Doca Libraries
Dpdk For Packet Processing
Policy-based Routing (pbr)
Flow Programming In Networking