What can I help you with?
NVIDIA DPDK Documentation MLNX_DPDK_22.11_2310.5.1 LTS

mlx5 Tx Datapath Tracing

The mlx5 Tx data-path tracing capability enables the user to gather the comprehensive information about packets' handling in PMD with timings, including the packet sending completion ones.

  • Specify the "meson" option:

    Copy
    Copied!
                

    --enable_trace_fp=true

  • Specify the c_args shoudl API:

    Copy
    Copied!
                

    -DALLOW_EXPERIMENTAL_API

The DPDK configuration examples:

Copy
Copied!
            

meson configure --buildtype=debug -Denable_trace_fp=true -Dc_args='-DRTE_LIBRTE_MLX5_DEBUG -DRTE_ENABLE_ASSERT -DALLOW_EXPERIMENTAL_API' build meson configure --buildtype=debug -Denable_trace_fp=true -Dc_args='-DRTE_ENABLE_ASSERT -DALLOW_EXPERIMENTAL_API' build meson configure --buildtype=release -Denable_trace_fp=true -Dc_args='-DRTE_ENABLE_ASSERT -DALLOW_EXPERIMENTAL_API' build meson configure --buildtype=release -Denable_trace_fp=true -Dc_args='-DALLOW_EXPERIMENTAL_API' build

If the sending completion timings are crucial, the NIC should be configured to provide real-time timestamps (set the REAL_TIME_CLOCK_ENABLE NV settings parameter to TRUE). For example:

Copy
Copied!
            

sudo mlxconfig -d /dev/mst/mt4125_pciconf0 s REAL_TIME_CLOCK_ENABLE=1

The trace data are committed to the specified folder on the EAL cleanup. Optionally, the data commit can be explicitly triggered by the application via the rte_trace_save() API call.

The following are the EAL parameters that control the trace capability in runtime:

Parameters

Description

--trace=pmd.net.mlx5.tx

The regular expression to enable the trace points with matching names. "pmd.net.mlx5.tx" must be enabled to gather all events needed to analyze the mlx5 Tx datapath and its timings.

By default, all the trace points are disabled.

--trace-dir=/var/log

[Optional] Trace storing directory.

The default is: “$HOME/dpdk-traces/rte-yyyy-mm-dd-[AP]M-hh-mm-ss/”

--trace-bufsz=<val>B|<val>K|<val>M

[Optional] Trace data buffer size per thread.

The default is 1MB

--trace-mode=overwrite|discard

[Optional] Selects trace data buffer mode.

The gathered trace data can be analyzed with a Python script below. To parse the trace, the data script uses the Babeltrace2 library. The package should be either installed or built from source code as shown below:

Copy
Copied!
            

git clone https://github.com/efficios/babeltrace.git cd babeltrace ./bootstrap ./configure –help ./configure --disable-api-doc --disable-man-pages --disable-python-bindings-doc --enable-python-plugins --enable-python-binding

Running the Analyzing Script

The analyzing script is located in the folder: ./drivers/net/mlx5/tools

It requires Python3.6, Babeltrace2 packages and it takes the only parameter of trace data folder. For example:

Copy
Copied!
            

./mlx5_trace.py /var/log/rte-2023-01-23-AM-11-52-39


Interpreting the Script Output Data

All the timings are given in nanoseconds.

The list of Tx (and coming Rx) bursts per port/queue is presented in the output. Each list element contains the list of build WQEs, and each WQE contains the list of packets to send.

image2023-1-30_16-28-17-version-1-modificationdate-1736074535043-api-v2.png


© Copyright 2024, NVIDIA. Last updated on Jan 9, 2025.