netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next, v3, 0/2] enetc: support PTP Sync packet one-step timestamping
@ 2021-04-12  9:03 Yangbo Lu
  2021-04-12  9:03 ` [net-next, v3, 1/2] enetc: mark TX timestamp type per skb Yangbo Lu
  2021-04-12  9:03 ` [net-next, v3, 2/2] enetc: support PTP Sync packet one-step timestamping Yangbo Lu
  0 siblings, 2 replies; 6+ messages in thread
From: Yangbo Lu @ 2021-04-12  9:03 UTC (permalink / raw)
  To: netdev
  Cc: Yangbo Lu, David S . Miller, Richard Cochran, Claudiu Manoil,
	Jakub Kicinski, Vladimir Oltean, Russell King

This patch-set 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.

Changes for v2:
	- Rebased.
	- Fixed issues from patchwork checks.
	- netif_tx_lock for one-step timestamping packet sending.
Changes for v3:
	- Used system workqueue.
	- Set bit lock when transmitted one-step packet, and scheduled
	  work when completed. The worker cleared the bit lock, and
	  transmitted one skb in skb queue if has, instead of a loop.

Yangbo Lu (2):
  enetc: mark TX timestamp type per skb
  enetc: support PTP Sync packet one-step timestamping

 drivers/net/ethernet/freescale/enetc/enetc.c  | 193 ++++++++++++++++--
 drivers/net/ethernet/freescale/enetc/enetc.h  |  23 ++-
 .../ethernet/freescale/enetc/enetc_ethtool.c  |   3 +-
 .../net/ethernet/freescale/enetc/enetc_hw.h   |   7 +
 4 files changed, 200 insertions(+), 26 deletions(-)


base-commit: 5b489fea977c2b23e26e2f630478da0f4bfdc879
-- 
2.25.1


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

end of thread, other threads:[~2021-04-13  3:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  9:03 [net-next, v3, 0/2] enetc: support PTP Sync packet one-step timestamping Yangbo Lu
2021-04-12  9:03 ` [net-next, v3, 1/2] enetc: mark TX timestamp type per skb Yangbo Lu
2021-04-12 18:59   ` Claudiu Manoil
2021-04-12  9:03 ` [net-next, v3, 2/2] enetc: support PTP Sync packet one-step timestamping Yangbo Lu
2021-04-12 19:00   ` Claudiu Manoil
2021-04-13  3:46   ` Y.b. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).