Skip to content

dpaa2_eth: support 1588 one-step timestamping

Yangbo Lu netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 1 replyIn review
  2. v36 patches 4 repliesSuperseded
  3. v25 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches6 repliesSuperseded

Changes in v4 from the cover letter

- Used WARN_ONCE instead of netdev_err in data path.
- Enabled timestamping only when PTP driver is ready.
- Added comments in using onestep_tstamp_lock.
- Dropped dpmac.c sparse warning fix-up patch.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dpaa2-eth: add APIs of 1588 single step timestampingdrivers/net/ethernet/freescale/dpaa2/dpni-cmd.h drivers/net/ethernet/freescale/dpaa2/dpni.c drivers/net/ethernet/freescale/dpaa2/dpni.h+131 -00 replies
2/5dpaa2-eth: define a global ptp_qoriq structure pointerdrivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c +1 more+11 -10 replies
3/5dpaa2-eth: invoke dpaa2_eth_enable_tx_tstamp() once in codedrivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c+16 -150 replies
4/5dpaa2-eth: utilize skb->cb[0] for hardware timestampingdrivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h+23 -160 replies
5/5dpaa2-eth: support PTP Sync packet one-step timestampingdrivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c+209 -160 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [v4, 0/5] dpaa2_eth: support 1588 one-step timestamping

This patch-set is to add MC APIs of 1588 one-step timestamping, and support one-step timestamping for PTP Sync packet on DPAA2.

Before egress, one-step timestamping enablement needs,

- Enabling timestamp and FAS (Frame Annotation Status) in dpni buffer layout.

- Write timestamp to frame annotation and set PTP bit in FAS to mark as one-step timestamping event.

- Enabling one-step timestamping by dpni_set_single_step_cfg() API, with offset provided to insert correction time on frame. The offset must respect all MAC headers, VLAN tags and other protocol headers accordingly. The correction field update can consider delays up to one second. So PTP frame needs to be filtered and parsed, and written timestamp into Sync frame originTimestamp field.

The operation of API dpni_set_single_step_cfg() has to be done when no one-step timestamping frames are in flight. So we have to make sure the last one-step timestamping frame has already been transmitted on hardware before starting to send the current one. The resolution is,

- Utilize skb->cb[0] to mark timestamping request per packet. If it is one-step timestamping PTP sync packet, queue to skb queue. If not, transmit immediately.

- Schedule a work to transmit skbs in skb queue.

- mutex lock is used to ensure the last one-step timestamping packet has already been transmitted on hardware through TX confirmation queue before transmitting current packet.

Changes for v2:
- Removed unused variable priv in dpaa2_eth_xdp_create_fd().
Changes for v3:
- Fixed sparse warnings.
- Fix build issue on 32-bit.
- Converted to use ptp_parse_header.
Changes for v4:
- Used WARN_ONCE instead of netdev_err in data path.
- Enabled timestamping only when PTP driver is ready.
- Added comments in using onestep_tstamp_lock.
- Dropped dpmac.c sparse warning fix-up patch.

Yangbo Lu (5):
dpaa2-eth: add APIs of 1588 single step timestamping
dpaa2-eth: define a global ptp_qoriq structure pointer
dpaa2-eth: invoke dpaa2_eth_enable_tx_tstamp() once in code
dpaa2-eth: utilize skb->cb[0] for hardware timestamping
dpaa2-eth: support PTP Sync packet one-step timestamping

 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c   | 227 ++++++++++++++++++---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h   |  44 +++-
 .../net/ethernet/freescale/dpaa2/dpaa2-ethtool.c   |   7 +-
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c   |   3 +-
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.h   |   4 +
 drivers/net/ethernet/freescale/dpaa2/dpni-cmd.h    |  21 ++
 drivers/net/ethernet/freescale/dpaa2/dpni.c        |  79 +++++++
 drivers/net/ethernet/freescale/dpaa2/dpni.h        |  31 +++
 8 files changed, 379 insertions(+), 37 deletions(-)
Signature · 1 line
2.7.4