netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/9] mlxsw: Add PTP support for Spectrum-2 and newer ASICs
@ 2022-07-27  6:23 Ido Schimmel
  2022-07-27  6:23 ` [PATCH net-next 1/9] mlxsw: spectrum_ptp: Add helper functions to configure PTP traps Ido Schimmel
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Ido Schimmel @ 2022-07-27  6:23 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, pabeni, edumazet, richardcochran, petrm, amcohen,
	danieller, mlxsw, Ido Schimmel

This patchset adds PTP support for Spectrum-{2,3,4} switch ASICs. They
all act largely the same with respect to PTP except for a workaround
implemented for Spectrum-{2,3} in patch #6.

Spectrum-2 and newer ASICs essentially implement a transparent clock
between all the switch ports, including the CPU port. The hardware will
generate the UTC time stamp for transmitted / received packets at the
CPU port, but will compensate for forwarding delays in the ASIC by
adjusting the correction field in the PTP header (for PTP events) at the
ingress and egress ports.

Specifically, the hardware will subtract the current time stamp from the
correction field at the ingress port and will add the current time stamp
to the correction field at the egress port. For the purpose of an
ordinary or boundary clock (this patchset), the correction field will
always be adjusted between the CPU port and one of the front panel
ports, but never between two front panel ports.

Patchset overview:

Patch #1 extracts a helper to configure traps for PTP packets (event and
general messages). The helper is shared between all Spectrum
generations.

Patch #2 transitions Spectrum-2 and newer ASICs to use a different
format of Tx completions that includes the UTC time stamp of transmitted
packets.

Patch #3 adds basic initialization required for Spectrum-2 PTP support.
It mainly invokes the helper from patch #1.

Patch #4 adds helpers to read the UTC time (seconds and nanoseconds)
from the device over memory-mapped I/O instead of going through firmware
which is slower and therefore inaccurate. The helpers will be used to
implement various PHC operations (e.g., gettimex64) and to construct the
full UTC time stamp from the truncated one reported over Tx / Rx
completions.

Patch #5 implements the various PHC operations.

Patch #6 implements the previously described workaround for
Spectrum-{2,3}.

Patch #7 adds the ability to report a hardware time stamp for a received
/ transmitted packet based off the associated Rx / Tx completion that
includes a truncated UTC time stamp.

Patches #8 and #9 implement support for the SIOCGHWTSTAMP /
SIOCSHWTSTAMP ioctls and the get_ts_info ethtool callback, respectively.

Amit Cohen (1):
  mlxsw: spectrum_ptp: Add helper functions to configure PTP traps

Danielle Ratson (8):
  mlxsw: Support CQEv2 for SDQ in Spectrum-2 and newer ASICs
  mlxsw: spectrum_ptp: Add PTP initialization / finalization for
    Spectrum-2
  mlxsw: Query UTC sec and nsec PCI offsets and values
  mlxsw: spectrum_ptp: Add implementation for physical hardware clock
    operations
  mlxsw: Send PTP packets as data packets to overcome a limitation
  mlxsw: spectrum: Support time stamping on Spectrum-2
  mlxsw: spectrum_ptp: Support SIOCGHWTSTAMP, SIOCSHWTSTAMP ioctls
  mlxsw: spectrum: Support ethtool 'get_ts_info' callback in Spectrum-2

 drivers/net/ethernet/mellanox/mlxsw/core.c    |  18 +
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  14 +
 drivers/net/ethernet/mellanox/mlxsw/pci.c     |  64 +-
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 118 +++-
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  10 +
 .../ethernet/mellanox/mlxsw/spectrum_ptp.c    | 576 +++++++++++++++++-
 .../ethernet/mellanox/mlxsw/spectrum_ptp.h    |  60 +-
 7 files changed, 820 insertions(+), 40 deletions(-)

-- 
2.36.1


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

end of thread, other threads:[~2022-07-29 10:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27  6:23 [PATCH net-next 0/9] mlxsw: Add PTP support for Spectrum-2 and newer ASICs Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 1/9] mlxsw: spectrum_ptp: Add helper functions to configure PTP traps Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 2/9] mlxsw: Support CQEv2 for SDQ in Spectrum-2 and newer ASICs Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 3/9] mlxsw: spectrum_ptp: Add PTP initialization / finalization for Spectrum-2 Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 4/9] mlxsw: Query UTC sec and nsec PCI offsets and values Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 5/9] mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 6/9] mlxsw: Send PTP packets as data packets to overcome a limitation Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 7/9] mlxsw: spectrum: Support time stamping on Spectrum-2 Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 8/9] mlxsw: spectrum_ptp: Support SIOCGHWTSTAMP, SIOCSHWTSTAMP ioctls Ido Schimmel
2022-07-27  6:23 ` [PATCH net-next 9/9] mlxsw: spectrum: Support ethtool 'get_ts_info' callback in Spectrum-2 Ido Schimmel
2022-07-27 14:05 ` [PATCH net-next 0/9] mlxsw: Add PTP support for Spectrum-2 and newer ASICs Richard Cochran
2022-07-27 14:48   ` Ido Schimmel
2022-07-27 14:16 ` Richard Cochran
2022-07-27 14:44   ` Ido Schimmel
2022-07-28  3:09     ` Richard Cochran
2022-07-28  7:03       ` Ido Schimmel
2022-07-29 10:30 ` patchwork-bot+netdevbpf

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