netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next 00/17] PTP support for the SJA1105 DSA driver
@ 2019-06-04 17:07 Vladimir Oltean
  2019-06-04 17:07 ` [PATCH v3 net-next 01/17] net: dsa: Keep a pointer to the skb clone for TX timestamping Vladimir Oltean
                   ` (17 more replies)
  0 siblings, 18 replies; 40+ messages in thread
From: Vladimir Oltean @ 2019-06-04 17:07 UTC (permalink / raw)
  To: f.fainelli, vivien.didelot, andrew, davem, richardcochran,
	john.stultz, tglx, sboyd
  Cc: linux-kernel, netdev, Vladimir Oltean

This patchset adds the following:

 - A timecounter/cyclecounter based PHC for the free-running
   timestamping clock of this switch.

 - A state machine implemented in the DSA tagger for SJA1105, which
   keeps track of metadata follow-up Ethernet frames (the switch's way
   of transmitting RX timestamps).

Clock manipulations on the actual hardware PTP clock will have to be
implemented anyway, for the TTEthernet block and the time-based ingress
policer.

This depends upon the "FDB updates for SJA1105 DSA driver" series at:
https://patchwork.ozlabs.org/project/netdev/list/?series=111354&state=*

v2 patchset can be found at:
https://lkml.org/lkml/2019/6/2/146

Changes from v2:

- Broke previous 09/10 patch (timestamping) into multiple smaller
  patches.

- Every patch in the series compiles.

v1 patchset can be found at:
https://lkml.org/lkml/2019/5/28/1093

Changes from v1:

- Removed the addition of the DSA .can_timestamp callback.

- Waiting for meta frames is done completely inside the tagger, and all
  frames emitted on RX are already partially timestamped.

- Added a global data structure for the tagger common to all ports.

- Made PTP work with ports in standalone mode, by limiting use of the
  DMAC-mangling "incl_srcpt" mode only when ports are bridged, aka when
  the DSA master is already promiscuous and can receive anything.
  Also changed meta frames to be sent at the 01-80-C2-00-00-0E DMAC.

- Made some progress w.r.t. observed negative path delay.  Apparently it
  only appears when the delay mechanism is the delay request-response
  (end-to-end) one. If peer delay is used (-P), the path delay is
  positive and appears reasonable for an 1000Base-T link (485 ns in
  steady state).

  SJA1105 as PTP slave (OC) with E2E path delay:

ptp4l[55.600]: master offset          8 s2 freq  +83677 path delay     -2390
ptp4l[56.600]: master offset         17 s2 freq  +83688 path delay     -2391
ptp4l[57.601]: master offset          6 s2 freq  +83682 path delay     -2391
ptp4l[58.601]: master offset         -1 s2 freq  +83677 path delay     -2391

  SJA1105 as PTP slave (OC) with P2P path delay:

ptp4l[48.343]: master offset          5 s2 freq  +83715 path delay       484
ptp4l[48.468]: master offset         -3 s2 freq  +83705 path delay       485
ptp4l[48.593]: master offset          0 s2 freq  +83708 path delay       485
ptp4l[48.718]: master offset          1 s2 freq  +83710 path delay       485
ptp4l[48.844]: master offset          1 s2 freq  +83710 path delay       485
ptp4l[48.969]: master offset         -5 s2 freq  +83702 path delay       485
ptp4l[49.094]: master offset          3 s2 freq  +83712 path delay       485
ptp4l[49.219]: master offset          4 s2 freq  +83714 path delay       485
ptp4l[49.344]: master offset         -5 s2 freq  +83702 path delay       485
ptp4l[49.469]: master offset          3 s2 freq  +83713 path delay       487

