]> www.infradead.org Git - nvme.git/commit
RDMA/mlx5: Add optional counters for RDMA_TX/RX_packets/bytes
authorPatrisious Haddad <phaddad@nvidia.com>
Thu, 13 Mar 2025 14:18:41 +0000 (16:18 +0200)
committerLeon Romanovsky <leon@kernel.org>
Tue, 18 Mar 2025 10:18:30 +0000 (06:18 -0400)
commitd375db42a8effdfeb7973d4f1b0b5985e066fd28
tree13f0b219035e2d5df930733bd0f029c5bd5b18b3
parent1d6a9e7449e2a0c1e2934eee7880ba8bd1e464cd
RDMA/mlx5: Add optional counters for RDMA_TX/RX_packets/bytes

Add the following optional counters:
rdma_tx_packets,rdma_rx_bytes,rdma_rx_packets,rdma_tx_bytes.

Which counts all RDMA packets/bytes sent and received per link.

Note that since each direction packet and byte counter are shared,
the counter is only reset when both counters of that direction
are removed. But from user-perspective each can be enabled/disabled separately.

The counters can be enabled using:
sudo rdma stat set link rocep8s0f0/1 optional-counters rdma_tx_packets
And can be seen using:
rdma stat -j show link rocep8s0f0/1

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/9f2753ad636f21704416df64b47395c8991d1123.1741875070.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/counters.c
drivers/infiniband/hw/mlx5/fs.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
include/linux/mlx5/device.h