All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling
@ 2026-10-15  7:40 Tariq Toukan
  2026-10-15  7:43 ` netdev-bot+sinfo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tariq Toukan @ 2026-10-15  7:40 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni
  Cc: Arkadiusz Kubalewski, Carolina Jubran, Gal Pressman, Jiri Pirko,
	Jiri Pirko, Leon Romanovsky, open list, linux-rdma, Mark Bloch,
	Saeed Mahameed, Tariq Toukan, Vadim Fedorenko

From: Carolina Jubran <cjubran@nvidia.com>

The frequency_diff is reported by firmware in parts-per-trillion, which
is exactly what the DPLL core now expects from the ffo_get callback.

Commit bc443c253fcd ("dpll: expose fractional frequency offset in ppt")
switched the callback contract to ppt but assumed frequency_diff was in
ppm and scaled it by 1000000 to "convert" it. Since the value was
already ppt, this makes both exported attributes wrong.

Report frequency_diff as is and let the core divide it down for the
legacy ppm attribute.

Fixes: f035dca34ede ("net/mlx5: DPLL, Implement fractional frequency offset get pin op")
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/dpll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
index 7c69d9029bfa..54ba7c330d66 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
@@ -138,7 +138,7 @@ mlx5_dpll_pin_ffo_get(struct mlx5_dpll_synce_status *synce_status,
 {
 	if (!synce_status->oper_freq_measure)
 		return -ENODATA;
-	*ffo = 1000000LL * synce_status->frequency_diff;
+	*ffo = synce_status->frequency_diff;
 	return 0;
 }
 

base-commit: af32da41b0327b9c6a37856ba82b6760d6c8d10e
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling
  2026-10-15  7:40 [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling Tariq Toukan
@ 2026-10-15  7:43 ` netdev-bot+sinfo
  2026-10-15  9:28   ` Carolina Jubran
  2026-10-15  7:46 ` sashiko-bot
  2026-10-15 10:49 ` Daniel Machon
  2 siblings, 1 reply; 5+ messages in thread
From: netdev-bot+sinfo @ 2026-10-15  7:43 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni, Arkadiusz Kubalewski, Carolina Jubran,
	Gal Pressman, Jiri Pirko, Jiri Pirko, Leon Romanovsky, open list,
	linux-rdma, Mark Bloch, Saeed Mahameed, Vadim Fedorenko

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by code inspection). If it was triggered please include
   the symptoms, like the stack trace or error messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling
  2026-10-15  7:40 [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling Tariq Toukan
  2026-10-15  7:43 ` netdev-bot+sinfo
@ 2026-10-15  7:46 ` sashiko-bot
  2026-10-15 10:49 ` Daniel Machon
  2 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-10-15  7:46 UTC (permalink / raw)
  To: Tariq Toukan; +Cc: linux-rdma

> From: Carolina Jubran <cjubran@nvidia.com>
> 
> The frequency_diff is reported by firmware in parts-per-trillion, which
> is exactly what the DPLL core now expects from the ffo_get callback.
> 
> Commit bc443c253fcd ("dpll: expose fractional frequency offset in ppt")
> switched the callback contract to ppt but assumed frequency_diff was in
> ppm and scaled it by 1000000 to "convert" it. Since the value was
> already ppt, this makes both exported attributes wrong.
> 
> Report frequency_diff as is and let the core divide it down for the
> legacy ppm attribute.
> 
> Fixes: f035dca34ede ("net/mlx5: DPLL, Implement fractional frequency offset get pin op")
> Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261015074035.1092340-1-tariqt@nvidia.com?part=1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling
  2026-10-15  7:43 ` netdev-bot+sinfo
@ 2026-10-15  9:28   ` Carolina Jubran
  0 siblings, 0 replies; 5+ messages in thread
From: Carolina Jubran @ 2026-10-15  9:28 UTC (permalink / raw)
  To: netdev-bot+sinfo, Tariq Toukan
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni, Arkadiusz Kubalewski, Gal Pressman,
	Jiri Pirko, Jiri Pirko, Leon Romanovsky, open list, linux-rdma,
	Mark Bloch, Saeed Mahameed, Vadim Fedorenko


On 15/10/2026 10:43, netdev-bot+sinfo@kernel.org wrote:
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
>   - How the issue was discovered, e.g. hit in production, hit during
>     development, syzbot report, manual code inspection, LLM or static
>     analysis tool scan.
>
>   - Whether the issue was actually triggered, or is only theoretical
>     (e.g. found by code inspection). If it was triggered please include
>     the symptoms, like the stack trace or error messages.
>
>   - What hardware the change was tested on. For driver fixes please
>     mention the device (and if relevant firmware version) used for
>     testing, or say that the change was not tested on real hardware.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account. If the series needs another revision for
> other reasons, please include the information in the commit messages
> then.
>
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.


Hi,

The issue was found while testing the latest mlx5 driver on an older
kernel that does not support
DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET_PPT.

There was no crash or kernel warning. Just that the legacy
DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET attribute reported an incorrect
FFO value.

The mlx5 firmware reports frequency_diff in ppt. Although the legacy
attribute is documented in ppm, our userspace application has always
expected the value exported by mlx5 to be in ppt.

On newer kernels, the driver multiplies the firmware value by 1,000,000
to account for the corresponding division performed by the DPLL core
when exporting the legacy attribute. Older kernels do not perform this
division and expose the scaled value directly, resulting in an FFO value
1,000,000 times too large.

The change was tested on CX6Dx, and the reported FFO value was verified
through both the DPLL netlink interface and our userspace application.

Thanks,
Carolina


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling
  2026-10-15  7:40 [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling Tariq Toukan
  2026-10-15  7:43 ` netdev-bot+sinfo
  2026-10-15  7:46 ` sashiko-bot
@ 2026-10-15 10:49 ` Daniel Machon
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel Machon @ 2026-10-15 10:49 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	netdev, Paolo Abeni, Arkadiusz Kubalewski, Carolina Jubran,
	Gal Pressman, Jiri Pirko, Jiri Pirko, Leon Romanovsky, open list,
	linux-rdma, Mark Bloch, Saeed Mahameed, Vadim Fedorenko

> From: Carolina Jubran <cjubran@nvidia.com>
> 
> The frequency_diff is reported by firmware in parts-per-trillion, which
> is exactly what the DPLL core now expects from the ffo_get callback.
> 
> Commit bc443c253fcd ("dpll: expose fractional frequency offset in ppt")
> switched the callback contract to ppt but assumed frequency_diff was in
> ppm and scaled it by 1000000 to "convert" it. Since the value was
> already ppt, this makes both exported attributes wrong.
> 
> Report frequency_diff as is and let the core divide it down for the
> legacy ppm attribute.

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-15 10:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15  7:40 [PATCH net] net/mlx5: DPLL, fix fractional frequency offset scaling Tariq Toukan
2026-10-15  7:43 ` netdev-bot+sinfo
2026-10-15  9:28   ` Carolina Jubran
2026-10-15  7:46 ` sashiko-bot
2026-10-15 10:49 ` Daniel Machon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.