netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] ptp: Introduce .getfine callback to ptp_clock_info
@ 2022-12-02 20:15 Rahul Rameshbabu
  2022-12-02 20:15 ` [PATCH net-next 1/2] ptp: Add .getfine function to support reporting frequency offset from hardware Rahul Rameshbabu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rahul Rameshbabu @ 2022-12-02 20:15 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Rahul Rameshbabu,
	Jacob Keller, Aya Levin, Gal Pressman
  Cc: netdev

The current state of the ptp driver provides the ability to query the frequency
of the ptp clock device by caching the frequency values used in previous
adjustments done through the ptp driver. This works great when the ptp driver is
the only means for changing the clock frequency. However, some devices support
ways to adjust the frequency outside the ptp driver stack. When this occurs, the
ptp cached value is inaccurate. Also, if the device for some reason does not
start with a frequency of zero, the initial frequency queried before the first
frequency adjustment would be inaccurate.

The changes proposed enable a callback that various drivers can implement to
provide the frequency, in units of scaled ppm, of the ptp clock. When the
callback is implemented, it will be called to provide the frequency value
instead of the cached dialed_frequency value.

There are cases in linuxptp usage where the caching of the frequency has proven
to be inadequate. One example was the case where concurrent ptp4l processes
adjust frequency, but the cached frequency values in the ptp4l processes are
stale. Permitting implementers the ability to provide the frequency would
resolve issues involving stale frequency values due to changes occurring outside
the ptp driver stack.

https://sourceforge.net/p/linuxptp/mailman/message/37720193/

Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>

Rahul Rameshbabu (2):
  ptp: Add .getfine function to support reporting frequency offset from
    hardware
  net/mlx5: Implement ptp_clock_info .getfine function

 .../ethernet/mellanox/mlx5/core/lib/clock.c   | 35 +++++++++++++++++++
 drivers/ptp/ptp_clock.c                       | 18 +++++++++-
 include/linux/ptp_clock_kernel.h              |  6 ++++
 3 files changed, 58 insertions(+), 1 deletion(-)

-- 
2.36.2


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

end of thread, other threads:[~2022-12-03 11:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-02 20:15 [PATCH net-next 0/2] ptp: Introduce .getfine callback to ptp_clock_info Rahul Rameshbabu
2022-12-02 20:15 ` [PATCH net-next 1/2] ptp: Add .getfine function to support reporting frequency offset from hardware Rahul Rameshbabu
2022-12-02 20:15 ` [PATCH net-next 2/2] net/mlx5: Implement ptp_clock_info .getfine function Rahul Rameshbabu
2022-12-03 10:06   ` kernel test robot
2022-12-03 11:06   ` kernel test robot
2022-12-02 20:45 ` [PATCH net-next 0/2] ptp: Introduce .getfine callback to ptp_clock_info Richard Cochran
2022-12-02 22:11   ` Jacob Keller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).