Skip to content

Commit adda540

Browse files
Binary-Eaterkuba-moo
authored andcommitted
net/mlx5e: Introduce lost_cqe statistic counter for PTP Tx port timestamping CQ
Track the number of times a CQE was expected to not be delivered on PTP Tx port timestamping CQ. A CQE is expected to not be delivered if a certain amount of time passes since the corresponding CQE containing the DMA timestamp information has arrived. Increment the late_cqe counter when such a CQE does manage to be delivered to the CQ. Signed-off-by: Rahul Rameshbabu <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0e9c127 commit adda540

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,12 @@ the software port.
702702
the device typically ensures not posting the CQE.
703703
- Error
704704

705+
* - `ptp_cq[i]_lost_cqe`
706+
- Number of times a CQE is expected to not be delivered on the PTP
707+
timestamping CQE by the device due to a time delta elapsing. If such a
708+
CQE is somehow delivered, `ptp_cq[i]_late_cqe` is incremented.
709+
- Error
710+
705711
.. [#ring_global] The corresponding ring and global counters do not share the
706712
same name (i.e. do not follow the common naming scheme).
707713

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ static void mlx5e_ptpsq_mark_ts_cqes_undelivered(struct mlx5e_ptpsq *ptpsq,
169169
WARN_ON_ONCE(!pos->inuse);
170170
pos->inuse = false;
171171
list_del(&pos->entry);
172+
ptpsq->cq_stats->lost_cqe++;
172173
}
173174
spin_unlock_bh(&cqe_list->tracker_list_lock);
174175
}

drivers/net/ethernet/mellanox/mlx5/core/en_stats.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,7 @@ static const struct counter_desc ptp_cq_stats_desc[] = {
21782178
{ MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, abort) },
21792179
{ MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, abort_abs_diff_ns) },
21802180
{ MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, late_cqe) },
2181+
{ MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, lost_cqe) },
21812182
};
21822183

21832184
static const struct counter_desc ptp_rq_stats_desc[] = {

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ struct mlx5e_ptp_cq_stats {
463463
u64 abort;
464464
u64 abort_abs_diff_ns;
465465
u64 late_cqe;
466+
u64 lost_cqe;
466467
};
467468

468469
struct mlx5e_rep_stats {

0 commit comments

Comments
 (0)