netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] net: ethernet: ti: cpts: fix tx timestamping timeout
@ 2017-07-28 22:30 Grygorii Strashko
  2017-07-28 22:30 ` [PATCH v4 1/4] ptp: introduce ptp auxiliary worker Grygorii Strashko
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Grygorii Strashko @ 2017-07-28 22:30 UTC (permalink / raw)
  To: David S. Miller, netdev, Richard Cochran
  Cc: Sekhar Nori, linux-kernel, linux-omap, Wingman Kwok,
	Ivan Khoronzhuk, John Stultz, Thomas Gleixner, Grygorii Strashko

Hi

With the low Ethernet connection speed cpdma notification about packet
processing can be received before CPTS TX timestamp event, which is set
when packet actually left CPSW while cpdma notification is sent when packet
pushed in CPSW fifo. As result, when connection is slow and CPU is fast
enough TX timestamping is not working properly.
Issue was discovered using timestamping tool on am57x boards with Ethernet link
speed forced to 100M and on am335x-evm with Ethernet link speed forced to 10M.

Patch3 - This series fixes it by introducing TX SKB queue to store PTP SKBs for
which Ethernet Transmit Event hasn't been received yet and then re-check this
queue with new Ethernet Transmit Events by scheduling CPTS overflow
work more often until TX SKB queue is not empty.

Patch 1,2 - As CPTS overflow work is time critical task it important to ensure
that its scheduling is not delayed. Unfortunately, There could be significant
delay in CPTS work schedule under high system load and on -RT which could cause
CPTS misbehavior due to internal counter overflow and there is no way to tune
CPTS overflow work execution policy and priority manually. The kthread_worker
can be used instead of workqueues, as it creates separate named kthread for
each worker and its its execution policy and priority can be configured
using chrt tool. Instead of modifying CPTS driver itself it was proposed to
it was proposed to add PTP auxiliary worker to the PHC subsystem [1], so
other drivers can benefit from this feature also.

[1] https://www.spinics.net/lists/netdev/msg445392.html

changes in v4:
- fixed memleak in ptp_clock_register()
- undocumented change in cpts_find_ts() moved to separate patch (minor fix)

changes in v3:
- patch 1: added proper error handling in ptp_clock_register. 
  minor comments applied.

changes in v2:
- added PTP auxiliary worker to the PHC subsystem

Links
v3: https://www.spinics.net/lists/netdev/msg446058.html
v2: https://www.spinics.net/lists/netdev/msg445859.html
v1: https://www.spinics.net/lists/netdev/msg445387.html

Grygorii Strashko (4):
  ptp: introduce ptp auxiliary worker
  net: ethernet: ti: cpts: convert to use ptp auxiliary worker
  net: ethernet: ti: cpts: fix tx timestamping timeout
  net: ethernet: ti: cpts: fix fifo read in cpts_find_ts

 drivers/net/ethernet/ti/cpts.c   | 111 +++++++++++++++++++++++++++++++++------
 drivers/net/ethernet/ti/cpts.h   |   2 +-
 drivers/ptp/ptp_clock.c          |  42 +++++++++++++++
 drivers/ptp/ptp_private.h        |   3 ++
 include/linux/ptp_clock_kernel.h |  20 +++++++
 5 files changed, 161 insertions(+), 17 deletions(-)

-- 
2.10.1

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

end of thread, other threads:[~2017-08-01 22:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-28 22:30 [PATCH v4 0/4] net: ethernet: ti: cpts: fix tx timestamping timeout Grygorii Strashko
2017-07-28 22:30 ` [PATCH v4 1/4] ptp: introduce ptp auxiliary worker Grygorii Strashko
2017-07-28 22:30 ` [PATCH v4 2/4] net: ethernet: ti: cpts: convert to use " Grygorii Strashko
2017-07-28 22:30 ` [PATCH v4 3/4] net: ethernet: ti: cpts: fix tx timestamping timeout Grygorii Strashko
2017-07-28 22:30 ` [PATCH v4 4/4] net: ethernet: ti: cpts: fix fifo read in cpts_find_ts Grygorii Strashko
2017-08-01 22:24 ` [PATCH v4 0/4] net: ethernet: ti: cpts: fix tx timestamping timeout David Miller

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).