All of lore.kernel.org
 help / color / mirror / Atom feed
* [v3, 0/6] dpaa2_eth: support 1588 one-step timestamping
@ 2020-09-16 12:08 Yangbo Lu
  2020-09-16 12:08 ` [v3, 1/6] dpaa2-eth: add APIs of 1588 single step timestamping Yangbo Lu
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Yangbo Lu @ 2020-09-16 12:08 UTC (permalink / raw)
  To: netdev
  Cc: Yangbo Lu, David S . Miller, Jakub Kicinski, Ioana Ciornei,
	Ioana Radulescu, Richard Cochran

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.

Yangbo Lu (6):
  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
  dpaa2-eth: fix a build warning in dpmac.c

 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c   | 232 ++++++++++++++++++---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h   |  44 +++-
 .../net/ethernet/freescale/dpaa2/dpaa2-ethtool.c   |   4 +-
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c   |   3 +-
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.h   |   4 +
 drivers/net/ethernet/freescale/dpaa2/dpmac.c       |   2 +-
 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 +++
 9 files changed, 382 insertions(+), 38 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2020-09-18  9:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 12:08 [v3, 0/6] dpaa2_eth: support 1588 one-step timestamping Yangbo Lu
2020-09-16 12:08 ` [v3, 1/6] dpaa2-eth: add APIs of 1588 single step timestamping Yangbo Lu
2020-09-16 12:08 ` [v3, 2/6] dpaa2-eth: define a global ptp_qoriq structure pointer Yangbo Lu
2020-09-16 12:08 ` [v3, 3/6] dpaa2-eth: invoke dpaa2_eth_enable_tx_tstamp() once in code Yangbo Lu
2020-09-16 12:08 ` [v3, 4/6] dpaa2-eth: utilize skb->cb[0] for hardware timestamping Yangbo Lu
2020-09-16 12:08 ` [v3, 5/6] dpaa2-eth: support PTP Sync packet one-step timestamping Yangbo Lu
2020-09-16 19:22   ` Saeed Mahameed
2020-09-18  9:12     ` Y.b. Lu
2020-09-16 12:08 ` [v3, 6/6] dpaa2-eth: fix a build warning in dpmac.c Yangbo Lu
2020-09-16 14:33   ` Ioana Ciornei
2020-09-18  8:59     ` Y.b. Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.