Counters

NVIDIA BlueField Virtio-net v1.9.0

To query the virtqueue (VQ) packet statistics of each virtio-net device created, run:

Copy
Copied!
            

[dpu]# virtnet query -p <PFID> -v <VFID> -q <QID>

VQ Statistics

To query Rx VQ statistics, use the corresponding VQ index. For example, If there are 3 queues configured then to query Rx, VQ uses queue 0, Tx VQ uses queue 1, and Ctrl VQ uses queue 2.

The following is the command to query PF 0, VF 0, and VQ 0 (i.e., Rx).

Copy
Copied!
            

[dpu]# virtnet query -p 0 -v 0 -q 0

Output:

Copy
Copied!
            

"enabled-queues-info": [ { "index": "0", "size": "256", "msix_vector": "0x1", "enable": "1", "notify_offset": "0", "descriptor_address": "0xffffe000", "driver_address": "0xfffff000", "device_address": "0xfffff240", "received_desc": "256", "completed_desc": "19", "bad_desc_errors": "0", "error_cqes": "0", "exceed_max_chain": "0", "invalid_buffer": "0", "batch_number": "64", "dma_q_used_number": "0", "handler_schd_number": "4", "aux_handler_schd_number": "3", "max_post_desc_number": "0", "total_bytes": "6460", "rq_cq_max_count": "0", "rq_cq_period": "0", "rq_cq_period_mode": "1" }

The following are some of the important VQ counters:

Counter Name

Description

total_bytes

Number of bytes received

received_desc

Number of available descriptors received by device

completed_desc

Number of available descriptors completed by the device

error_cqes

Number of error CQEs received on the queue

bad_desc_errors

Number of bad descriptors received

exceed_max_chain

Number of chained descriptors received that exceed the max allowed chain by device

invalid_buffer

Number of times device tried to read or write buffer that is not registered to the device


When DPA is the data path provider, each RQ has its corresponding drop counter, which counts the number of packets dropped inside the DPA virtio RQs.

Info

The drop could also happen from the uplink or SF.

The drop counter only increments (initial value being 0), and its value gets reset to 0 when disabled.

RQ drop counter can be enabled and disabled as follows (using VF 0 on PF 0):

Copy
Copied!
            

[dpu]# virtnet modify -p 0 -v 0 device -dc enable [dpu]# virtnet modify -p 0 -v 0 device -dc disable

Note

Drop counter is attached to a RQ, thus RQ must be created first. This means that the virtio-net device should be probed by the driver on the host OS before running the commands above.

To query the drop counter value(s), run:

Copy
Copied!
            

[dpu]# virtnet query -p 0 -v 0 | grep num_desc_drop_pkts

If there are more than one RQ for a device, the drop count is the sum of all RQ's value.

Note

Randomly, after disabling drop counter, the counter value cannot be reset to 0. However, the incremental functionality is not impacted (based on a non-zero value).

© Copyright 2024, NVIDIA. Last updated on May 7, 2024.