Skip to content

Commit cdc4927

Browse files
dtatuleakuba-moo
authored andcommitted
net/mlx5e: Add stale counter for PCIe congestion events
This ethtool counter is meant to help with observing how many times the congestion event was triggered but on query there was no state change. This would help to indicate when a work item was scheduled to run too late and in the meantime the congestion state changed back to previous state. While at it, do a driveby typo fix in documentation for pci_bw_inbound_high. Signed-off-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f405349 commit cdc4927

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ Device Counters
13481348
is in a congested state.
13491349
If pci_bw_inbound_high == pci_bw_inbound_low then the device is not congested.
13501350
If pci_bw_inbound_high > pci_bw_inbound_low then the device is congested.
1351-
- Tnformative
1351+
- Informative
13521352

13531353
* - `pci_bw_inbound_low`
13541354
- The number of times the device crossed the low inbound PCIe bandwidth
@@ -1373,3 +1373,8 @@ Device Counters
13731373
If pci_bw_outbound_high == pci_bw_outbound_low then the device is not congested.
13741374
If pci_bw_outbound_high > pci_bw_outbound_low then the device is congested.
13751375
- Informative
1376+
1377+
* - `pci_bw_stale_event`
1378+
- The number of times the device fired a PCIe congestion event but on query
1379+
there was no change in state.
1380+
- Informative

drivers/net/ethernet/mellanox/mlx5/core/en/pcie_cong_event.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct mlx5e_pcie_cong_stats {
2424
u32 pci_bw_inbound_low;
2525
u32 pci_bw_outbound_high;
2626
u32 pci_bw_outbound_low;
27+
u32 pci_bw_stale_event;
2728
};
2829

2930
struct mlx5e_pcie_cong_event {
@@ -52,6 +53,8 @@ static const struct counter_desc mlx5e_pcie_cong_stats_desc[] = {
5253
pci_bw_outbound_high) },
5354
{ MLX5E_DECLARE_STAT(struct mlx5e_pcie_cong_stats,
5455
pci_bw_outbound_low) },
56+
{ MLX5E_DECLARE_STAT(struct mlx5e_pcie_cong_stats,
57+
pci_bw_stale_event) },
5558
};
5659

5760
#define NUM_PCIE_CONG_COUNTERS ARRAY_SIZE(mlx5e_pcie_cong_stats_desc)
@@ -212,8 +215,10 @@ static void mlx5e_pcie_cong_event_work(struct work_struct *work)
212215
}
213216

214217
changes = cong_event->state ^ new_cong_state;
215-
if (!changes)
218+
if (!changes) {
219+
cong_event->stats.pci_bw_stale_event++;
216220
return;
221+
}
217222

218223
cong_event->state = new_cong_state;
219224

0 commit comments

Comments
 (0)