linux/drivers/net/ethernet/freescale/enetc
Yangbo Lu 7294380c52 enetc: support PTP Sync packet one-step timestamping
This patch is to add support for PTP Sync packet one-step timestamping.
Since ENETC single-step register has to be configured dynamically per
packet for correctionField offeset and UDP checksum update, current
one-step timestamping packet has to be sent only when the last one
completes transmitting on hardware. So, on the TX, this patch handles
one-step timestamping packet as below:

- Trasmit packet immediately if no other one in transfer, or queue to
  skb queue if there is already one in transfer.
  The test_and_set_bit_lock() is used here to lock and check state.
- Start a work when complete transfer on hardware, to release the bit
  lock and to send one skb in skb queue if has.

And the configuration for one-step timestamping on ENETC before
transmitting is,

- Set one-step timestamping flag in extension BD.
- Write 30 bits current timestamp in tstamp field of extension BD.
- Update PTP Sync packet originTimestamp field with current timestamp.
- Configure single-step register for correctionField offeset and UDP
  checksum update.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-12 13:34:21 -07:00
..
enetc_cbdr.c net: enetc: pass bd_count as an argument to enetc_setup_cbdr 2021-03-10 13:14:15 -08:00
enetc_ethtool.c enetc: support PTP Sync packet one-step timestamping 2021-04-12 13:34:21 -07:00
enetc_hw.h enetc: support PTP Sync packet one-step timestamping 2021-04-12 13:34:21 -07:00
enetc_mdio.c enetc: reorder macros and functions 2021-01-05 15:19:19 -08:00
enetc_msg.c enetc: Add vf to pf messaging support 2019-01-24 21:55:53 -08:00
enetc_pci_mdio.c net: enetc: fix an issue about leak system resources 2020-05-04 10:51:20 -07:00
enetc_pf.c net: enetc: add support for XDP_REDIRECT 2021-03-31 14:57:44 -07:00
enetc_pf.h enetc: Migrate to PHYLINK and PCS_LYNX 2020-10-11 11:04:42 -07:00
enetc_ptp.c enetc: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions 2019-08-31 23:53:17 -07:00
enetc_qos.c flow_offload: reject configuration of packet-per-second policing in offload drivers 2021-03-13 14:18:09 -08:00
enetc_vf.c net: enetc: teardown CBDR during PF/VF unbind 2021-03-19 12:13:11 -07:00
enetc.c enetc: support PTP Sync packet one-step timestamping 2021-04-12 13:34:21 -07:00
enetc.h enetc: support PTP Sync packet one-step timestamping 2021-04-12 13:34:21 -07:00
Kconfig enetc: auto select PHYLIB and MDIO_DEVRES 2021-02-11 18:12:47 -08:00
Makefile enetc: Make MDIO accessors more generic and export to include/linux/fsl 2020-01-05 23:22:32 -08:00