Vladimir Oltean (17):
  net: dsa: Keep a pointer to the skb clone for TX timestamping
  net: dsa: Add teardown callback for drivers
  net: dsa: tag_8021q: Create helper function for removing VLAN header
  net: dsa: sja1105: Move sja1105_change_tpid into
    sja1105_vlan_filtering
  net: dsa: sja1105: Reverse TPID and TPID2
  net: dsa: sja1105: Limit use of incl_srcpt to bridge+vlan mode
  net: dsa: sja1105: Add support for the PTP clock
  net: dsa: sja1105: Move sja1105_is_link_local to include/linux
  net: dsa: sja1105: Add logic for TX timestamping
  net: dsa: sja1105: Build a minimal understanding of meta frames
  net: dsa: sja1105: Add support for the AVB Parameters Table
  net: dsa: sja1105: Make sja1105_is_link_local not match meta frames
  net: dsa: sja1105: Receive and decode meta frames
  net: dsa: sja1105: Add a global sja1105_tagger_data structure
  net: dsa: sja1105: Increase priority of CPU-trapped frames
  net: dsa: sja1105: Add a state machine for RX timestamping
  net: dsa: sja1105: Expose PTP timestamping ioctls to userspace

 drivers/net/dsa/sja1105/Kconfig               |   7 +
 drivers/net/dsa/sja1105/Makefile              |   1 +
 drivers/net/dsa/sja1105/sja1105.h             |  29 ++
 .../net/dsa/sja1105/sja1105_dynamic_config.c  |   2 +
 drivers/net/dsa/sja1105/sja1105_main.c        | 319 ++++++++++++--
 drivers/net/dsa/sja1105/sja1105_ptp.c         | 392 ++++++++++++++++++
 drivers/net/dsa/sja1105/sja1105_ptp.h         |  64 +++
 drivers/net/dsa/sja1105/sja1105_spi.c         |  33 ++
 .../net/dsa/sja1105/sja1105_static_config.c   |  59 +++
 .../net/dsa/sja1105/sja1105_static_config.h   |  10 +
 include/linux/dsa/8021q.h                     |   7 +
 include/linux/dsa/sja1105.h                   |  51 +++
 include/net/dsa.h                             |   1 +
 net/dsa/dsa2.c                                |   3 +
 net/dsa/slave.c                               |   3 +
 net/dsa/tag_8021q.c                           |  15 +
 net/dsa/tag_sja1105.c                         | 203 ++++++++-
 17 files changed, 1152 insertions(+), 47 deletions(-)
 create mode 100644 drivers/net/dsa/sja1105/sja1105_ptp.c
 create mode 100644 drivers/net/dsa/sja1105/sja1105_ptp.h

-- 
2.17.1


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

end of thread, other threads:[~2019-06-07 19:38 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-04 17:07 [PATCH v3 net-next 00/17] PTP support for the SJA1105 DSA driver Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 01/17] net: dsa: Keep a pointer to the skb clone for TX timestamping Vladimir Oltean
2019-06-04 20:31   ` Florian Fainelli
2019-06-04 17:07 ` [PATCH v3 net-next 02/17] net: dsa: Add teardown callback for drivers Vladimir Oltean
2019-06-04 18:15   ` Andrew Lunn
2019-06-04 20:32   ` Florian Fainelli
2019-06-04 17:07 ` [PATCH v3 net-next 03/17] net: dsa: tag_8021q: Create helper function for removing VLAN header Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 04/17] net: dsa: sja1105: Move sja1105_change_tpid into sja1105_vlan_filtering Vladimir Oltean
2019-06-04 20:58   ` Florian Fainelli
2019-06-04 17:07 ` [PATCH v3 net-next 05/17] net: dsa: sja1105: Reverse TPID and TPID2 Vladimir Oltean
2019-06-04 20:33   ` Florian Fainelli
2019-06-04 17:07 ` [PATCH v3 net-next 06/17] net: dsa: sja1105: Limit use of incl_srcpt to bridge+vlan mode Vladimir Oltean
2019-06-04 20:35   ` Florian Fainelli
2019-06-04 17:07 ` [PATCH v3 net-next 07/17] net: dsa: sja1105: Add support for the PTP clock Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 08/17] net: dsa: sja1105: Move sja1105_is_link_local to include/linux Vladimir Oltean
2019-06-04 20:35   ` Florian Fainelli
2019-06-04 17:07 ` [PATCH v3 net-next 09/17] net: dsa: sja1105: Add logic for TX timestamping Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 10/17] net: dsa: sja1105: Build a minimal understanding of meta frames Vladimir Oltean
2019-06-04 21:00   ` Florian Fainelli
2019-06-04 17:07 ` [PATCH v3 net-next 11/17] net: dsa: sja1105: Add support for the AVB Parameters Table Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 12/17] net: dsa: sja1105: Make sja1105_is_link_local not match meta frames Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 13/17] net: dsa: sja1105: Receive and decode " Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 14/17] net: dsa: sja1105: Add a global sja1105_tagger_data structure Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 15/17] net: dsa: sja1105: Increase priority of CPU-trapped frames Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 16/17] net: dsa: sja1105: Add a state machine for RX timestamping Vladimir Oltean
2019-06-04 17:07 ` [PATCH v3 net-next 17/17] net: dsa: sja1105: Expose PTP timestamping ioctls to userspace Vladimir Oltean
2019-06-05  3:22 ` [PATCH v3 net-next 00/17] PTP support for the SJA1105 DSA driver David Miller
2019-06-05  9:13   ` Vladimir Oltean
2019-06-05 11:33     ` Vladimir Oltean
2019-06-05 17:45       ` Richard Cochran
2019-06-05 17:50         ` Vladimir Oltean
2019-06-05 17:52           ` Vladimir Oltean
2019-06-05 18:08         ` Vladimir Oltean
2019-06-06  3:11           ` Richard Cochran
2019-06-06 13:40             ` Vladimir Oltean
2019-06-07  3:32               ` Richard Cochran
2019-06-07  9:43                 ` Vladimir Oltean
2019-06-05 18:44     ` David Miller
2019-06-07 19:15       ` David Miller
2019-06-07 19:38         ` Vladimir Oltean

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