mlxsw: Add PTP support for Spectrum-2 and newer ASICs
Status from this message: This series was applied to netdev/net-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 9 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | mlxsw: spectrum_ptp: Add helper functions to configure PTP trapsdrivers/ | +40 | 0 replies | Applied |
| 2/9 | mlxsw: Support CQEv2 for SDQ in Spectrum-2 and newer ASICsdrivers/ drivers/ drivers/ +1 more | +15 | 0 replies | Applied |
| 3/9 | mlxsw: spectrum_ptp: Add PTP initialization / finalization for Spectrum-2drivers/ drivers/ | +54 | 0 replies | Applied |
| 4/9 | mlxsw: Query UTC sec and nsec PCI offsets and valuesdrivers/ drivers/ drivers/ | +55 | 0 replies | Applied |
| 5/9 | mlxsw: spectrum_ptp: Add implementation for physical hardware clock operationsdrivers/ drivers/ | +159 | 0 replies | Applied |
| 6/9 | mlxsw: Send PTP packets as data packets to overcome a limitationdrivers/ drivers/ drivers/ +1 more | +175 | 0 replies | Applied |
| 7/9 | mlxsw: spectrum: Support time stamping on Spectrum-2drivers/ drivers/ drivers/ +1 more | +104 | 0 replies | Applied |
| 8/9 | mlxsw: spectrum_ptp: Support SIOCGHWTSTAMP, SIOCSHWTSTAMP ioctlsdrivers/ drivers/ | +223 | 0 replies | Applied |
| 9/9 | mlxsw: spectrum: Support ethtool 'get_ts_info' callback in Spectrum-2drivers/ drivers/ | +28 | 0 replies | Applied |
Reviews trailers per patch
All 9 patches have a Reviewed-by or Acked-by.
| Patch | Petr Machata |
|---|---|
| 1/9 | R-b |
| 2/9 | R-b |
| 3/9 | R-b |
| 4/9 | R-b |
| 5/9 | R-b |
| 6/9 | R-b |
| 7/9 | R-b |
| 8/9 | R-b |
| 9/9 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next 0/9] mlxsw: Add PTP support for Spectrum-2 and newer ASICs
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(-)
Signature · 1 line
2.36.1