]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5e: Recover SQ on excessive PTP TX timestamp delta
authorCarolina Jubran <cjubran@nvidia.com>
Mon, 17 Nov 2025 21:42:06 +0000 (23:42 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 19 Nov 2025 02:53:33 +0000 (18:53 -0800)
commit391dad2e686f214932f769847cc8603a7df389eb
treee4900635c299d595141d34b1462b6168852ec967
parent2e4c44b12f4da60d3e8dcbc1ccf38bb28a878050
net/mlx5e: Recover SQ on excessive PTP TX timestamp delta

Extend the TX timestamp handler to recover the SQ when the difference
between the port and CQE TX timestamps is abnormally large.

The current logic aborts timestamp delivery if the delta exceeds
1/128 seconds, which matches the maximum expected packet interval in
ptp4l. A larger delta makes the timestamps unreliable.

This change adds recovery if the delta exceeds 0.5 seconds. Such a
large gap should not occur in normal operation and indicates that
firmware is stuck or metadata tracking is out of sync, leading to stale
or mismatched timestamps. Recovering the SQ ensures forward progress
and avoids silently dropping invalid timestamps.

The timestamp handler now takes mlx5e_ptpsq directly to access both CQ
stats and the recovery state.

Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1763415729-1238421-3-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.h
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c