netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: netdev@vger.kernel.org
Cc: intel-wired-lan@lists.osuosl.org,
	Richard Cochran <richardcochran@gmail.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Miroslav Lichvar <mlichvar@redhat.com>
Subject: [RFC PATCH 0/4] More accurate PHC<->system clock synchronization
Date: Fri, 26 Oct 2018 18:27:38 +0200	[thread overview]
Message-ID: <20181026162742.631-1-mlichvar@redhat.com> (raw)

This series adds support for a more accurate synchronization between a
PTP hardware clock and the system clock.

The first 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 give a better bound on the maximum error.

The other patches add support for the new ioctl to the e1000e, igb,
and ixgbe driver. Tests with few different NICs in different machines
(and PCIe slots) show that:
- with an I219 (e1000e) the measured delay improved from 2500 to 1300 ns
  and the error in the measured offset, when compared to cross
  timestamping, was reduced by a factor of 5
- with an I210 (igb) the delay improved from 5100 to 1700 ns
- with an I350 (igb) the delay improved from 2300 to 750 ns
- with an X550 (ixgbe) the delay improved from 1950 to 650 ns

There is some duplication of code in the igb and ixgbe drivers, which I
don't like very much, but I thought it's better than extending and
wrapping the existing functions like in the e1000e driver. Also, mixing
SYSTIM and "system time" in the code will probably be confusing.

I wasn't able to find a better name for the ioctl, the structures, and
the driver function. If anyone has suggestions, please let me know.

Miroslav Lichvar (4):
  ptp: add PTP_SYS_OFFSET_EXTENDED ioctl
  e1000e: add support for extended PHC gettime
  igb: add support for extended PHC gettime
  ixgbe: add support for extended PHC gettime

 drivers/net/ethernet/intel/e1000e/e1000.h    |  3 ++
 drivers/net/ethernet/intel/e1000e/netdev.c   | 48 +++++++++++++----
 drivers/net/ethernet/intel/e1000e/ptp.c      | 21 ++++++++
 drivers/net/ethernet/intel/igb/igb_ptp.c     | 43 +++++++++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 57 ++++++++++++++++++++
 drivers/ptp/ptp_chardev.c                    | 39 ++++++++++++++
 include/linux/ptp_clock_kernel.h             | 26 +++++++++
 include/uapi/linux/ptp_clock.h               | 12 +++++
 8 files changed, 239 insertions(+), 10 deletions(-)

-- 
2.17.2

             reply	other threads:[~2018-10-27  1:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 16:27 Miroslav Lichvar [this message]
2018-10-26 16:27 ` [RFC PATCH 1/4] ptp: add PTP_SYS_OFFSET_EXTENDED ioctl Miroslav Lichvar
2018-10-26 22:16   ` [Intel-wired-lan] " Vinicius Costa Gomes
2018-10-29 12:52     ` Miroslav Lichvar
2018-10-31  2:23   ` Richard Cochran
2018-10-31  3:01     ` Richard Cochran
2018-10-26 16:27 ` [RFC PATCH 2/4] e1000e: add support for extended PHC gettime Miroslav Lichvar
2018-10-26 16:27 ` [RFC PATCH 3/4] igb: " Miroslav Lichvar
2018-10-31  2:29   ` Richard Cochran
2018-10-31  9:39     ` Miroslav Lichvar
2018-10-31 16:56       ` Keller, Jacob E
2018-10-26 16:27 ` [RFC PATCH 4/4] ixgbe: " Miroslav Lichvar
2018-10-26 16:54   ` Keller, Jacob E
2018-10-29 13:31     ` Miroslav Lichvar
2018-10-29 16:02       ` Keller, Jacob E
2018-10-31 14:40       ` Richard Cochran
2018-10-31 14:49         ` Miroslav Lichvar
2018-10-31 21:16           ` Richard Cochran
2018-10-31 22:08             ` Keller, Jacob E
2018-10-31 16:55         ` Keller, Jacob E
2018-10-26 16:40 ` [RFC PATCH 0/4] More accurate PHC<->system clock synchronization Keller, Jacob E
2018-10-26 16:51 ` Keller, Jacob E
2018-10-31  2:25 ` Richard Cochran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181026162742.631-1-mlichvar@redhat.com \
    --to=mlichvar@redhat.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).