Skip to contentSkip to conversation

net/mlx5: Expose uar access and odp page fault counters

PATCH Applied Tariq Toukan 3 participants 3 messages Sep 25, 2025 – Sep 27, 2025

Subsystems (6)
lore
Share & tools
lore

Tariq Toukan

author maintainer
#0 lore raw

PATCH 1/1 net/mlx5: Expose uar access and odp page fault counters

From: Akiva Goldberger <[email protected]>

Add three counters to vnic health reporter:
bar_uar_access, odp_local_triggered_page_fault, and odp_remote_triggered_page_fault.

- bar_uar_access
number of WRITE or READ access operations to the UAR on the PCIe BAR.
- odp_local_triggered_page_fault
number of locally-triggered page-faults due to ODP.
- odp_remote_triggered_page_fault
number of remotly-triggered page-faults due to ODP.

Example access:

    $ devlink health diagnose pci/0000:08:00.0 reporter vnic
	vNIC env counters:
	total_error_queues: 0 send_queue_priority_update_flow: 0
	comp_eq_overrun: 0 async_eq_overrun: 0 cq_overrun: 0
	invalid_command: 0 quota_exceeded_command: 0
	nic_receive_steering_discard: 0 icm_consumption: 1032
	bar_uar_access: 1279 odp_local_triggered_page_fault: 20
	odp_remote_triggered_page_fault: 34
---
 Documentation/networking/devlink/mlx5.rst                | 6 ++++++
 .../net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c | 9 +++++++++
 2 files changed, 15 insertions(+)
Documentation/networking/devlink/mlx5.rst +6 -0
index 41c9b716699e..0e5f9c76e514 100644
@@ -385,6 +385,12 @@ Description of the vnic counters:
         amount of Interconnect Host Memory (ICM) consumed by the vnic in
         granularity of 4KB. ICM is host memory allocated by SW upon HCA request
         and is used for storing data structures that control HCA operation.
+- bar_uar_access
+        number of WRITE or READ access operations to the UAR on the PCIe BAR.
+- odp_local_triggered_page_fault
+        number of locally-triggered page-faults due to ODP.
+- odp_remote_triggered_page_fault
+        number of remotly-triggered page-faults due to ODP.
 
 User commands examples:
 
drivers/net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c +9 -0
index 73f5b62b8c7f..172344734b8c 100644
@@ -107,6 +107,15 @@ void mlx5_reporter_vnic_diagnose_counters(struct mlx5_core_dev *dev,
 	}
 	if (MLX5_CAP_GEN(dev, nic_cap_reg))
 		mlx5_reporter_vnic_diagnose_counter_icm(dev, fmsg, vport_num, other_vport);
+	if (MLX5_CAP_GEN(dev, vnic_env_cnt_bar_uar_access))
+		devlink_fmsg_u32_pair_put(fmsg, "bar_uar_access",
+					  VNIC_ENV_GET(&vnic, bar_uar_access));
+	if (MLX5_CAP_GEN(dev, vnic_env_cnt_odp_page_fault)) {
+		devlink_fmsg_u32_pair_put(fmsg, "odp_local_triggered_page_fault",
+					  VNIC_ENV_GET(&vnic, odp_local_triggered_page_fault));
+		devlink_fmsg_u32_pair_put(fmsg, "odp_remote_triggered_page_fault",
+					  VNIC_ENV_GET(&vnic, odp_remote_triggered_page_fault));
+	}
 
 	devlink_fmsg_obj_nest_end(fmsg);
 	devlink_fmsg_pair_nest_end(fmsg);

base-commit: a1f1f2422e098485b09e55a492de05cf97f9954d

Signature · 1 line
2.31.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Tariq Toukan

From: Akiva Goldberger <[email protected]>

Add three counters to vnic health reporter:
bar_uar_access, odp_local_triggered_page_fault, and odp_remote_triggered_page_fault.

- bar_uar_access
number of WRITE or READ access operations to the UAR on the PCIe BAR.
- odp_local_triggered_page_fault
number of locally-triggered page-faults due to ODP.
- odp_remote_triggered_page_fault
number of remotly-triggered page-faults due to ODP.

Example access:

    $ devlink health diagnose pci/0000:08:00.0 reporter vnic
	vNIC env counters:
	total_error_queues: 0 send_queue_priority_update_flow: 0
	comp_eq_overrun: 0 async_eq_overrun: 0 cq_overrun: 0
	invalid_command: 0 quota_exceeded_command: 0
	nic_receive_steering_discard: 0 icm_consumption: 1032
	bar_uar_access: 1279 odp_local_triggered_page_fault: 20
	odp_remote_triggered_page_fault: 34
Quoted 3 lines

...

#2 lore raw
In reply to Tariq Toukan
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 14 lines · On Thu, 25 Sep 2025 13:45:30 +0300 you wrote:

From: Akiva Goldberger <[email protected]>

Add three counters to vnic health reporter:
bar_uar_access, odp_local_triggered_page_fault, and odp_remote_triggered_page_fault.

- bar_uar_access
number of WRITE or READ access operations to the UAR on the PCIe BAR.
- odp_local_triggered_page_fault
number of locally-triggered page-faults due to ODP.
- odp_remote_triggered_page_fault
number of remotly-triggered page-faults due to ODP.

Quoted 1 line

[...]

Here is the summary with links:
- [net-next] net/mlx5: Expose uar access and odp page fault counters

    https://git.kernel.org/netdev/net-next/c/e835faaed2f8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html