linux/drivers/net/ethernet/freescale
Yangbo Lu c55211892f dpaa2-eth: support PTP Sync packet one-step timestamping
This patch is to add PTP sync packet one-step timestamping support.
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.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-09-18 14:32:48 -07:00
..
dpaa treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dpaa2 dpaa2-eth: support PTP Sync packet one-step timestamping 2020-09-18 14:32:48 -07:00
enetc enetc: use napi_schedule to be compatible with PREEMPT_RT 2020-08-03 18:21:30 -07:00
fman treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
fs_enet fs_enet: Avoid comma separated statements 2020-08-25 07:54:19 -07:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile net: dsa: felix: fix link error 2020-01-08 16:05:54 -08:00
fec.h net: fec: fix hardware time stamping by external devices 2020-07-16 11:20:38 -07:00
fec_main.c net: ethernet: fec: remove redundant null check before clk_disable_unprepare() 2020-09-07 13:34:42 -07:00
fec_mpc52xx.c net: convert suitable network drivers to use phy_do_ioctl 2020-01-21 10:50:41 +01:00
fec_mpc52xx.h
fec_mpc52xx_phy.c
fec_ptp.c net: fec: ptp: remove unused variable 'ns' in fec_time_keep() 2020-09-14 13:42:50 -07:00
fsl_pq_mdio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
gianfar.c net: gianfar: Add of_node_put() before goto statement 2020-08-18 13:12:12 -07:00
gianfar.h net/freescale: Clean drivers from static versions 2020-03-03 17:54:55 -08:00
gianfar_ethtool.c net: gianfar: reject unsupported coalescing params 2020-03-12 11:32:35 -07:00
ucc_geth.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ucc_geth.h net/freescale: Clean drivers from static versions 2020-03-03 17:54:55 -08:00
ucc_geth_ethtool.c net/freescale: Don't set zero if FW not-available in ucc_geth 2020-03-03 17:54:55 -08:00
xgmac_mdio.c net/fsl: enable extended scanning in xgmac_mdio 2020-06-23 20:35:15 -07:00