netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/8] More accurate PHC<->system clock synchronization
@ 2018-11-09 10:14 Miroslav Lichvar
  2018-11-09 10:14 ` [PATCH net-next 1/8] ptp: reorder declarations in ptp_ioctl() Miroslav Lichvar
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Miroslav Lichvar @ 2018-11-09 10:14 UTC (permalink / raw)
  To: netdev
  Cc: Richard Cochran, Jacob Keller, Miroslav Lichvar, Marcelo Tosatti,
	Jeff Kirsher, Michael Chan

RFC->v1:
- added new patches
- separated PHC timestamp from ptp_system_timestamp
- fixed memory leak in PTP_SYS_OFFSET_EXTENDED
- changed PTP_SYS_OFFSET_EXTENDED to work with array of arrays
- fixed PTP_SYS_OFFSET_EXTENDED to break correctly from loop
- fixed timecounter updates in drivers
- split gettimex in igb driver
- fixed ptp_read_* functions to be available without
  CONFIG_PTP_1588_CLOCK

This series enables a more accurate synchronization between PTP hardware
clocks and the system clock.

The first two patches are minor cleanup/bug fixes.

The third patch adds an extended version of the PTP_SYS_OFFSET ioctl,
which returns three timestamps for each measurement. The idea is to
shorten the interval between the system timestamps to contain just the
reading of the lowest register of the PHC in order to reduce the error
in the measured offset and get a smaller upper bound on the maximum
error.

The fourth patch deprecates the original gettime function.

The remaining patches update the gettime function in order to support
the new ioctl in the e1000e, igb, ixgbe, and tg3 drivers.

Tests with few different NICs in different machines show that:
- with an I219 (e1000e) the measured delay was reduced from 2500 to 1300
  ns and the error in the measured offset, when compared to the cross
  timestamping supported by the driver, was reduced by a factor of 5
- with an I210 (igb) the delay was reduced from 5100 to 1700 ns
- with an I350 (igb) the delay was reduced from 2300 to 750 ns
- with an X550 (ixgbe) the delay was reduced from 1950 to 650 ns
- with a BCM5720 (tg3) the delay was reduced from 2400 to 1200 ns


Miroslav Lichvar (8):
  ptp: reorder declarations in ptp_ioctl()
  ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl
  ptp: add PTP_SYS_OFFSET_EXTENDED ioctl
  ptp: deprecate gettime64() in favor of gettimex64()
  e1000e: extend PTP gettime function to read system clock
  igb: extend PTP gettime function to read system clock
  ixgbe: extend PTP gettime function to read system clock
  tg3: extend PTP gettime function to read system clock

 drivers/net/ethernet/broadcom/tg3.c          | 19 ++++--
 drivers/net/ethernet/intel/e1000e/e1000.h    |  3 +
 drivers/net/ethernet/intel/e1000e/netdev.c   | 42 ++++++++++---
 drivers/net/ethernet/intel/e1000e/ptp.c      | 16 +++--
 drivers/net/ethernet/intel/igb/igb_ptp.c     | 65 +++++++++++++++++---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 54 +++++++++++++---
 drivers/ptp/ptp_chardev.c                    | 55 ++++++++++++++---
 drivers/ptp/ptp_clock.c                      |  5 +-
 include/linux/ptp_clock_kernel.h             | 33 ++++++++++
 include/uapi/linux/ptp_clock.h               | 12 ++++
 10 files changed, 253 insertions(+), 51 deletions(-)

-- 
2.17.2

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

end of thread, other threads:[~2019-01-08 20:45 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-09 10:14 [PATCH net-next 0/8] More accurate PHC<->system clock synchronization Miroslav Lichvar
2018-11-09 10:14 ` [PATCH net-next 1/8] ptp: reorder declarations in ptp_ioctl() Miroslav Lichvar
2018-11-09 10:14 ` [PATCH net-next 2/8] ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl Miroslav Lichvar
2018-11-09 10:14 ` [PATCH net-next 3/8] ptp: add PTP_SYS_OFFSET_EXTENDED ioctl Miroslav Lichvar
2019-01-07 15:22   ` [PATCH net 1/2] ptp: check that rsv field is zero in struct ptp_sys_offset_extended Eugene Syromiatnikov
2019-01-07 16:29     ` David Miller
2019-01-07 16:57       ` Miroslav Lichvar
2019-01-07 17:13         ` David Miller
2019-01-08  5:19       ` Richard Cochran
2019-01-08 14:38         ` Eugene Syromiatnikov
2019-01-08 20:45           ` Keller, Jacob E
2019-01-07 15:22   ` [PATCH net 2/2] ptp: uapi: change _IOW to IOWR in PTP_SYS_OFFSET_EXTENDED definition Eugene Syromiatnikov
2019-01-07 16:29     ` David Miller
2018-11-09 10:14 ` [PATCH net-next 4/8] ptp: deprecate gettime64() in favor of gettimex64() Miroslav Lichvar
2018-11-09 10:14 ` [PATCH net-next 5/8] e1000e: extend PTP gettime function to read system clock Miroslav Lichvar
2018-11-10  1:53   ` Jeff Kirsher
2018-11-09 10:14 ` [PATCH net-next 6/8] igb: " Miroslav Lichvar
2018-11-10  1:53   ` Jeff Kirsher
2018-11-09 10:14 ` [PATCH net-next 7/8] ixgbe: " Miroslav Lichvar
2018-11-09 18:14   ` Keller, Jacob E
2018-11-10  1:52   ` Jeff Kirsher
2018-11-09 10:14 ` [PATCH net-next 8/8] tg3: " Miroslav Lichvar
2018-11-09 18:12 ` [PATCH net-next 0/8] More accurate PHC<->system clock synchronization Keller, Jacob E
2018-11-09 23:28 ` David Miller
2018-11-09 23:33   ` Jeff Kirsher
2018-11-10  0:55     ` David Miller
2018-11-10  1:44   ` Richard Cochran
2018-11-10  3:44     ` David Miller

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).